mirror of
https://github.com/kubesphere/kubekey.git
synced 2025-12-25 17:12:50 +00:00
Signed-off-by: joyceliu <joyceliu@yunify.com> Co-authored-by: joyceliu <joyceliu@yunify.com>
33 lines
1016 B
YAML
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
|