RKE1 示例 YAML

以下是一个供参考的 RKE 模板配置文件示例。

RKE 模板中的 YAML 使用与创建 RKE 集群时相同的自定义项。但是,由于 YAML 位于 Rancher 配置的 RKE 集群的上下文中,因此 RKE 文档中的自定义项需要嵌套在 rancher_kubernetes_engine 指令下。

  1. #
  2. # Cluster Config
  3. #
  4. docker_root_dir: /var/lib/docker
  5. enable_cluster_alerting: false
  6. # This setting is not enforced. Clusters
  7. # created with this sample template
  8. # would have alerting turned off by default,
  9. # but end users could still turn alerting
  10. # on or off.
  11. enable_cluster_monitoring: true
  12. # This setting is not enforced. Clusters
  13. # created with this sample template
  14. # would have monitoring turned on
  15. # by default, but end users could still
  16. # turn monitoring on or off.
  17. enable_network_policy: false
  18. local_cluster_auth_endpoint:
  19. enabled: true
  20. #
  21. # Rancher Config
  22. #
  23. rancher_kubernetes_engine_config: # Your RKE template config goes here.
  24. addon_job_timeout: 30
  25. authentication:
  26. strategy: x509
  27. ignore_docker_version: true
  28. #
  29. # # 目前仅支持 Nginx ingress provider
  30. # # 要禁用 Ingress controller,设置 `provider: none`
  31. # # 要在指定节点上禁用 Ingress,使用 node_selector,例如:
  32. # provider: nginx
  33. # node_selector:
  34. # app: ingress
  35. #
  36. ingress:
  37. provider: nginx
  38. kubernetes_version: v1.15.3-rancher3-1
  39. monitoring:
  40. provider: metrics-server
  41. #
  42. # If you are using calico on AWS
  43. #
  44. # network:
  45. # plugin: calico
  46. # calico_network_provider:
  47. # cloud_provider: aws
  48. #
  49. # # To specify flannel interface
  50. #
  51. # network:
  52. # plugin: flannel
  53. # flannel_network_provider:
  54. # iface: eth1
  55. #
  56. # # To specify flannel interface for canal plugin
  57. #
  58. # network:
  59. # plugin: canal
  60. # canal_network_provider:
  61. # iface: eth1
  62. #
  63. network:
  64. options:
  65. flannel_backend_type: vxlan
  66. plugin: canal
  67. #
  68. # services:
  69. # kube-api:
  70. # service_cluster_ip_range: 10.43.0.0/16
  71. # kube-controller:
  72. # cluster_cidr: 10.42.0.0/16
  73. # service_cluster_ip_range: 10.43.0.0/16
  74. # kubelet:
  75. # cluster_domain: cluster.local
  76. # cluster_dns_server: 10.43.0.10
  77. #
  78. services:
  79. etcd:
  80. backup_config:
  81. enabled: true
  82. interval_hours: 12
  83. retention: 6
  84. safe_timestamp: false
  85. creation: 12h
  86. extra_args:
  87. election-timeout: 5000
  88. heartbeat-interval: 500
  89. gid: 0
  90. retention: 72h
  91. snapshot: false
  92. uid: 0
  93. kube_api:
  94. always_pull_images: false
  95. pod_security_policy: false
  96. service_node_port_range: 30000-32767
  97. ssh_agent_auth: false
  98. windows_prefered_cluster: false