Skip to content

Commit 824bb30

Browse files
Merge pull request #813 from anmazzotti/actualize_examples_to_v1beta2
chore: actualize examples to v1beta2
2 parents de41026 + c09ff48 commit 824bb30

15 files changed

+293
-272
lines changed
Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
apiVersion: cluster.x-k8s.io/v1beta1
2+
apiVersion: cluster.x-k8s.io/v1beta2
33
kind: Cluster
44
metadata:
55
name: "${CLUSTER_NAME}"
6-
namespace: default
6+
namespace: "${NAMESPACE}"
77
spec:
88
clusterNetwork:
99
pods:
@@ -14,10 +14,10 @@ spec:
1414
cidrBlocks:
1515
- 10.46.0.0/16
1616
topology:
17-
class: rke2-class
17+
classRef:
18+
name: "${CLASS_NAME}"
1819
version: ${KUBERNETES_VERSION}+rke2r1
1920
controlPlane:
20-
metadata: {}
2121
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
2222
workers:
2323
machineDeployments:
@@ -26,5 +26,4 @@ spec:
2626
replicas: ${WORKER_MACHINE_COUNT}
2727
variables:
2828
- name: dockerKindImage
29-
value: kindest/node:${KUBERNETES_VERSION}
30-
29+
value: kindest/node:${KIND_IMAGE_VERSION}

examples/clusterclass/docker/clusterclass-template.yaml

Lines changed: 29 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,48 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: ClusterClass
33
metadata:
44
name: rke2-class
55
spec:
66
controlPlane:
7-
ref:
7+
templateRef:
88
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
99
kind: RKE2ControlPlaneTemplate
1010
name: rke2-class-control-plane
1111
machineInfrastructure:
12-
ref:
13-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
12+
templateRef:
13+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1414
kind: DockerMachineTemplate
1515
name: rke2-class-control-plane
1616
infrastructure:
17-
ref:
18-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
17+
templateRef:
18+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1919
kind: DockerClusterTemplate
2020
name: rke2-class-cluster
2121
workers:
2222
machineDeployments:
2323
- class: default-worker
24-
template:
25-
bootstrap:
26-
ref:
27-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
28-
kind: RKE2ConfigTemplate
29-
name: rke2-class-default-worker-bootstraptemplate
30-
infrastructure:
31-
ref:
32-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
33-
kind: DockerMachineTemplate
34-
name: rke2-class-default-worker-machinetemplate
24+
bootstrap:
25+
templateRef:
26+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
27+
kind: RKE2ConfigTemplate
28+
name: rke2-class-default-worker-bootstraptemplate
29+
infrastructure:
30+
templateRef:
31+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
32+
kind: DockerMachineTemplate
33+
name: rke2-class-default-worker-machinetemplate
3534
variables:
3635
- name: dockerKindImage
3736
required: true
3837
schema:
3938
openAPIV3Schema:
4039
type: string
41-
default: kindest/node:v1.28.12
40+
default: kindest/node:v1.34.0
4241
patches:
4342
- name: controlPlaneDockerKindImage
4443
definitions:
4544
- selector:
46-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
45+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
4746
kind: DockerMachineTemplate
4847
matchResources:
4948
controlPlane: true
@@ -55,7 +54,7 @@ spec:
5554
- name: workerDockerKindImage
5655
definitions:
5756
- selector:
58-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
57+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
5958
kind: DockerMachineTemplate
6059
matchResources:
6160
machineDeploymentClass:
@@ -131,9 +130,8 @@ data:
131130
kind: ConfigMap
132131
metadata:
133132
name: rke2-class-lb-config
134-
namespace: default
135133
---
136-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
134+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
137135
kind: DockerClusterTemplate
138136
metadata:
139137
name: rke2-class-cluster
@@ -154,47 +152,43 @@ spec:
154152
gzipUserData: false
155153
serverConfig:
156154
cni: calico
155+
disableComponents:
156+
kubernetesComponents: [ "cloudController"]
157157
kubeAPIServer:
158158
extraArgs:
159159
- --anonymous-auth=true
160-
disableComponents:
161-
kubernetesComponents: [ "cloudController"]
162-
machineTemplate:
163-
nodeDrainTimeout: 2m
164-
nodeDeletionTimeout: 30s
165-
nodeVolumeDetachTimeout: 5m
166160
rolloutStrategy:
167161
type: "RollingUpdate"
168162
rollingUpdate:
169163
maxSurge: 1
170164
---
171-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
165+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
172166
kind: DockerMachineTemplate
173167
metadata:
174168
name: rke2-class-control-plane
175169
spec:
176170
template:
177171
spec:
178-
customImage: kindest/node:v1.28.0 # will be replaced by the patch
172+
customImage: kindest/node:v1.34.0 # will be replaced by the patch
179173
extraMounts:
180174
- containerPath: "/var/run/docker.sock"
181175
hostPath: "/var/run/docker.sock"
182-
bootstrapTimeout: 10m
176+
bootstrapTimeout: 15m
183177
---
184-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
178+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
185179
kind: DockerMachineTemplate
186180
metadata:
187181
name: rke2-class-default-worker-machinetemplate
188182
spec:
189183
template:
190184
spec:
191-
customImage: kindest/node:v1.28.0 # will be replaced by the patch
185+
customImage: kindest/node:v1.34.0 # will be replaced by the patch
192186
extraMounts:
193187
- containerPath: "/var/run/docker.sock"
194188
hostPath: "/var/run/docker.sock"
195-
bootstrapTimeout: 10m
189+
bootstrapTimeout: 15m
196190
---
197-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
191+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
198192
kind: RKE2ConfigTemplate
199193
metadata:
200194
name: rke2-class-default-worker-bootstraptemplate

examples/templates/aws/cluster-template-ignition.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
apiVersion: cluster.x-k8s.io/v1beta1
2+
apiVersion: cluster.x-k8s.io/v1beta2
33
kind: Cluster
44
metadata:
55
name: ${CLUSTER_NAME}
@@ -13,11 +13,11 @@ spec:
1313
cidrBlocks:
1414
- 192.168.0.0/16
1515
controlPlaneRef:
16-
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
16+
apiGroup: controlplane.cluster.x-k8s.io
1717
kind: RKE2ControlPlane
1818
name: ${CLUSTER_NAME}-control-plane
1919
infrastructureRef:
20-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
20+
apiGroup: infrastructure.cluster.x-k8s.io
2121
kind: AWSCluster
2222
name: ${CLUSTER_NAME}
2323
---
@@ -74,13 +74,15 @@ spec:
7474
- sudo hostnamectl set-hostname $(curl -s http://169.254.169.254/1.0/meta-data/hostname)
7575
gzipUserData: false
7676
machineTemplate:
77-
infrastructureRef:
78-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
79-
kind: AWSMachineTemplate
80-
name: ${CLUSTER_NAME}-control-plane
81-
nodeDrainTimeout: 2m
82-
nodeDeletionTimeout: 30s
83-
nodeVolumeDetachTimeout: 5m
77+
spec:
78+
infrastructureRef:
79+
apiGroup: infrastructure.cluster.x-k8s.io
80+
kind: AWSMachineTemplate
81+
name: ${CLUSTER_NAME}-control-plane
82+
deletion:
83+
nodeDrainTimeoutSeconds: 120
84+
nodeVolumeDetachTimeoutSeconds: 300
85+
nodeDeletionTimeoutSeconds: 30
8486
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
8587
serverConfig:
8688
cloudProviderName: external
@@ -110,7 +112,7 @@ spec:
110112
size: 50
111113
sshKeyName: ${AWS_SSH_KEY_NAME}
112114
---
113-
apiVersion: cluster.x-k8s.io/v1beta1
115+
apiVersion: cluster.x-k8s.io/v1beta2
114116
kind: MachineDeployment
115117
metadata:
116118
name: ${CLUSTER_NAME}-md-0
@@ -130,12 +132,12 @@ spec:
130132
version: ${RKE2_VERSION}
131133
bootstrap:
132134
configRef:
133-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
135+
apiGroup: bootstrap.cluster.x-k8s.io
134136
kind: RKE2ConfigTemplate
135137
name: ${CLUSTER_NAME}-md-0
136138
infrastructureRef:
137139
name: ${CLUSTER_NAME}-md-0
138-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
140+
apiGroup: infrastructure.cluster.x-k8s.io
139141
kind: AWSMachineTemplate
140142
---
141143
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
@@ -153,13 +155,13 @@ spec:
153155
rootVolume:
154156
size: 50
155157
---
156-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
158+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
157159
kind: RKE2ConfigTemplate
158160
metadata:
159161
name: ${CLUSTER_NAME}-md-0
160162
namespace: ${NAMESPACE}
161163
---
162-
apiVersion: addons.cluster.x-k8s.io/v1beta1
164+
apiVersion: addons.cluster.x-k8s.io/v1beta2
163165
kind: ClusterResourceSet
164166
metadata:
165167
name: crs-ccm
@@ -173,7 +175,7 @@ spec:
173175
name: cloud-controller-manager-addon
174176
strategy: ApplyOnce
175177
---
176-
apiVersion: addons.cluster.x-k8s.io/v1beta1
178+
apiVersion: addons.cluster.x-k8s.io/v1beta2
177179
kind: ClusterResourceSet
178180
metadata:
179181
name: crs-csi

examples/templates/aws/cluster-template.yaml

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
apiVersion: cluster.x-k8s.io/v1beta1
2+
apiVersion: cluster.x-k8s.io/v1beta2
33
kind: Cluster
44
metadata:
55
labels:
@@ -13,11 +13,11 @@ spec:
1313
cidrBlocks:
1414
- 192.168.0.0/16
1515
controlPlaneRef:
16-
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
16+
apiGroup: controlplane.cluster.x-k8s.io
1717
kind: RKE2ControlPlane
1818
name: ${CLUSTER_NAME}-control-plane
1919
infrastructureRef:
20-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
20+
apiGroup: infrastructure.cluster.x-k8s.io
2121
kind: AWSCluster
2222
name: ${CLUSTER_NAME}
2323
---
@@ -127,13 +127,15 @@ spec:
127127
- --cloud-provider=external
128128
gzipUserData: false
129129
machineTemplate:
130-
infrastructureRef:
131-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
132-
kind: AWSMachineTemplate
133-
name: ${CLUSTER_NAME}-control-plane
134-
nodeDrainTimeout: 2m
135-
nodeDeletionTimeout: 30s
136-
nodeVolumeDetachTimeout: 5m
130+
spec:
131+
infrastructureRef:
132+
apiGroup: infrastructure.cluster.x-k8s.io
133+
kind: AWSMachineTemplate
134+
name: ${CLUSTER_NAME}-control-plane
135+
deletion:
136+
nodeDrainTimeoutSeconds: 120
137+
nodeVolumeDetachTimeoutSeconds: 300
138+
nodeDeletionTimeoutSeconds: 30
137139
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
138140
serverConfig:
139141
cloudProviderName: external
@@ -163,7 +165,7 @@ spec:
163165
size: 50
164166
sshKeyName: ${AWS_SSH_KEY_NAME}
165167
---
166-
apiVersion: cluster.x-k8s.io/v1beta1
168+
apiVersion: cluster.x-k8s.io/v1beta2
167169
kind: MachineDeployment
168170
metadata:
169171
name: ${CLUSTER_NAME}-md-0
@@ -183,12 +185,12 @@ spec:
183185
version: ${RKE2_VERSION}
184186
bootstrap:
185187
configRef:
186-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
188+
apiGroup: bootstrap.cluster.x-k8s.io/v1beta2
187189
kind: RKE2ConfigTemplate
188190
name: ${CLUSTER_NAME}-md-0
189191
infrastructureRef:
190192
name: ${CLUSTER_NAME}-md-0
191-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
193+
apiGroup: infrastructure.cluster.x-k8s.io/v1beta2
192194
kind: AWSMachineTemplate
193195
---
194196
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
@@ -207,7 +209,7 @@ spec:
207209
rootVolume:
208210
size: 50
209211
---
210-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
212+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
211213
kind: RKE2ConfigTemplate
212214
metadata:
213215
name: ${CLUSTER_NAME}-md-0
@@ -234,7 +236,7 @@ spec:
234236
list:
235237
- ${NAMESPACE}
236238
---
237-
apiVersion: addons.cluster.x-k8s.io/v1beta1
239+
apiVersion: addons.cluster.x-k8s.io/v1beta2
238240
kind: ClusterResourceSet
239241
metadata:
240242
name: crs-ccm
@@ -248,7 +250,7 @@ spec:
248250
name: cloud-controller-manager-addon
249251
strategy: ApplyOnce
250252
---
251-
apiVersion: addons.cluster.x-k8s.io/v1beta1
253+
apiVersion: addons.cluster.x-k8s.io/v1beta2
252254
kind: ClusterResourceSet
253255
metadata:
254256
name: crs-csi

0 commit comments

Comments
 (0)