Skip to content

Commit

Permalink
test/e2e fix fail-swap-on=false flag not being part of kind images an…
Browse files Browse the repository at this point in the history
…ymore
  • Loading branch information
chrischdi committed May 31, 2023
1 parent ba50476 commit 639e201
Show file tree
Hide file tree
Showing 24 changed files with 213 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/main/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/main/bases/mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ spec:
nodeRegistration:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
fail-swap-on: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v0.3/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v0.4/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v0.4/bases/mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,4 @@ spec:
nodeRegistration:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
fail-swap-on: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v1.0/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v1.3/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v1.3/bases/mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ spec:
nodeRegistration:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
fail-swap-on: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v1.4/bases/md.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/e2e/data/infrastructure-docker/v1.4/bases/mp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,4 @@ spec:
nodeRegistration:
kubeletExtraArgs:
eviction-hard: nodefs.available<0%,nodefs.inodesFree<0%,imagefs.available<0%
fail-swap-on: "false"
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
38 changes: 38 additions & 0 deletions test/infrastructure/docker/templates/clusterclass-quick-start.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 639e201

Please sign in to comment.