From dd766600940dc5ed23454857785df94244fa83a4 Mon Sep 17 00:00:00 2001 From: alecsandru Date: Sat, 4 May 2024 16:35:50 +0000 Subject: [PATCH] Add 'k8s/setup_calico.yml' --- k8s/setup_calico.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 k8s/setup_calico.yml diff --git a/k8s/setup_calico.yml b/k8s/setup_calico.yml new file mode 100644 index 0000000..8ed1839 --- /dev/null +++ b/k8s/setup_calico.yml @@ -0,0 +1,18 @@ +- name: Setup Calico CNI Plugin + hosts: root_master +# become: yes +# become_method: sudo +# become_user: root + tasks: + - name: Install Calico Operator + shell: "kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.27.3/manifests/tigera-operator.yaml" + - name: Create Calico setup dir + file: + path: $HOME/calico + state: directory + - name: Setup Calico Instance + shell: "{{ item }} chdir=$HOME/calico" + with_items: + - "curl https://raw.githubusercontent.com/projectcalico/calico/v3.27.3/manifests/custom-resources.yaml -O" + - "sed -i 's:192.168.0.0/16:{{ POD_CIDR_NETWORK }}/g' custom-resources.yaml" + - "kubectl apply -f custom-resources.yaml" \ No newline at end of file