Skip to content

⚠️ Migrate E2E tests to v1beta2 #12451

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Jul 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
3e062b8
migrate from v1beta1 to v1beta2
sivchari Jul 6, 2025
d220b02
use v1beta2 in runtime extension
sivchari Jul 6, 2025
207f82d
migrate topology to v1beta2
sivchari Jul 7, 2025
3817bf2
fix apiGroup
sivchari Jul 7, 2025
560405a
fix failureDomains
sivchari Jul 7, 2025
716f0eb
migrate definition to v2 specification
sivchari Jul 7, 2025
11eec82
add version to topology
sivchari Jul 8, 2025
3a3a900
fix unknown fields
sivchari Jul 8, 2025
347af46
fix kubelet extra args and naming strategy
sivchari Jul 8, 2025
596f8b2
fix failuredomain on mp
sivchari Jul 8, 2025
2ef08f9
fix empty ns
sivchari Jul 8, 2025
0f4f62a
upgrade CAPD template to v1beta2
sivchari Jul 8, 2025
d508182
fix extraArgs format
sivchari Jul 8, 2025
a1db62f
fix indent
sivchari Jul 8, 2025
df98d18
handle v1beta1 and v1beta2 in runtime extension
sivchari Jul 8, 2025
d57afa5
fix failureDomains and empty metadata
sivchari Jul 9, 2025
f02ff50
fix extraArgs format
sivchari Jul 9, 2025
b8faa67
delete empty metadata
sivchari Jul 9, 2025
882d52a
delete namespace
sivchari Jul 9, 2025
6d8ee82
quote kubeletLogLevel
sivchari Jul 9, 2025
bcdaac7
fix parse error
sivchari Jul 9, 2025
ee28a54
use replace instead of add
sivchari Jul 9, 2025
9ffdbad
fix review findings
sivchari Jul 9, 2025
a45a07d
use add op and delete extraArgs from clusterConfiguration
sivchari Jul 9, 2025
34ed120
revert label and value
sivchari Jul 9, 2025
e67ba75
fix review findings
sivchari Jul 9, 2025
a56fe63
fix review findings
sivchari Jul 10, 2025
bd6079e
add json patches
sivchari Jul 10, 2025
c89d73b
convert to list from map
sivchari Jul 10, 2025
8fd8771
Final fixup
sbueringer Jul 10, 2025
7de3eb7
Fixup templates
sbueringer Jul 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
---
# DockerCluster object referenced by the Cluster object
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerCluster
metadata:
name: '${CLUSTER_NAME}'
spec:
failureDomains:
fd1:
- name: fd1
controlPlane: true
fd2:
- name: fd2
controlPlane: true
fd3:
- name: fd3
controlPlane: true
fd4:
- name: fd4
controlPlane: false
fd5:
- name: fd5
controlPlane: false
fd6:
- name: fd6
controlPlane: false
fd7:
- name: fd7
controlPlane: false
fd8:
- name: fd8
controlPlane: false
---
# Cluster object with
# - Reference to the KubeadmControlPlane object
# - the label cni=${CLUSTER_NAME}-crs-0, so the cluster can be selected by the ClusterResourceSet.
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: '${CLUSTER_NAME}'
Expand All @@ -40,16 +40,16 @@ spec:
cidrBlocks: ['${DOCKER_POD_CIDRS}']
serviceDomain: '${DOCKER_SERVICE_DOMAIN}'
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
kind: DockerCluster
name: '${CLUSTER_NAME}'
controlPlaneRef:
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiGroup: controlplane.cluster.x-k8s.io
name: "${CLUSTER_NAME}-control-plane"
---
# DockerMachineTemplate object referenced by the KubeadmControlPlane object
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
metadata:
name: "${CLUSTER_NAME}-control-plane"
Expand All @@ -65,7 +65,7 @@ spec:
# KubeadmControlPlane referenced by the Cluster object with
# - the label kcp-adoption.step2, because it should be created in the second step of the kcp-adoption test.
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
metadata:
name: "${CLUSTER_NAME}-control-plane"
labels:
Expand All @@ -75,15 +75,11 @@ spec:
machineTemplate:
infrastructureRef:
kind: DockerMachineTemplate
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
name: "${CLUSTER_NAME}-control-plane"
kubeadmConfigSpec:
clusterConfiguration:
apiServer:
# host.docker.internal is required by kubetest when running on MacOS because of the way ports are proxied.
certSANs: [localhost, 127.0.0.1, 0.0.0.0, host.docker.internal]
initConfiguration:
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
joinConfiguration:
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
version: "${KUBERNETES_VERSION}"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: '${CLUSTER_NAME}'
Expand All @@ -13,8 +13,9 @@ spec:
cidrBlocks: ['${DOCKER_POD_CIDRS}']
serviceDomain: '${DOCKER_SERVICE_DOMAIN}'
topology:
class: "quick-start"
classNamespace: '${CLUSTER_CLASS_NAMESPACE:-""}'
classRef:
name: "quick-start"
namespace: '${CLUSTER_CLASS_NAMESPACE:-${NAMESPACE}}'
version: "${KUBERNETES_VERSION}"
controlPlane:
metadata:
Expand All @@ -26,8 +27,8 @@ spec:
Cluster.topology.controlPlane.annotation: "Cluster.topology.controlPlane.annotationValue"
# Note: this annotation is propagated to Nodes.
Cluster.topology.controlPlane.annotation.node.cluster.x-k8s.io: "Cluster.topology.controlPlane.nodeAnnotationValue"
nodeDeletionTimeout: "30s"
nodeVolumeDetachTimeout: "5m"
nodeDeletionTimeoutSeconds: 30
nodeVolumeDetachTimeoutSeconds: 300
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
workers:
machineDeployments:
Expand All @@ -42,8 +43,8 @@ spec:
Cluster.topology.machineDeployment.annotation: "Cluster.topology.machineDeployment.annotationValue"
# Note: this annotation is propagated to Nodes. Shortened due to name length limitations
Cluster.topology.md.annotation.node.cluster.x-k8s.io: "Cluster.topology.machineDeployment.nodeAnnotationValue"
nodeDeletionTimeout: "30s"
nodeVolumeDetachTimeout: "5m"
nodeDeletionTimeoutSeconds: 30
nodeVolumeDetachTimeoutSeconds: 300
minReadySeconds: 5
replicas: ${WORKER_MACHINE_COUNT}
failureDomain: fd4
Expand All @@ -62,12 +63,12 @@ spec:
Cluster.topology.machinePool.label.node.cluster.x-k8s.io: "Cluster.topology.machinePool.nodeLabelValue"
annotations:
Cluster.topology.machinePool.annotation: "Cluster.topology.machinePool.annotationValue"
nodeDeletionTimeout: "30s"
nodeVolumeDetachTimeout: "5m"
nodeDeletionTimeoutSeconds: 30
nodeVolumeDetachTimeoutSeconds: 300
minReadySeconds: 5
replicas: ${WORKER_MACHINE_COUNT}
failureDomains:
- fd4
- fd4
variables:
# We set an empty value to use the default tag kubeadm init is using.
- name: etcdImageTag
Expand Down
2 changes: 1 addition & 1 deletion test/e2e/data/infrastructure-docker/main/bases/crs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ binaryData:
---
# ClusterResourceSet object with
# a selector that targets all the Cluster with label cni=${CLUSTER_NAME}-crs-0
apiVersion: addons.cluster.x-k8s.io/v1beta1
apiVersion: addons.cluster.x-k8s.io/v1beta2
kind: ClusterResourceSet
metadata:
name: "${CLUSTER_NAME}-crs-0"
Expand Down
11 changes: 5 additions & 6 deletions test/e2e/data/infrastructure-docker/main/bases/md.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
# DockerMachineTemplate referenced by the MachineDeployment and with
# - extraMounts for the docker sock, thus allowing self-hosting test
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachineTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
Expand All @@ -15,18 +15,17 @@ spec:
preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]}
---
# KubeadmConfigTemplate referenced by the MachineDeployment
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
spec:
template:
spec:
joinConfiguration:
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
---
# MachineDeployment object
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachineDeployment
metadata:
name: "${CLUSTER_NAME}-md-0"
Expand All @@ -42,10 +41,10 @@ spec:
bootstrap:
configRef:
name: "${CLUSTER_NAME}-md-0"
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiGroup: bootstrap.cluster.x-k8s.io
kind: KubeadmConfigTemplate
infrastructureRef:
name: "${CLUSTER_NAME}-md-0"
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
kind: DockerMachineTemplate
failureDomain: fd4
11 changes: 5 additions & 6 deletions test/e2e/data/infrastructure-docker/main/bases/mp.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
# MachinePool which references the DockerMachinePool and KubeadmConfigTemplate below
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: MachinePool
metadata:
name: "${CLUSTER_NAME}-mp-0"
Expand All @@ -11,12 +11,12 @@ spec:
spec:
bootstrap:
configRef:
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiGroup: bootstrap.cluster.x-k8s.io
kind: KubeadmConfig
name: "${CLUSTER_NAME}-mp-0-config"
clusterName: '${CLUSTER_NAME}'
infrastructureRef:
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiGroup: infrastructure.cluster.x-k8s.io
kind: DockerMachinePool
name: "${CLUSTER_NAME}-dmp-0"
version: "${KUBERNETES_VERSION}"
Expand All @@ -28,7 +28,7 @@ spec:
- fd8
---
# DockerMachinePool using default values referenced by the MachinePool
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerMachinePool
metadata:
name: "${CLUSTER_NAME}-dmp-0"
Expand All @@ -38,10 +38,9 @@ spec:
preLoadImages: ${DOCKER_PRELOAD_IMAGES:-[]}
---
# KubeadmConfigTemplate referenced by the MachinePool
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfig
metadata:
name: "${CLUSTER_NAME}-mp-0-config"
spec:
joinConfiguration:
nodeRegistration: {} # node registration parameters are automatically injected by CAPD according to the kindest/node image in use.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
Expand All @@ -10,21 +10,29 @@ spec:
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
criSocket: unix:///var/run/containerd/containerd.sock
kubeletExtraArgs:
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
fail-swap-on: "false"
cgroup-root: "/kubelet"
runtime-cgroups: "/system.slice/containerd.service"
- name: eviction-hard
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
- name: fail-swap-on
value: "false"
- name: cgroup-root
value: "/kubelet"
- name: runtime-cgroups
value: "/system.slice/containerd.service"
joinConfiguration:
nodeRegistration:
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
criSocket: unix:///var/run/containerd/containerd.sock
kubeletExtraArgs:
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
fail-swap-on: "false"
cgroup-root: "/kubelet"
runtime-cgroups: "/system.slice/containerd.service"
- name: eviction-hard
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
- name: fail-swap-on
value: "false"
- name: cgroup-root
value: "/kubelet"
- name: runtime-cgroups
value: "/system.slice/containerd.service"
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
Expand All @@ -47,7 +55,11 @@ spec:
# We have to set the criSocket to containerd as kubeadm defaults to docker runtime if both containerd and docker sockets are found
criSocket: unix:///var/run/containerd/containerd.sock
kubeletExtraArgs:
eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
fail-swap-on: "false"
cgroup-root: "/kubelet"
runtime-cgroups: "/system.slice/containerd.service"
- name: eviction-hard
value: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%'
- name: fail-swap-on
value: "false"
- name: cgroup-root
value: "/kubelet"
- name: runtime-cgroups
value: "/system.slice/containerd.service"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: "${CLUSTER_NAME}"
Expand All @@ -11,8 +11,9 @@ spec:
cidrBlocks: ${POD_CIDR:=["192.168.0.0/16"]}
serviceDomain: ${SERVICE_DOMAIN:="cluster.local"}
topology:
class: in-memory
classNamespace: ${NAMESPACE}
classRef:
name: in-memory
namespace: ${NAMESPACE}
version: ${KUBERNETES_VERSION}
controlPlane:
replicas: ${CONTROL_PLANE_MACHINE_COUNT}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: cluster.x-k8s.io/v1beta1
apiVersion: cluster.x-k8s.io/v1beta2
kind: Cluster
metadata:
name: '${CLUSTER_NAME}'
Expand All @@ -10,7 +10,7 @@ spec:
pods:
cidrBlocks: ['${DOCKER_POD_IPV6_CIDRS}']
---
apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
apiVersion: infrastructure.cluster.x-k8s.io/v1beta2
kind: DockerCluster
metadata:
name: '${CLUSTER_NAME}'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
kind: KubeadmControlPlane
apiVersion: controlplane.cluster.x-k8s.io/v1beta1
apiVersion: controlplane.cluster.x-k8s.io/v1beta2
metadata:
name: "${CLUSTER_NAME}-control-plane"
spec:
Expand All @@ -15,8 +15,10 @@ spec:
bindPort: 6443
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
- name: node-ip
value: "::"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
- name: node-ip
value: "::"
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
apiVersion: bootstrap.cluster.x-k8s.io/v1beta1
apiVersion: bootstrap.cluster.x-k8s.io/v1beta2
kind: KubeadmConfigTemplate
metadata:
name: "${CLUSTER_NAME}-md-0"
Expand All @@ -9,8 +9,10 @@ spec:
initConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
- name: node-ip
value: "::"
joinConfiguration:
nodeRegistration:
kubeletExtraArgs:
node-ip: "::"
- name: node-ip
value: "::"
Loading