Skip to content

Commit b448560

Browse files
committed
allow configurable name for cni pods so we're waiting for the right ones
1 parent 6147bef commit b448560

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

group_vars/all/ClusterConfiguration.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ ClusterConfiguration:
2929
kubernetesVersion: "v{{ KUBERNETES_VERSION }}"
3030
# dns:
3131
networking:
32+
cni_pod_name: "{{ POD_CNI_NAME }}"
3233
# dnsDomain: cluster.local
3334
serviceSubnet: "{{ SERVICE_NETWORK_CIDR }}"
3435
# podSubnet: ""

group_vars/all/network.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ custom:
4242
master: true # when true, actions like wait/join will be done against dns name instead of IP
4343
node: false # when true, the join command will have --node-name set to fqdn. When false, k8s will set based on how node machine answers to the hostname command
4444

45+
# Name of CNI pods to wait for during deployment. defualt is calico-node, but might be eg antrea-agent or others if you replace your CNI
46+
POD_CNI_NAME: "calico-node"
47+
4548
############## THE BELOW SECTION IS NO LONGER RELEVANT, as NETWORK comes via HELM CHARTS (e.g. tigera-operator from calico)
4649
#Define network for K8S services
4750
SERVICE_NETWORK_CIDR: 10.96.0.0/12

roles/helm/tasks/charts_deploy.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,31 +59,31 @@
5959
- name: CALICO BLOCK
6060
block:
6161

62-
- name: Calico - Wait few seconds for deployments to start - wait to make sure calico-node is getting started - required for containerd...
62+
- name: Calico - Wait few seconds for deployments to start - wait to make sure {{ ClusterConfiguration.networking.cni_pod_name }} is getting started - required for containerd...
6363
pause: seconds=30
6464
changed_when: false
6565

66-
- name: Calico - wait for calico-node pod to appear - required for containerd cni bug...
66+
- name: Calico - wait for {{ ClusterConfiguration.networking.cni_pod_name }} pod to appear - required for containerd cni bug...
6767
environment:
6868
KUBECONFIG: /etc/kubernetes/admin.conf
69-
shell: "kubectl get --all-namespaces pods --no-headers | grep calico-node || true "
69+
shell: "kubectl get --all-namespaces pods --no-headers | grep {{ ClusterConfiguration.networking.cni_pod_name }} || true "
7070
register: command_result
7171
until: command_result.stdout != ""
7272
retries: 30
7373
delay: 7
7474
changed_when: false
7575

76-
- name: Calico - wait for calico-node pods to become Running - required for containerd cni bug...
76+
- name: Calico - wait for {{ ClusterConfiguration.networking.cni_pod_name }} pods to become Running - required for containerd cni bug...
7777
environment:
7878
KUBECONFIG: /etc/kubernetes/admin.conf
79-
shell: "kubectl get --all-namespaces pods --no-headers | grep calico-node | grep -v -w 'Running' || true "
79+
shell: "kubectl get --all-namespaces pods --no-headers | grep {{ ClusterConfiguration.networking.cni_pod_name }} | grep -v -w 'Running' || true "
8080
register: command_result
8181
until: command_result.stdout == ""
8282
retries: 30
8383
delay: 7
8484
changed_when: false
8585

86-
- name: Calico - Wait few seconds for calico-node is Running 1/1 - required for containerd...
86+
- name: Calico - Wait few seconds for {{ ClusterConfiguration.networking.cni_pod_name }} is Running 1/1 - required for containerd...
8787
pause: seconds=20
8888
changed_when: false
8989

0 commit comments

Comments
 (0)