-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Wait for CNI plugin become ready (#1178)
* Update Calico and Canal to v3.13.2 * Wait for CNI plugin become ready * Configure NetworkManager for Calico networking
- Loading branch information
Showing
11 changed files
with
231 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...i/data/common/ansible/playbooks/roles/kubernetes_master/files/calico-network-manager.conf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Ansible managed | ||
[keyfile] | ||
unmanaged-devices=interface-name:cali*;interface-name:tunl* |
22 changes: 22 additions & 0 deletions
22
.../data/common/ansible/playbooks/roles/kubernetes_master/tasks/apply-network-components.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,25 @@ | ||
--- | ||
- name: Apply network plugin configured by user | ||
include_tasks: "./cni-plugins/{{ network_plugin }}.yml" | ||
|
||
# Wait for CNI plugin become ready to prevent failure of 'Get token from master' task on node before joining master | ||
- name: Wait for CNI plugin become ready | ||
shell: >- | ||
kubectl wait --for=condition=Ready pods -l {{ selectors[network_plugin] }} | ||
--field-selector=spec.nodeName=$(hostname --long) -n kube-system --timeout=10s | ||
args: | ||
executable: /bin/bash | ||
environment: | ||
KUBECONFIG: /home/{{ admin_user.name }}/.kube/config | ||
register: wait_for_cni_plugin | ||
until: wait_for_cni_plugin is succeeded | ||
retries: 30 | ||
delay: 1 | ||
changed_when: false | ||
vars: | ||
selectors: | ||
calico: k8s-app=calico-node | ||
canal: k8s-app=canal | ||
flannel: app=flannel | ||
when: | ||
- network_plugin in selectors.keys() |
39 changes: 39 additions & 0 deletions
39
...epicli/data/common/ansible/playbooks/roles/kubernetes_master/tasks/cni-plugins/calico.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.