RKE uses a cluster.yml file to install and configure your Kubernetes cluster.

    This template is intended to be used for RKE add-on installs, which are only supported up to Rancher v2.0.8. Please use the Rancher Helm chart if you are installing a newer Rancher version.

    The following template can be used for the cluster.yml if you have a setup with:

    For more options, refer to RKE Documentation: Config Options.

    1. nodes:
    2. - address: <IP> # hostname or IP to access nodes
    3. user: <USER> # root user (usually 'root')
    4. role: [controlplane,etcd,worker] # K8s roles for node
    5. ssh_key_path: <PEM_FILE> # path to PEM file
    6. - address: <IP>
    7. user: <USER>
    8. role: [controlplane,etcd,worker]
    9. ssh_key_path: <PEM_FILE>
    10. - address: <IP>
    11. user: <USER>
    12. role: [controlplane,etcd,worker]
    13. ssh_key_path: <PEM_FILE>
    14. services:
    15. etcd:
    16. snapshot: true
    17. creation: 6h
    18. retention: 24h
    19. addons: |-
    20. ---
    21. kind: Namespace
    22. apiVersion: v1
    23. metadata:
    24. name: cattle-system
    25. ---
    26. kind: ServiceAccount
    27. apiVersion: v1
    28. metadata:
    29. name: cattle-admin
    30. namespace: cattle-system
    31. ---
    32. kind: ClusterRoleBinding
    33. apiVersion: rbac.authorization.k8s.io/v1
    34. metadata:
    35. name: cattle-crb
    36. namespace: cattle-system
    37. subjects:
    38. - kind: ServiceAccount
    39. name: cattle-admin
    40. namespace: cattle-system
    41. roleRef:
    42. kind: ClusterRole
    43. name: cluster-admin
    44. apiGroup: rbac.authorization.k8s.io
    45. ---
    46. apiVersion: v1
    47. kind: Service
    48. metadata:
    49. namespace: cattle-system
    50. name: cattle-service
    51. labels:
    52. app: cattle
    53. spec:
    54. ports:
    55. - port: 80
    56. targetPort: 80
    57. protocol: TCP
    58. name: http
    59. selector:
    60. app: cattle
    61. ---
    62. apiVersion: extensions/v1beta1
    63. kind: Ingress
    64. metadata:
    65. namespace: cattle-system
    66. name: cattle-ingress-http
    67. annotations:
    68. nginx.ingress.kubernetes.io/proxy-connect-timeout: "30"
    69. nginx.ingress.kubernetes.io/proxy-read-timeout: "1800" # Max time in seconds for ws to remain shell window open
    70. nginx.ingress.kubernetes.io/proxy-send-timeout: "1800" # Max time in seconds for ws to remain shell window open
    71. nginx.ingress.kubernetes.io/ssl-redirect: "false" # Disable redirect to ssl
    72. spec:
    73. rules:
    74. - host: <FQDN>
    75. http:
    76. paths:
    77. - backend:
    78. serviceName: cattle-service
    79. servicePort: 80
    80. ---
    81. kind: Deployment
    82. apiVersion: extensions/v1beta1
    83. metadata:
    84. namespace: cattle-system
    85. name: cattle
    86. spec:
    87. replicas: 1
    88. template:
    89. metadata:
    90. labels:
    91. app: cattle
    92. spec:
    93. serviceAccountName: cattle-admin
    94. containers:
    95. # Rancher install via RKE addons is only supported up to v2.0.8
    96. - image: rancher/rancher:v2.0.8
    97. args:
    98. - --no-cacerts
    99. imagePullPolicy: Always
    100. name: cattle-server
    101. # env:
    102. # - name: HTTP_PROXY
    103. # value: "http://your_proxy_address:port"
    104. # - name: HTTPS_PROXY
    105. # value: "http://your_proxy_address:port"
    106. # - name: NO_PROXY
    107. # value: "localhost,127.0.0.1,0.0.0.0,10.43.0.0/16,your_network_ranges_that_dont_need_proxy_to_access"
    108. livenessProbe:
    109. httpGet:
    110. path: /ping
    111. port: 80
    112. initialDelaySeconds: 60
    113. periodSeconds: 60
    114. readinessProbe:
    115. httpGet:
    116. path: /ping
    117. port: 80
    118. initialDelaySeconds: 20
    119. periodSeconds: 10
    120. ports:
    121. - containerPort: 80
    122. protocol: TCP