1
- apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
2
- kind : DockerCluster
3
- metadata :
4
- name : ${CLUSTER_NAME}
5
- namespace : ${NAMESPACE}
6
- annotations :
7
- " helm.sh/resource-policy " : keep
8
- spec :
9
- loadBalancer :
10
- customHAProxyConfigTemplateRef :
11
- name : ${CLUSTER_NAME}-lb-config
12
- ---
13
1
apiVersion : cluster.x-k8s.io/v1beta1
14
2
kind : Cluster
15
3
metadata :
@@ -18,7 +6,7 @@ metadata:
18
6
annotations :
19
7
cluster-api.cattle.io/upstream-system-agent : " true"
20
8
labels :
21
- cni : ${CLUSTER_NAME}-crs-0
9
+ cni : kindnet
22
10
spec :
23
11
clusterNetwork :
24
12
pods :
@@ -28,72 +16,152 @@ spec:
28
16
cidrBlocks :
29
17
- 10.10.0.0/16
30
18
serviceDomain : cluster.local
31
- controlPlaneRef :
32
- apiVersion : controlplane.cluster.x-k8s.io/v1beta1
33
- kind : RKE2ControlPlane
34
- name : ${CLUSTER_NAME}-control-plane
35
- infrastructureRef :
36
- apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
37
- kind : DockerCluster
38
- name : ${CLUSTER_NAME}
19
+ topology :
20
+ class : ${CLUSTER_NAME}
21
+ controlPlane :
22
+ replicas : ${CONTROL_PLANE_MACHINE_COUNT}
23
+ variables :
24
+ - name : rke2CNI
25
+ value : ${RKE2_CNI}
26
+ - name : dockerImage
27
+ value : kindest/node:${KUBERNETES_VERSION}
28
+ version : ${RKE2_VERSION}
29
+ workers :
30
+ machineDeployments :
31
+ - class : default-worker
32
+ name : md-0
33
+ replicas : ${WORKER_MACHINE_COUNT}
34
+ ---
35
+ apiVersion : cluster.x-k8s.io/v1beta1
36
+ kind : ClusterClass
37
+ metadata :
38
+ name : ${CLUSTER_NAME}
39
+ namespace : ${NAMESPACE}
40
+ spec :
41
+ infrastructure :
42
+ ref :
43
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
44
+ kind : DockerClusterTemplate
45
+ name : ${CLUSTER_NAME}
46
+ controlPlane :
47
+ ref :
48
+ apiVersion : controlplane.cluster.x-k8s.io/v1beta1
49
+ kind : RKE2ControlPlaneTemplate
50
+ name : ${CLUSTER_NAME}-control-plane
51
+ machineInfrastructure :
52
+ ref :
53
+ kind : DockerMachineTemplate
54
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
55
+ name : ${CLUSTER_NAME}-control-plane
56
+ workers :
57
+ machineDeployments :
58
+ - class : default-worker
59
+ template :
60
+ bootstrap :
61
+ ref :
62
+ apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
63
+ kind : RKE2ConfigTemplate
64
+ name : ${CLUSTER_NAME}-worker-bootstraptemplate
65
+ infrastructure :
66
+ ref :
67
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
68
+ kind : DockerMachineTemplate
69
+ name : ${CLUSTER_NAME}-worker-machinetemplate
70
+ variables :
71
+ - name : rke2CNI
72
+ required : true
73
+ schema :
74
+ openAPIV3Schema :
75
+ type : string
76
+ - name : dockerImage
77
+ required : true
78
+ schema :
79
+ openAPIV3Schema :
80
+ type : string
81
+ patches :
82
+ - name : rke2CNI
83
+ definitions :
84
+ - selector :
85
+ apiVersion : controlplane.cluster.x-k8s.io/v1beta1
86
+ kind : RKE2ControlPlaneTemplate
87
+ matchResources :
88
+ controlPlane : true
89
+ jsonPatches :
90
+ - op : add
91
+ path : /spec/template/spec/serverConfig/cni
92
+ valueFrom :
93
+ variable : rke2CNI
94
+ - name : dockerImage
95
+ definitions :
96
+ - selector :
97
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
98
+ kind : DockerMachineTemplate
99
+ matchResources :
100
+ controlPlane : true
101
+ machineDeploymentClass :
102
+ names :
103
+ - default-worker
104
+ jsonPatches :
105
+ - op : add
106
+ path : /spec/template/spec/customImage
107
+ valueFrom :
108
+ variable : dockerImage
39
109
---
40
110
apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
41
- kind : DockerMachineTemplate
111
+ kind : DockerClusterTemplate
42
112
metadata :
43
- name : ${CLUSTER_NAME}-control-plane
113
+ name : ${CLUSTER_NAME}
44
114
namespace : ${NAMESPACE}
45
115
spec :
46
- template :
47
- spec :
48
- customImage : kindest/node:${KUBERNETES_VERSION}
49
- bootstrapTimeout : 15m
116
+ loadBalancer :
117
+ customHAProxyConfigTemplateRef :
118
+ name : ${CLUSTER_NAME}-lb-config
50
119
---
51
120
apiVersion : controlplane.cluster.x-k8s.io/v1beta1
52
- kind : RKE2ControlPlane
121
+ kind : RKE2ControlPlaneTemplate
53
122
metadata :
54
123
name : ${CLUSTER_NAME}-control-plane
55
124
namespace : ${NAMESPACE}
56
125
spec :
57
- replicas : ${CONTROL_PLANE_MACHINE_COUNT}
58
- version : ${RKE2_VERSION}
59
- rolloutStrategy :
60
- rollingUpdate :
61
- maxSurge : 1
62
- type : RollingUpdate
63
- serverConfig :
64
- cloudProviderName : external
65
- cni : ${RKE2_CNI}
66
- kubeAPIServer :
67
- extraArgs :
68
- - --anonymous-auth=true
69
- disableComponents :
70
- pluginComponents :
71
- - rke2-ingress-nginx
72
- kubernetesComponents :
73
- - cloudController
74
- etcd :
75
- backupConfig :
76
- scheduleCron : ' */5 * * * *'
77
- retention : " 1"
78
- agentConfig :
79
- nodeAnnotations :
80
- test : " true"
81
- machineTemplate :
82
- infrastructureRef :
83
- apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
84
- kind : DockerMachineTemplate
85
- name : ${CLUSTER_NAME}-control-plane
86
- nodeDrainTimeout : 30s
87
- infrastructureRef :
88
- apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
89
- kind : DockerMachineTemplate
90
- name : ${CLUSTER_NAME}-control-plane
91
- nodeDrainTimeout : 30s
126
+ template :
127
+ spec :
128
+ rolloutStrategy :
129
+ rollingUpdate :
130
+ maxSurge : 1
131
+ type : RollingUpdate
132
+ serverConfig :
133
+ cloudProviderName : external
134
+ kubeAPIServer :
135
+ extraArgs :
136
+ - --anonymous-auth=true
137
+ disableComponents :
138
+ pluginComponents :
139
+ - rke2-ingress-nginx
140
+ kubernetesComponents :
141
+ - cloudController
142
+ etcd :
143
+ backupConfig :
144
+ scheduleCron : ' */5 * * * *'
145
+ retention : " 1"
146
+ agentConfig :
147
+ nodeAnnotations :
148
+ test : " true"
149
+ nodeDrainTimeout : 30s
92
150
---
93
151
apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
94
152
kind : DockerMachineTemplate
95
153
metadata :
96
- name : ${CLUSTER_NAME}-md-0
154
+ name : ${CLUSTER_NAME}-control-plane
155
+ namespace : ${NAMESPACE}
156
+ spec :
157
+ template :
158
+ spec :
159
+ bootstrapTimeout : 15m
160
+ ---
161
+ apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
162
+ kind : DockerMachineTemplate
163
+ metadata :
164
+ name : ${CLUSTER_NAME}-worker-machinetemplate
97
165
namespace : ${NAMESPACE}
98
166
spec :
99
167
template :
@@ -104,35 +172,10 @@ spec:
104
172
apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
105
173
kind : RKE2ConfigTemplate
106
174
metadata :
107
- name : ${CLUSTER_NAME}-md-0
175
+ name : ${CLUSTER_NAME}-worker-bootstraptemplate
108
176
namespace : ${NAMESPACE}
109
177
spec : {}
110
178
---
111
- apiVersion : cluster.x-k8s.io/v1beta1
112
- kind : MachineDeployment
113
- metadata :
114
- name : ${CLUSTER_NAME}-md-0
115
- namespace : ${NAMESPACE}
116
- spec :
117
- clusterName : ${CLUSTER_NAME}
118
- replicas : ${WORKER_MACHINE_COUNT}
119
- selector :
120
- matchLabels :
121
- cluster.x-k8s.io/cluster-name : ${CLUSTER_NAME}
122
- template :
123
- spec :
124
- version : ${RKE2_VERSION}
125
- clusterName : ${CLUSTER_NAME}
126
- bootstrap :
127
- configRef :
128
- apiVersion : bootstrap.cluster.x-k8s.io/v1beta1
129
- kind : RKE2ConfigTemplate
130
- name : ${CLUSTER_NAME}-md-0
131
- infrastructureRef :
132
- apiVersion : infrastructure.cluster.x-k8s.io/v1beta1
133
- kind : DockerMachineTemplate
134
- name : ${CLUSTER_NAME}-md-0
135
- ---
136
179
apiVersion : v1
137
180
data :
138
181
value : |-
0 commit comments