diff --git a/roles/flannel/files/kube-flannel.yml b/roles/calico/files/kube-flannel.yml similarity index 99% rename from roles/flannel/files/kube-flannel.yml rename to roles/calico/files/kube-flannel.yml index 8857e2f..c5ea9e9 100644 --- a/roles/flannel/files/kube-flannel.yml +++ b/roles/calico/files/kube-flannel.yml @@ -90,7 +90,7 @@ data: } net-conf.json: | { - "Network": "10.244.0.0/16", + "Network": "10.0.0.0/8", "EnableNFTables": false, "Backend": { "Type": "vxlan" diff --git a/roles/flannel/index.md b/roles/calico/index.md similarity index 100% rename from roles/flannel/index.md rename to roles/calico/index.md diff --git a/roles/calico/tasks/main.yml b/roles/calico/tasks/main.yml new file mode 100644 index 0000000..9fefdc8 --- /dev/null +++ b/roles/calico/tasks/main.yml @@ -0,0 +1,5 @@ +--- +- name: Apply the flannel manifest + ansible.builtin.shell: + cmd: kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.28.0/manifests/tigera-operator.yaml + delegate_to: localhost diff --git a/roles/flannel/tasks/main.yml b/roles/flannel/tasks/main.yml deleted file mode 100644 index eddd851..0000000 --- a/roles/flannel/tasks/main.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- -- name: Copy the flannel manifest - ansible.builtin.copy: - src: kube-flannel.yaml - dest: /etc/kubernetes/manifests/kube-flannel.yaml - owner: kube - group: kube - mode: ug+rw,o+r diff --git a/roles/init/tasks/main.yml b/roles/init/tasks/main.yml index 9f4d15a..e4eb7b2 100644 --- a/roles/init/tasks/main.yml +++ b/roles/init/tasks/main.yml @@ -83,3 +83,10 @@ owner: root - path: "/home/{{ kcp_nonroot }}/.kube/config" owner: "{{ kcp_nonroot }}" +- name: Copy admin conf to local + ansible.builtin.shell: + cmd: "scp {{ kcp }}:.kube/config {{ item }}" + loop: + - "{{ cfg_dest }}" + - "{{ cfg_home }}" + delegate_to: localhost diff --git a/roles/reset/tasks/main.yml b/roles/reset/tasks/main.yml index 24794d9..b97e965 100644 --- a/roles/reset/tasks/main.yml +++ b/roles/reset/tasks/main.yml @@ -37,7 +37,15 @@ ansible.builtin.service: state: stopped name: containerd +- name: Stop kubelet + ansible.builtin.service: + state: stopped + name: kubelet - name: Start containerd ansible.builtin.service: state: started name: containerd +- name: Start kubelet + ansible.builtin.service: + state: started + name: kubelet diff --git a/site.yml b/site.yml index 53e6d29..af23e7e 100644 --- a/site.yml +++ b/site.yml @@ -36,6 +36,6 @@ - role: kv tags: - kv - - role: flannel + - role: calico tags: - - flannel + - calico