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

allow configurable name for cni pods so we're waiting for the right ones #104

Open
wants to merge 1 commit into
base: master
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
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 }}"
Copy link
Owner

@ReSearchITEng ReSearchITEng Apr 2, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is only used in your "grep" searches for pods. should i put it in another place in the variable stercture?

# 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
12 changes: 6 additions & 6 deletions roles/helm/tasks/charts_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down