Skip to content

Commit 4e7f5d2

Browse files
sivcharisbueringer
andauthored
⚠️ Migrate E2E tests to v1beta2 (#12451)
* migrate from v1beta1 to v1beta2 Signed-off-by: sivchari <shibuuuu5@gmail.com> * use v1beta2 in runtime extension Signed-off-by: sivchari <shibuuuu5@gmail.com> * migrate topology to v1beta2 Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix apiGroup Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix failureDomains Signed-off-by: sivchari <shibuuuu5@gmail.com> * migrate definition to v2 specification Signed-off-by: sivchari <shibuuuu5@gmail.com> * add version to topology Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix unknown fields Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix kubelet extra args and naming strategy Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix failuredomain on mp Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix empty ns Signed-off-by: sivchari <shibuuuu5@gmail.com> * upgrade CAPD template to v1beta2 Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix extraArgs format Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix indent Signed-off-by: sivchari <shibuuuu5@gmail.com> * handle v1beta1 and v1beta2 in runtime extension Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix failureDomains and empty metadata Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix extraArgs format Signed-off-by: sivchari <shibuuuu5@gmail.com> * delete empty metadata Signed-off-by: sivchari <shibuuuu5@gmail.com> * delete namespace Signed-off-by: sivchari <shibuuuu5@gmail.com> * quote kubeletLogLevel Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix parse error Signed-off-by: sivchari <shibuuuu5@gmail.com> * use replace instead of add Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix review findings Signed-off-by: sivchari <shibuuuu5@gmail.com> * use add op and delete extraArgs from clusterConfiguration Signed-off-by: sivchari <shibuuuu5@gmail.com> * revert label and value Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix review findings Signed-off-by: sivchari <shibuuuu5@gmail.com> * fix review findings Signed-off-by: sivchari <shibuuuu5@gmail.com> * add json patches Signed-off-by: sivchari <shibuuuu5@gmail.com> * convert to list from map Signed-off-by: sivchari <shibuuuu5@gmail.com> * Final fixup * Fixup templates --------- Signed-off-by: sivchari <shibuuuu5@gmail.com> Co-authored-by: Stefan Bueringer <buringerst@vmware.com>
1 parent abb893f commit 4e7f5d2

File tree

35 files changed

+570
-468
lines changed

35 files changed

+570
-468
lines changed
Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
---
22
# DockerCluster object referenced by the Cluster object
3-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
3+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
44
kind: DockerCluster
55
metadata:
66
name: '${CLUSTER_NAME}'
77
spec:
88
failureDomains:
9-
fd1:
9+
- name: fd1
1010
controlPlane: true
11-
fd2:
11+
- name: fd2
1212
controlPlane: true
13-
fd3:
13+
- name: fd3
1414
controlPlane: true
15-
fd4:
15+
- name: fd4
1616
controlPlane: false
17-
fd5:
17+
- name: fd5
1818
controlPlane: false
19-
fd6:
19+
- name: fd6
2020
controlPlane: false
21-
fd7:
21+
- name: fd7
2222
controlPlane: false
23-
fd8:
23+
- name: fd8
2424
controlPlane: false
2525
---
2626
# Cluster object with
2727
# - Reference to the KubeadmControlPlane object
2828
# - the label cni=${CLUSTER_NAME}-crs-0, so the cluster can be selected by the ClusterResourceSet.
29-
apiVersion: cluster.x-k8s.io/v1beta1
29+
apiVersion: cluster.x-k8s.io/v1beta2
3030
kind: Cluster
3131
metadata:
3232
name: '${CLUSTER_NAME}'
@@ -40,16 +40,16 @@ spec:
4040
cidrBlocks: ['${DOCKER_POD_CIDRS}']
4141
serviceDomain: '${DOCKER_SERVICE_DOMAIN}'
4242
infrastructureRef:
43-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
43+
apiGroup: infrastructure.cluster.x-k8s.io
4444
kind: DockerCluster
4545
name: '${CLUSTER_NAME}'
4646
controlPlaneRef:
4747
kind: KubeadmControlPlane
48-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
48+
apiGroup: controlplane.cluster.x-k8s.io
4949
name: "${CLUSTER_NAME}-control-plane"
5050
---
5151
# DockerMachineTemplate object referenced by the KubeadmControlPlane object
52-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
52+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
5353
kind: DockerMachineTemplate
5454
metadata:
5555
name: "${CLUSTER_NAME}-control-plane"
@@ -65,7 +65,7 @@ spec:
6565
# KubeadmControlPlane referenced by the Cluster object with
6666
# - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test.
6767
kind: KubeadmControlPlane
68-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
68+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
6969
metadata:
7070
name: "${CLUSTER_NAME}-control-plane"
7171
labels:
@@ -75,15 +75,11 @@ spec:
7575
machineTemplate:
7676
infrastructureRef:
7777
kind: DockerMachineTemplate
78-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
78+
apiGroup: infrastructure.cluster.x-k8s.io
7979
name: "${CLUSTER_NAME}-control-plane"
8080
kubeadmConfigSpec:
8181
clusterConfiguration:
8282
apiServer:
8383
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
8484
certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal]
85-
initConfiguration:
86-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
87-
joinConfiguration:
88-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
8985
version: "${KUBERNETES_VERSION}"

test/e2e/data/infrastructure-docker/main/bases/cluster-with-topology.yaml

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: '${CLUSTER_NAME}'
@@ -13,8 +13,9 @@ spec:
1313
cidrBlocks: ['${DOCKER_POD_CIDRS}']
1414
serviceDomain: '${DOCKER_SERVICE_DOMAIN}'
1515
topology:
16-
class: "quick-start"
17-
classNamespace: '${CLUSTER_CLASS_NAMESPACE:-""}'
16+
classRef:
17+
name: "quick-start"
18+
namespace: '${CLUSTER_CLASS_NAMESPACE:-${NAMESPACE}}'
1819
version: "${KUBERNETES_VERSION}"
1920
controlPlane:
2021
metadata:
@@ -26,8 +27,8 @@ spec:
2627
Cluster.topology.controlPlane.annotation: "Cluster.topology.controlPlane.annotationValue"
2728
# Note: this annotation is propagated to Nodes.
2829
Cluster.topology.controlPlane.annotation.node.cluster.x-k8s.io: "Cluster.topology.controlPlane.nodeAnnotationValue"
29-
nodeDeletionTimeout: "30s"
30-
nodeVolumeDetachTimeout: "5m"
30+
nodeDeletionTimeoutSeconds: 30
31+
nodeVolumeDetachTimeoutSeconds: 300
3132
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
3233
workers:
3334
machineDeployments:
@@ -42,8 +43,8 @@ spec:
4243
Cluster.topology.machineDeployment.annotation: "Cluster.topology.machineDeployment.annotationValue"
4344
# Note: this annotation is propagated to Nodes. Shortened due to name length limitations
4445
Cluster.topology.md.annotation.node.cluster.x-k8s.io: "Cluster.topology.machineDeployment.nodeAnnotationValue"
45-
nodeDeletionTimeout: "30s"
46-
nodeVolumeDetachTimeout: "5m"
46+
nodeDeletionTimeoutSeconds: 30
47+
nodeVolumeDetachTimeoutSeconds: 300
4748
minReadySeconds: 5
4849
replicas: ${WORKER_MACHINE_COUNT}
4950
failureDomain: fd4
@@ -62,12 +63,12 @@ spec:
6263
Cluster.topology.machinePool.label.node.cluster.x-k8s.io: "Cluster.topology.machinePool.nodeLabelValue"
6364
annotations:
6465
Cluster.topology.machinePool.annotation: "Cluster.topology.machinePool.annotationValue"
65-
nodeDeletionTimeout: "30s"
66-
nodeVolumeDetachTimeout: "5m"
66+
nodeDeletionTimeoutSeconds: 30
67+
nodeVolumeDetachTimeoutSeconds: 300
6768
minReadySeconds: 5
6869
replicas: ${WORKER_MACHINE_COUNT}
6970
failureDomains:
70-
- fd4
71+
- fd4
7172
variables:
7273
# We set an empty value to use the default tag kubeadm init is using.
7374
- name: etcdImageTag

test/e2e/data/infrastructure-docker/main/bases/crs.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ binaryData:
1010
---
1111
# ClusterResourceSet object with
1212
# a selector that targets all the Cluster with label cni=${CLUSTER_NAME}-crs-0
13-
apiVersion: addons.cluster.x-k8s.io/v1beta1
13+
apiVersion: addons.cluster.x-k8s.io/v1beta2
1414
kind: ClusterResourceSet
1515
metadata:
1616
name: "${CLUSTER_NAME}-crs-0"

test/e2e/data/infrastructure-docker/main/bases/md.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# DockerMachineTemplate referenced by the MachineDeployment and with
33
# - extraMounts for the docker sock, thus allowing self-hosting test
4-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
4+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
55
kind: DockerMachineTemplate
66
metadata:
77
name: "${CLUSTER_NAME}-md-0"
@@ -15,18 +15,17 @@ spec:
1515
preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]}
1616
---
1717
# KubeadmConfigTemplate referenced by the MachineDeployment
18-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
18+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
1919
kind: KubeadmConfigTemplate
2020
metadata:
2121
name: "${CLUSTER_NAME}-md-0"
2222
spec:
2323
template:
2424
spec:
2525
joinConfiguration:
26-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
2726
---
2827
# MachineDeployment object
29-
apiVersion: cluster.x-k8s.io/v1beta1
28+
apiVersion: cluster.x-k8s.io/v1beta2
3029
kind: MachineDeployment
3130
metadata:
3231
name: "${CLUSTER_NAME}-md-0"
@@ -42,10 +41,10 @@ spec:
4241
bootstrap:
4342
configRef:
4443
name: "${CLUSTER_NAME}-md-0"
45-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
44+
apiGroup: bootstrap.cluster.x-k8s.io
4645
kind: KubeadmConfigTemplate
4746
infrastructureRef:
4847
name: "${CLUSTER_NAME}-md-0"
49-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
48+
apiGroup: infrastructure.cluster.x-k8s.io
5049
kind: DockerMachineTemplate
5150
failureDomain: fd4

test/e2e/data/infrastructure-docker/main/bases/mp.yaml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
# MachinePool which references the DockerMachinePool and KubeadmConfigTemplate below
3-
apiVersion: cluster.x-k8s.io/v1beta1
3+
apiVersion: cluster.x-k8s.io/v1beta2
44
kind: MachinePool
55
metadata:
66
name: "${CLUSTER_NAME}-mp-0"
@@ -11,12 +11,12 @@ spec:
1111
spec:
1212
bootstrap:
1313
configRef:
14-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
14+
apiGroup: bootstrap.cluster.x-k8s.io
1515
kind: KubeadmConfig
1616
name: "${CLUSTER_NAME}-mp-0-config"
1717
clusterName: '${CLUSTER_NAME}'
1818
infrastructureRef:
19-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
19+
apiGroup: infrastructure.cluster.x-k8s.io
2020
kind: DockerMachinePool
2121
name: "${CLUSTER_NAME}-dmp-0"
2222
version: "${KUBERNETES_VERSION}"
@@ -28,7 +28,7 @@ spec:
2828
- fd8
2929
---
3030
# DockerMachinePool using default values referenced by the MachinePool
31-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
31+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
3232
kind: DockerMachinePool
3333
metadata:
3434
name: "${CLUSTER_NAME}-dmp-0"
@@ -38,10 +38,9 @@ spec:
3838
preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]}
3939
---
4040
# KubeadmConfigTemplate referenced by the MachinePool
41-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
41+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
4242
kind: KubeadmConfig
4343
metadata:
4444
name: "${CLUSTER_NAME}-mp-0-config"
4545
spec:
4646
joinConfiguration:
47-
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.

test/e2e/data/infrastructure-docker/main/cluster-template-ignition/ignition.yaml

Lines changed: 26 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
kind: KubeadmControlPlane
2-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
2+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
33
metadata:
44
name: "${CLUSTER_NAME}-control-plane"
55
spec:
@@ -10,21 +10,29 @@ spec:
1010
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
1111
criSocket: unix:///var/run/containerd/containerd.sock
1212
kubeletExtraArgs:
13-
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
14-
fail-swap-on: "false"
15-
cgroup-root: "/kubelet"
16-
runtime-cgroups: "/system.slice/containerd.service"
13+
- name: eviction-hard
14+
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
15+
- name: fail-swap-on
16+
value: "false"
17+
- name: cgroup-root
18+
value: "/kubelet"
19+
- name: runtime-cgroups
20+
value: "/system.slice/containerd.service"
1721
joinConfiguration:
1822
nodeRegistration:
1923
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
2024
criSocket: unix:///var/run/containerd/containerd.sock
2125
kubeletExtraArgs:
22-
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
23-
fail-swap-on: "false"
24-
cgroup-root: "/kubelet"
25-
runtime-cgroups: "/system.slice/containerd.service"
26+
- name: eviction-hard
27+
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
28+
- name: fail-swap-on
29+
value: "false"
30+
- name: cgroup-root
31+
value: "/kubelet"
32+
- name: runtime-cgroups
33+
value: "/system.slice/containerd.service"
2634
---
27-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
35+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
2836
kind: KubeadmConfigTemplate
2937
metadata:
3038
name: "${CLUSTER_NAME}-md-0"
@@ -47,7 +55,11 @@ spec:
4755
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
4856
criSocket: unix:///var/run/containerd/containerd.sock
4957
kubeletExtraArgs:
50-
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
51-
fail-swap-on: "false"
52-
cgroup-root: "/kubelet"
53-
runtime-cgroups: "/system.slice/containerd.service"
58+
- name: eviction-hard
59+
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
60+
- name: fail-swap-on
61+
value: "false"
62+
- name: cgroup-root
63+
value: "/kubelet"
64+
- name: runtime-cgroups
65+
value: "/system.slice/containerd.service"

test/e2e/data/infrastructure-docker/main/cluster-template-in-memory.yaml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
apiVersion: cluster.x-k8s.io/v1beta1
1+
apiVersion: cluster.x-k8s.io/v1beta2
22
kind: Cluster
33
metadata:
44
name: "${CLUSTER_NAME}"
@@ -11,8 +11,9 @@ spec:
1111
cidrBlocks: ${POD_CIDR:=["192.168.0.0/16"]}
1212
serviceDomain: ${SERVICE_DOMAIN:="cluster.local"}
1313
topology:
14-
class: in-memory
15-
classNamespace: ${NAMESPACE}
14+
classRef:
15+
name: in-memory
16+
namespace: ${NAMESPACE}
1617
version: ${KUBERNETES_VERSION}
1718
controlPlane:
1819
replicas: ${CONTROL_PLANE_MACHINE_COUNT}

test/e2e/data/infrastructure-docker/main/cluster-template-ipv6/cluster-ipv6.yaml

Lines changed: 2 additions & 2 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}'
@@ -10,7 +10,7 @@ spec:
1010
pods:
1111
cidrBlocks: ['${DOCKER_POD_IPV6_CIDRS}']
1212
---
13-
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
13+
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
1414
kind: DockerCluster
1515
metadata:
1616
name: '${CLUSTER_NAME}'

test/e2e/data/infrastructure-docker/main/cluster-template-ipv6/kcp-ipv6.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
kind: KubeadmControlPlane
3-
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
3+
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
44
metadata:
55
name: "${CLUSTER_NAME}-control-plane"
66
spec:
@@ -15,8 +15,10 @@ spec:
1515
bindPort: 6443
1616
nodeRegistration:
1717
kubeletExtraArgs:
18-
node-ip: "::"
18+
- name: node-ip
19+
value: "::"
1920
joinConfiguration:
2021
nodeRegistration:
2122
kubeletExtraArgs:
22-
node-ip: "::"
23+
- name: node-ip
24+
value: "::"
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
2+
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
33
kind: KubeadmConfigTemplate
44
metadata:
55
name: "${CLUSTER_NAME}-md-0"
@@ -9,8 +9,10 @@ spec:
99
initConfiguration:
1010
nodeRegistration:
1111
kubeletExtraArgs:
12-
node-ip: "::"
12+
- name: node-ip
13+
value: "::"
1314
joinConfiguration:
1415
nodeRegistration:
1516
kubeletExtraArgs:
16-
node-ip: "::"
17+
- name: node-ip
18+
value: "::"

0 commit comments

Comments
 (0)