Skip to content

Commit

Permalink
allow configurable name for cni pods so we're waiting for the right ones
Browse files Browse the repository at this point in the history
  • Loading branch information
ghormoon committed Mar 30, 2024
1 parent 6147bef commit 4d7703d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions group_vars/all/ClusterConfiguration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: ""
Expand Down
3 changes: 3 additions & 0 deletions group_vars/all/network.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions roles/helm/tasks/charts_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
- name: Calico - wait for calico-node 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.network.cni_pod_name }} || true "
register: command_result
until: command_result.stdout != ""
retries: 30
Expand All @@ -76,7 +76,7 @@
- name: Calico - wait for calico-node 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.network.cni_pod_name }} | grep -v -w 'Running' || true "
register: command_result
until: command_result.stdout == ""
retries: 30
Expand Down

0 comments on commit 4d7703d

Please sign in to comment.