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 30, 2023
1 parent ba50476 commit faf1cb6
Show file tree
Hide file tree
Showing 9 changed files with 155 additions and 0 deletions.
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 @@ -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
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,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
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 faf1cb6

Please sign in to comment.