Skip to content
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

Update ControlPlaneKubeletLocalMode test for the feature gate being disabled #3150

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
Expand Up @@ -9,7 +9,7 @@
testgrid-dashboards: sig-cluster-lifecycle-kubeadm
testgrid-tab-name: kubeadm-kinder-control-plane-kubelet-local-mode-{{ dashVer .KubernetesVersion }}
testgrid-alert-email: [email protected]
description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster using the ControlPlaneKubeletLocalMode feature gate and run the kubeadm-e2e and the conformance suites"
description: "OWNER: sig-cluster-lifecycle (kinder); Uses kubeadm/kinder to create a cluster using the ControlPlaneKubeletLocalMode feature gate disabled and run the kubeadm-e2e and the conformance suites"
testgrid-num-columns-recent: "20"
{{ .AlertAnnotations }}
decoration_config:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
version: 1
summary: |
This workflow implements a sequence of tasks used test the proper functioning
of the ControlPlaneKubeletLocalMode feature gate.
of having the ControlPlaneKubeletLocalMode feature gate set to false.
vars:
# vars defines default values for variable used by tasks in this workflow;
# those values might be overridden when importing this files.
Expand Down Expand Up @@ -59,19 +59,19 @@ tasks:
- --name={{ .vars.clusterName }}
- --loglevel=debug
- --kubeadm-verbosity={{ .vars.kubeadmVerbosity }}
- --kubeadm-feature-gate="ControlPlaneKubeletLocalMode=true"
- --kubeadm-feature-gate="ControlPlaneKubeletLocalMode=false"
- --copy-certs=auto
timeout: 5m
- name: post-init
description: |
Run commands after kubeadm init is called on a primary CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to load balanced apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-1"

# Ensure kubelet.conf points to the local IP.
Expand All @@ -95,22 +95,23 @@ tasks:
- name: post-join
description: |
Run commands after kubeadm join is called on all joined CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to the remote apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"

CMD="docker exec {{ .vars.clusterName }}-control-plane-2"

# Ensure kubelet.conf points to the local IP.
# Ensure kubelet.conf points to the remote IP.
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"

# Ensure kubelet.conf points to the local IP.
# Ensure kubelet.conf points to the remote IP.
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

# Ensure exit status of 0
Expand All @@ -119,23 +120,24 @@ tasks:
- name: pre-upgrade
description: |
Run commands before kubeadm upgrade is called on all joined CP node to replace
the server in the kubelet's kubeconfig to point to the load balancer.
the server in the kubelet's kubeconfig to point to the control-plane IP.
cmd: /bin/bash
args:
- -c
- |
set -x

LOAD_BALANCER_IP_ADDRESS=$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-1"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-2"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

# Ensure exit status of 0
exit 0
Expand All @@ -155,22 +157,21 @@ tasks:
- name: post-upgrade
description: |
Run commands after kubeadm upgrade is called on all joined CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to the remote apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"

CMD="docker exec {{ .vars.clusterName }}-control-plane-1"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-2"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 1
summary: |
This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes using
the ControlPlaneKubeletLocalMode feature gate.
This workflow tests the proper functioning of the {{ .KubernetesVersion }} version of both kubeadm and Kubernetes having
the ControlPlaneKubeletLocalMode feature gate set to false.
test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-control-plane-local-kubelet-mode{{ dashVer .KubernetesVersion }}
config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/{{ .TargetFile }}
vars:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# AUTOGENERATED by https://git.k8s.io/kubeadm/kinder/ci/tools/update-workflows
version: 1
summary: |
This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes using
the ControlPlaneKubeletLocalMode feature gate.
This workflow tests the proper functioning of the latest version of both kubeadm and Kubernetes having
the ControlPlaneKubeletLocalMode feature gate set to false.
test grid > https://testgrid.k8s.io/sig-cluster-lifecycle-kubeadm#kubeadm-kinder-control-plane-local-kubelet-modelatest
config > https://git.k8s.io/test-infra/config/jobs/kubernetes/sig-cluster-lifecycle/kubeadm-kinder-control-plane-local-kubelet-mode.yaml
vars:
Expand Down
39 changes: 20 additions & 19 deletions kinder/ci/workflows/control-plane-local-kubelet-mode-tasks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
version: 1
summary: |
This workflow implements a sequence of tasks used test the proper functioning
of the ControlPlaneKubeletLocalMode feature gate.
of having the ControlPlaneKubeletLocalMode feature gate set to false.
vars:
# vars defines default values for variable used by tasks in this workflow;
# those values might be overridden when importing this files.
Expand Down Expand Up @@ -60,19 +60,19 @@ tasks:
- --name={{ .vars.clusterName }}
- --loglevel=debug
- --kubeadm-verbosity={{ .vars.kubeadmVerbosity }}
- --kubeadm-feature-gate="ControlPlaneKubeletLocalMode=true"
- --kubeadm-feature-gate="ControlPlaneKubeletLocalMode=false"
- --copy-certs=auto
timeout: 5m
- name: post-init
description: |
Run commands after kubeadm init is called on a primary CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to load balanced apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-1"

# Ensure kubelet.conf points to the local IP.
Expand All @@ -96,22 +96,23 @@ tasks:
- name: post-join
description: |
Run commands after kubeadm join is called on all joined CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to the remote apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"

CMD="docker exec {{ .vars.clusterName }}-control-plane-2"

# Ensure kubelet.conf points to the local IP.
# Ensure kubelet.conf points to the remote IP.
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"

# Ensure kubelet.conf points to the local IP.
# Ensure kubelet.conf points to the remote IP.
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

# Ensure exit status of 0
Expand All @@ -120,23 +121,24 @@ tasks:
- name: pre-upgrade
description: |
Run commands before kubeadm upgrade is called on all joined CP node to replace
the server in the kubelet's kubeconfig to point to the load balancer.
the server in the kubelet's kubeconfig to point to the control-plane IP.
cmd: /bin/bash
args:
- -c
- |
set -x

LOAD_BALANCER_IP_ADDRESS=$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-1"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-2"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"
${CMD} sed -i 's@server: https://.*:6443@server: https://'${LOAD_BALANCER_IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1
${CMD} sed -i 's@server: https://.*:6443@server: https://'${IP_ADDRESS}':6443@g' /etc/kubernetes/kubelet.conf || exit 1

# Ensure exit status of 0
exit 0
Expand All @@ -156,22 +158,21 @@ tasks:
- name: post-upgrade
description: |
Run commands after kubeadm upgrade is called on all joined CP node to checks if
the kubelet's kubeconfig file points to the local apiserver.
the kubelet's kubeconfig file points to the remote apiserver.
cmd: /bin/bash
args:
- -c
- |
set -x

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-1)"
IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-lb)"

CMD="docker exec {{ .vars.clusterName }}-control-plane-1"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-2)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-2"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

IP_ADDRESS="$(docker inspect --format='{{ "{{" }} .NetworkSettings.IPAddress {{ "}}" }}' {{ .vars.clusterName }}-control-plane-3)"
CMD="docker exec {{ .vars.clusterName }}-control-plane-3"
${CMD} grep "server: https://${IP_ADDRESS}:6443" /etc/kubernetes/kubelet.conf || exit 1

Expand Down