From 0d64b82f0964ac9c2e954c999dd9d7b6fb4d327f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rcio=20Fernandes?= Date: Wed, 19 Aug 2026 14:44:42 +0000 Subject: [PATCH] ansible: add worker nodes k3s update playbook --- nodes/README.md | 30 ++++--------------- nodes/ansible/group_vars/all/public.yaml | 4 ++- .../k3s-workers-mini-minion-01.playbook.yaml | 14 +++++++++ .../k3s-workers-minion-01.playbook.yaml | 14 +++++++++ 4 files changed, 36 insertions(+), 26 deletions(-) create mode 100644 nodes/ansible/k3s-workers-mini-minion-01.playbook.yaml create mode 100644 nodes/ansible/k3s-workers-minion-01.playbook.yaml diff --git a/nodes/README.md b/nodes/README.md index 6e16074..12bd6bd 100644 --- a/nodes/README.md +++ b/nodes/README.md @@ -12,11 +12,11 @@ - [casa - control Plane - k3s setup](#casa---control-plane---k3s-setup) - [minion01 - worker node](#minion01---worker-node) - [Minion01 - proxmox vm](#minion01---proxmox-vm) - - [casa-minion-01 - k3s - setup](#casa-minion-01---k3s---setup) + - [casa-minion-01 - local path config](#casa-minion-01---local-path-config) - [fstab](#fstab) - [casa-mini-minion-01 - worker node](#casa-mini-minion-01---worker-node) - [casa-mini-minion-01 - proxmox vm](#casa-mini-minion-01---proxmox-vm) - - [casa-mini-minion-01 - k3s - setup](#casa-mini-minion-01---k3s---setup) + - [casa-mini-minion-01 taints](#casa-mini-minion-01-taints) ## Common @@ -186,7 +186,6 @@ EOF ### casa - control Plane - k3s setup - **Taint NoSchedule on master node:** kubectl taint nodes node-role.kubernetes.io/control-plane=:NoSchedule @@ -246,18 +245,9 @@ sockets: 1 | **OS** | Debian GNU/Linux 12 (bookworm) | | **KERNEL** | 6.1.0-44-amd64 | -### casa-minion-01 - k3s - setup +### casa-minion-01 - local path config -``` bash -# install k3s as agent / worker node -# execute on server to get token -# cat /var/lib/rancher/k3s/server/node-token - -K3S_TOKEN="????" -curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.36.1+k3s1 INSTALL_K3S_EXEC="agent --data-dir /dataDisks/nvme00/k3s --server https://casa.dev.lan:6443 --token ${K3S_TOKEN}" sh -s - -``` - -Change kubectl -n kube-system edit configmap local-path-config on kube-system to set path to provisioner. +`kubectl -n kube-system edit configmap local-path-config on kube-system` to set path to provisioner. ``` yaml config.json: |- @@ -328,19 +318,9 @@ usb0: host=1-1.1 | **OS** | Debian GNU/Linux 12 (bookworm) | | **KERNEL** | 6.1.0-44-amd64 | -### casa-mini-minion-01 - k3s - setup +### casa-mini-minion-01 taints ``` bash -# install k3s as agent / worker node -# execute on server to get token -# cat /var/lib/rancher/k3s/server/node-token - -K3S_TOKEN="???" -curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION=v1.36.1+k3s1 INSTALL_K3S_EXEC="agent --server https://casa.dev.lan:6443 --token ${K3S_TOKEN}" sh -s - -``` - -Change kubectl -n kube-system edit configmap local-path-config on kube-system to set path to provisioner. - ``` bash kubectl taint nodes casa-mini-minion-01 infra.limbosolutions.com/dedicated=casa-mini-minion-01:NoSchedule ``` diff --git a/nodes/ansible/group_vars/all/public.yaml b/nodes/ansible/group_vars/all/public.yaml index 11d52c2..bc9abd1 100644 --- a/nodes/ansible/group_vars/all/public.yaml +++ b/nodes/ansible/group_vars/all/public.yaml @@ -1 +1,3 @@ -k3s_version: "v1.36.3+k3s1" \ No newline at end of file +k3s_version: "v1.36.3+k3s1" +# execute on server to get token +# cat /var/lib/rancher/k3s/server/node-token \ No newline at end of file diff --git a/nodes/ansible/k3s-workers-mini-minion-01.playbook.yaml b/nodes/ansible/k3s-workers-mini-minion-01.playbook.yaml new file mode 100644 index 0000000..c35fca3 --- /dev/null +++ b/nodes/ansible/k3s-workers-mini-minion-01.playbook.yaml @@ -0,0 +1,14 @@ +- name: K3s update instal k3s binaries on + hosts: + - casa-mini-minion-01 + become: true + tasks: + - name: setup k3s - casa-mini-minion-01 + ansible.builtin.shell: "curl -sfL https://get.k3s.io | sh -" + environment: + INSTALL_K3S_VERSION: "{{ k3s_version }}" + INSTALL_K3S_EXEC: "agent --server https://casa.dev.lan:6443 --token {{ k3s_node_token }}" + register: k3s_output + - name: Show output + ansible.builtin.debug: + var: k3s_output.stdout_lines diff --git a/nodes/ansible/k3s-workers-minion-01.playbook.yaml b/nodes/ansible/k3s-workers-minion-01.playbook.yaml new file mode 100644 index 0000000..9d4c36d --- /dev/null +++ b/nodes/ansible/k3s-workers-minion-01.playbook.yaml @@ -0,0 +1,14 @@ +- name: K3s update instal k3s binaries on + hosts: + - casa-minion-01 + become: true + tasks: + - name: setup k3s - casa-minion-01 + ansible.builtin.shell: "curl -sfL https://get.k3s.io | sh -" + environment: + INSTALL_K3S_VERSION: "{{ k3s_version }}" + INSTALL_K3S_EXEC: "agent --data-dir /dataDisks/nvme00/k3s --server https://casa.dev.lan:6443 --token {{ k3s_node_token }}" + register: k3s_output + - name: Show output + ansible.builtin.debug: + var: k3s_output.stdout_lines