diff --git a/group_vars/all/ClusterConfiguration.yml b/group_vars/all/ClusterConfiguration.yml index 7418af1..920b9e0 100644 --- a/group_vars/all/ClusterConfiguration.yml +++ b/group_vars/all/ClusterConfiguration.yml @@ -29,6 +29,7 @@ ClusterConfiguration: kubernetesVersion: "v{{ KUBERNETES_VERSION }}" # dns: networking: + cni_pod_name: "{{ POD_CNI_NAME }}" # dnsDomain: cluster.local serviceSubnet: "{{ SERVICE_NETWORK_CIDR }}" # podSubnet: "" diff --git a/group_vars/all/network.yml b/group_vars/all/network.yml index c5643c6..96a4073 100644 --- a/group_vars/all/network.yml +++ b/group_vars/all/network.yml @@ -42,6 +42,9 @@ custom: master: true # when true, actions like wait/join will be done against dns name instead of IP 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 +# 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 +POD_CNI_NAME: "calico-node" + ############## THE BELOW SECTION IS NO LONGER RELEVANT, as NETWORK comes via HELM CHARTS (e.g. tigera-operator from calico) #Define network for K8S services SERVICE_NETWORK_CIDR: 10.96.0.0/12 diff --git a/roles/helm/tasks/charts_deploy.yml b/roles/helm/tasks/charts_deploy.yml index a1c4287..f2455ae 100644 --- a/roles/helm/tasks/charts_deploy.yml +++ b/roles/helm/tasks/charts_deploy.yml @@ -59,31 +59,31 @@ - name: CALICO BLOCK block: - - name: Calico - Wait few seconds for deployments to start - wait to make sure calico-node is getting started - required for containerd... + - name: Calico - Wait few seconds for deployments to start - wait to make sure {{ ClusterConfiguration.networking.cni_pod_name }} is getting started - required for containerd... pause: seconds=30 changed_when: false - - name: Calico - wait for calico-node pod to appear - required for containerd cni bug... + - name: Calico - wait for {{ ClusterConfiguration.networking.cni_pod_name }} pod to appear - required for containerd cni bug... environment: KUBECONFIG: /etc/kubernetes/admin.conf - shell: "kubectl get --all-namespaces pods --no-headers | grep calico-node || true " + shell: "kubectl get --all-namespaces pods --no-headers | grep {{ ClusterConfiguration.networking.cni_pod_name }} || true " register: command_result until: command_result.stdout != "" retries: 30 delay: 7 changed_when: false - - name: Calico - wait for calico-node pods to become Running - required for containerd cni bug... + - name: Calico - wait for {{ ClusterConfiguration.networking.cni_pod_name }} pods to become Running - required for containerd cni bug... environment: KUBECONFIG: /etc/kubernetes/admin.conf - shell: "kubectl get --all-namespaces pods --no-headers | grep calico-node | grep -v -w 'Running' || true " + shell: "kubectl get --all-namespaces pods --no-headers | grep {{ ClusterConfiguration.networking.cni_pod_name }} | grep -v -w 'Running' || true " register: command_result until: command_result.stdout == "" retries: 30 delay: 7 changed_when: false - - name: Calico - Wait few seconds for calico-node is Running 1/1 - required for containerd... + - name: Calico - Wait few seconds for {{ ClusterConfiguration.networking.cni_pod_name }} is Running 1/1 - required for containerd... pause: seconds=20 changed_when: false