From 639e201d4049bb250a543679aebfbcbf9349fcea Mon Sep 17 00:00:00 2001 From: Christian Schlotter Date: Tue, 30 May 2023 20:06:11 +0200 Subject: [PATCH] test/e2e fix fail-swap-on=false flag not being part of kind images anymore --- .../main/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/main/bases/md.yaml | 1 + .../infrastructure-docker/main/bases/mp.yaml | 1 + .../step1/cluster-with-cp0.yaml | 2 + .../cluster-with-kcp.yaml | 2 + .../mp-cgroupfs.yaml | 1 + .../clusterclass-quick-start-runtimesdk.yaml | 37 ++++++++++++++++++ .../main/clusterclass-quick-start.yaml | 37 ++++++++++++++++++ .../v0.3/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/v0.3/bases/md.yaml | 1 + .../v0.4/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/v0.4/bases/md.yaml | 1 + .../infrastructure-docker/v0.4/bases/mp.yaml | 1 + .../v1.0/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/v1.0/bases/md.yaml | 1 + .../v1.3/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/v1.3/bases/md.yaml | 1 + .../infrastructure-docker/v1.3/bases/mp.yaml | 1 + .../v1.3/clusterclass-quick-start.yaml | 37 ++++++++++++++++++ .../v1.4/bases/cluster-with-kcp.yaml | 2 + .../infrastructure-docker/v1.4/bases/md.yaml | 1 + .../infrastructure-docker/v1.4/bases/mp.yaml | 1 + .../v1.4/clusterclass-quick-start.yaml | 37 ++++++++++++++++++ .../templates/clusterclass-quick-start.yaml | 38 +++++++++++++++++++ 24 files changed, 213 insertions(+) diff --git a/test/e2e/data/infrastructure-docker/main/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/main/bases/cluster-with-kcp.yaml index b266cddcd3b3..424fec415404 100644 --- a/test/e2e/data/infrastructure-docker/main/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/main/bases/cluster-with-kcp.yaml @@ -89,9 +89,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/main/bases/md.yaml b/test/e2e/data/infrastructure-docker/main/bases/md.yaml index eacb23f08c24..ec060fba7aa6 100644 --- a/test/e2e/data/infrastructure-docker/main/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/main/bases/md.yaml @@ -27,6 +27,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/main/bases/mp.yaml b/test/e2e/data/infrastructure-docker/main/bases/mp.yaml index 6dc8170edd28..823d829b3572 100644 --- a/test/e2e/data/infrastructure-docker/main/bases/mp.yaml +++ b/test/e2e/data/infrastructure-docker/main/bases/mp.yaml @@ -47,3 +47,4 @@ spec: nodeRegistration: kubeletExtraArgs: eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% + fail-swap-on: "false" diff --git a/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-adoption/step1/cluster-with-cp0.yaml b/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-adoption/step1/cluster-with-cp0.yaml index 0c18788e8363..b58b2100e2ed 100644 --- a/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-adoption/step1/cluster-with-cp0.yaml +++ b/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-adoption/step1/cluster-with-cp0.yaml @@ -49,11 +49,13 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # cp0 Machine apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-remediation/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-remediation/cluster-with-kcp.yaml index 12516bab5ccd..b0785358be2b 100644 --- a/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-remediation/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/main/cluster-template-kcp-remediation/cluster-with-kcp.yaml @@ -62,10 +62,12 @@ spec: nodeRegistration: kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" files: - path: /wait-signal.sh content: | diff --git a/test/e2e/data/infrastructure-docker/main/cluster-template-upgrades-cgroupfs/mp-cgroupfs.yaml b/test/e2e/data/infrastructure-docker/main/cluster-template-upgrades-cgroupfs/mp-cgroupfs.yaml index b9a5097f135d..26b5aed019d2 100644 --- a/test/e2e/data/infrastructure-docker/main/cluster-template-upgrades-cgroupfs/mp-cgroupfs.yaml +++ b/test/e2e/data/infrastructure-docker/main/cluster-template-upgrades-cgroupfs/mp-cgroupfs.yaml @@ -11,3 +11,4 @@ spec: # kind will implement systemd support in: https://github.com/kubernetes-sigs/kind/issues/1726 cgroup-driver: cgroupfs eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% + fail-swap-on: "false" diff --git a/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk.yaml b/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk.yaml index 7ac8be58e2e1..ae9a704ee2d3 100644 --- a/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk.yaml +++ b/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start-runtimesdk.yaml @@ -49,6 +49,43 @@ spec: generateExtension: generate-patches.k8s-upgrade-with-runtimesdk validateExtension: validate-topology.k8s-upgrade-with-runtimesdk discoverVariablesExtension: discover-variables.k8s-upgrade-with-runtimesdk + - name: failSwap-controlPlane + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.controlPlane.version }}' + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - name: failSwap-machineDeployment + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.machineDeployment.version }}' + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" --- apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: DockerClusterTemplate diff --git a/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml index d4504aab29ee..76f532a740e2 100644 --- a/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/main/clusterclass-quick-start.yaml @@ -164,6 +164,43 @@ spec: - op: add path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" value: cgroupfs + - name: failSwap-controlPlane + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.controlPlane.version }}' + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - name: failSwap-machineDeployment + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.machineDeployment.version }}' + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" - name: etcdImageTag description: "Sets tag to use for the etcd image in the KubeadmControlPlane." definitions: diff --git a/test/e2e/data/infrastructure-docker/v0.3/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v0.3/bases/cluster-with-kcp.yaml index 98cba3f868fe..022c599f9c86 100644 --- a/test/e2e/data/infrastructure-docker/v0.3/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v0.3/bases/cluster-with-kcp.yaml @@ -68,9 +68,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v0.3/bases/md.yaml b/test/e2e/data/infrastructure-docker/v0.3/bases/md.yaml index d73e3b14ee8d..bd76519d3437 100644 --- a/test/e2e/data/infrastructure-docker/v0.3/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v0.3/bases/md.yaml @@ -25,6 +25,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object with # - the label nodepool=pool1 that applies to all the machines, so those machine can be targeted by the MachineHealthCheck object diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml index 39aa64f9aaea..77cb3d1da264 100644 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v0.4/bases/cluster-with-kcp.yaml @@ -69,9 +69,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml index 6c76f6f653bb..153996b3d115 100644 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml @@ -25,6 +25,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1alpha4 diff --git a/test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml b/test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml index f8090a7a839c..fd481360d5ac 100644 --- a/test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml +++ b/test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml @@ -37,3 +37,4 @@ spec: nodeRegistration: kubeletExtraArgs: eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% + fail-swap-on: "false" diff --git a/test/e2e/data/infrastructure-docker/v1.0/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v1.0/bases/cluster-with-kcp.yaml index fa8720f9833f..c22aaba5a584 100644 --- a/test/e2e/data/infrastructure-docker/v1.0/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.0/bases/cluster-with-kcp.yaml @@ -87,9 +87,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml b/test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml index 11abbc29248a..858d83d01335 100644 --- a/test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml @@ -25,6 +25,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml index b266cddcd3b3..424fec415404 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.3/bases/cluster-with-kcp.yaml @@ -89,9 +89,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml b/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml index eacb23f08c24..ec060fba7aa6 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml @@ -27,6 +27,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml b/test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml index 6dc8170edd28..823d829b3572 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml @@ -47,3 +47,4 @@ spec: nodeRegistration: kubeletExtraArgs: eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% + fail-swap-on: "false" diff --git a/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml index 483a944ade01..e31da9ec3587 100644 --- a/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/v1.3/clusterclass-quick-start.yaml @@ -152,6 +152,43 @@ spec: - op: add path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" value: cgroupfs + - name: failSwap-controlPlane + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.controlPlane.version }}' + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - name: failSwap-machineDeployment + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.machineDeployment.version }}' + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" - name: etcdImageTag description: "Sets tag to use for the etcd image in the KubeadmControlPlane." definitions: diff --git a/test/e2e/data/infrastructure-docker/v1.4/bases/cluster-with-kcp.yaml b/test/e2e/data/infrastructure-docker/v1.4/bases/cluster-with-kcp.yaml index b266cddcd3b3..424fec415404 100644 --- a/test/e2e/data/infrastructure-docker/v1.4/bases/cluster-with-kcp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.4/bases/cluster-with-kcp.yaml @@ -89,9 +89,11 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" joinConfiguration: nodeRegistration: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" version: "${KUBERNETES_VERSION}" diff --git a/test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml b/test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml index eacb23f08c24..ec060fba7aa6 100644 --- a/test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml +++ b/test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml @@ -27,6 +27,7 @@ spec: criSocket: unix:///var/run/containerd/containerd.sock kubeletExtraArgs: eviction-hard: 'nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%' + fail-swap-on: "false" --- # MachineDeployment object apiVersion: cluster.x-k8s.io/v1beta1 diff --git a/test/e2e/data/infrastructure-docker/v1.4/bases/mp.yaml b/test/e2e/data/infrastructure-docker/v1.4/bases/mp.yaml index 6dc8170edd28..823d829b3572 100644 --- a/test/e2e/data/infrastructure-docker/v1.4/bases/mp.yaml +++ b/test/e2e/data/infrastructure-docker/v1.4/bases/mp.yaml @@ -47,3 +47,4 @@ spec: nodeRegistration: kubeletExtraArgs: eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0% + fail-swap-on: "false" diff --git a/test/e2e/data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml b/test/e2e/data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml index f3fb40a4417b..2c7bda3c3593 100644 --- a/test/e2e/data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml +++ b/test/e2e/data/infrastructure-docker/v1.4/clusterclass-quick-start.yaml @@ -152,6 +152,43 @@ spec: - op: add path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" value: cgroupfs + - name: failSwap-controlPlane + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.controlPlane.version }}' + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - name: failSwap-machineDeployment + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.machineDeployment.version }}' + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" - name: etcdImageTag description: "Sets tag to use for the etcd image in the KubeadmControlPlane." definitions: diff --git a/test/infrastructure/docker/templates/clusterclass-quick-start.yaml b/test/infrastructure/docker/templates/clusterclass-quick-start.yaml index ab54f7f737e4..b4d2d7c2997b 100644 --- a/test/infrastructure/docker/templates/clusterclass-quick-start.yaml +++ b/test/infrastructure/docker/templates/clusterclass-quick-start.yaml @@ -132,6 +132,44 @@ spec: - op: add path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/cgroup-driver" value: cgroupfs + + - name: failSwap-controlPlane + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.controlPlane.version }}' + definitions: + - selector: + apiVersion: controlplane.cluster.x-k8s.io/v1beta1 + kind: KubeadmControlPlaneTemplate + matchResources: + controlPlane: true + jsonPatches: + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/initConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - op: add + path: "/spec/template/spec/kubeadmConfigSpec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" + - name: failSwap-machineDeployment + description: | + Sets the fail-swap-on flag to false if a Kubernetes version >= v1.22 is referenced. + This is required to allow usage on swap-enabled clusters, because otherwise the + kubelet does not start. + enabledIf: '{{ semverCompare ">= v1.22" .builtin.machineDeployment.version }}' + definitions: + - selector: + apiVersion: bootstrap.cluster.x-k8s.io/v1beta1 + kind: KubeadmConfigTemplate + matchResources: + machineDeploymentClass: + names: + - '*-worker' + jsonPatches: + - op: add + path: "/spec/template/spec/joinConfiguration/nodeRegistration/kubeletExtraArgs/fail-swap-on" + value: "false" - name: etcdImageTag description: "Sets tag to use for the etcd image in the KubeadmControlPlane." definitions: