Skip to content

Commit e19d61b

Browse files
authored
Merge pull request #3091 from CecileRobertMichon/presubmit-pending-pods
Fix custom builds kube pending pods
2 parents dc928b9 + 2426436 commit e19d61b

File tree

5 files changed

+12
-0
lines changed

5 files changed

+12
-0
lines changed

scripts/ci-entrypoint.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,10 @@ install_addons() {
139139
# export the target cluster KUBECONFIG if not already set
140140
export KUBECONFIG="${KUBECONFIG:-${PWD}/kubeconfig}"
141141

142+
# wait for the apiserver pod to be Ready.
143+
APISERVER_POD=$("${KUBECTL}" get pods -n kube-system -o name | grep apiserver)
144+
"${KUBECTL}" wait --for=condition=Ready -n kube-system "${APISERVER_POD}" --timeout=5m
145+
142146
# Copy the kubeadm configmap to the calico-system namespace. This is a workaround needed for the calico-node-windows daemonset to be able to run in the calico-system namespace.
143147
"${KUBECTL}" create ns calico-system
144148
until "${KUBECTL}" get configmap kubeadm-config --namespace=kube-system

templates/test/dev/cluster-template-custom-builds-machine-pool.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/test/dev/cluster-template-custom-builds.yaml

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/test/dev/custom-builds/patches/kubeadm-controlplane-bootstrap.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,11 @@
4848
4949
export KUBECONFIG=/etc/kubernetes/admin.conf
5050
kubectl -n kube-system set image daemonset/kube-proxy kube-proxy="${REGISTRY}/kube-proxy:${IMAGE_TAG}"
51+
systemctl stop kubelet
5152
yq e '.spec.containers[0].image = "${REGISTRY}/kube-apiserver:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-apiserver.yaml
5253
yq e '.spec.containers[0].image = "${REGISTRY}/kube-controller-manager:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-controller-manager.yaml
5354
yq e '.spec.containers[0].image = "${REGISTRY}/kube-scheduler:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-scheduler.yaml
55+
systemctl restart kubelet
5456
path: /tmp/replace-k8s-components.sh
5557
owner: "root:root"
5658
permissions: "0744"

templates/test/dev/patches/control-plane-custom-builds.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,11 @@ spec:
6161
6262
export KUBECONFIG=/etc/kubernetes/admin.conf
6363
kubectl -n kube-system set image daemonset/kube-proxy kube-proxy="${REGISTRY}/kube-proxy:${IMAGE_TAG}"
64+
systemctl stop kubelet
6465
yq e '.spec.containers[0].image = "${REGISTRY}/kube-apiserver:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-apiserver.yaml
6566
yq e '.spec.containers[0].image = "${REGISTRY}/kube-controller-manager:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-controller-manager.yaml
6667
yq e '.spec.containers[0].image = "${REGISTRY}/kube-scheduler:${IMAGE_TAG}"' -i /etc/kubernetes/manifests/kube-scheduler.yaml
68+
systemctl restart kubelet
6769
- path: /etc/kubernetes/azure.json
6870
owner: "root:root"
6971
permissions: "0644"

0 commit comments

Comments
 (0)