kubekey/builtin/capkk/roles/install/cni/tasks/calico.yaml
liujian 86ff6371b6
Uninstall docker interface (#2478)
Signed-off-by: joyceliu <joyceliu@yunify.com>
Co-authored-by: joyceliu <joyceliu@yunify.com>
2025-03-05 18:55:12 +08:00

33 lines
1016 B
YAML

---
- name: Check if calicoctl is installed
ignore_errors: true
command: calicoctl version
register: calicoctl_install_version
- name: Install calicoctl
when: .calicoctl_install_version.stderr | ne ""
block:
- name: Sync calicoctl to remote
copy:
src: |
{{ .binary_dir }}/cni/calico/{{ .calico_version }}/{{ .binary_type.stdout }}/calicoctl
dest: /usr/local/bin/calicoctl
mode: 0755
- name: Sync calico package to remote
copy:
src: |
{{ .binary_dir }}/cni/calico/tigera-operator-{{ .calico_version }}.tgz
dest: |
/etc/kubernetes/cni/tigera-operator-{{ .calico_version }}.tgz
- name: Generate calico custom value file
copy:
content: |
{{ .cni.calico.values }}
dest: |
/etc/kubernetes/cni/calico-values.yaml
- name: Apply calico
command: |
helm install --create-namespace --namespace tigera-operator calico /etc/kubernetes/cni/tigera-operator-{{ .calico_version }}.tgz -f /etc/kubernetes/cni/calico-values.yaml