ansible: add worker nodes k3s update playbook
This commit is contained in:
+5
-25
@@ -12,11 +12,11 @@
|
|||||||
- [casa - control Plane - k3s setup](#casa---control-plane---k3s-setup)
|
- [casa - control Plane - k3s setup](#casa---control-plane---k3s-setup)
|
||||||
- [minion01 - worker node](#minion01---worker-node)
|
- [minion01 - worker node](#minion01---worker-node)
|
||||||
- [Minion01 - proxmox vm](#minion01---proxmox-vm)
|
- [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)
|
- [fstab](#fstab)
|
||||||
- [casa-mini-minion-01 - worker node](#casa-mini-minion-01---worker-node)
|
- [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 - 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
|
## Common
|
||||||
|
|
||||||
@@ -186,7 +186,6 @@ EOF
|
|||||||
|
|
||||||
### casa - control Plane - k3s setup
|
### casa - control Plane - k3s setup
|
||||||
|
|
||||||
|
|
||||||
**Taint NoSchedule on master node:**
|
**Taint NoSchedule on master node:**
|
||||||
|
|
||||||
kubectl taint nodes <master-node-name> node-role.kubernetes.io/control-plane=:NoSchedule
|
kubectl taint nodes <master-node-name> node-role.kubernetes.io/control-plane=:NoSchedule
|
||||||
@@ -246,18 +245,9 @@ sockets: 1
|
|||||||
| **OS** | Debian GNU/Linux 12 (bookworm) |
|
| **OS** | Debian GNU/Linux 12 (bookworm) |
|
||||||
| **KERNEL** | 6.1.0-44-amd64 |
|
| **KERNEL** | 6.1.0-44-amd64 |
|
||||||
|
|
||||||
### casa-minion-01 - k3s - setup
|
### casa-minion-01 - local path config
|
||||||
|
|
||||||
``` bash
|
`kubectl -n kube-system edit configmap local-path-config on kube-system` to set path to provisioner.
|
||||||
# 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.
|
|
||||||
|
|
||||||
``` yaml
|
``` yaml
|
||||||
config.json: |-
|
config.json: |-
|
||||||
@@ -328,19 +318,9 @@ usb0: host=1-1.1
|
|||||||
| **OS** | Debian GNU/Linux 12 (bookworm) |
|
| **OS** | Debian GNU/Linux 12 (bookworm) |
|
||||||
| **KERNEL** | 6.1.0-44-amd64 |
|
| **KERNEL** | 6.1.0-44-amd64 |
|
||||||
|
|
||||||
### casa-mini-minion-01 - k3s - setup
|
### casa-mini-minion-01 taints
|
||||||
|
|
||||||
``` bash
|
``` 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
|
``` bash
|
||||||
kubectl taint nodes casa-mini-minion-01 infra.limbosolutions.com/dedicated=casa-mini-minion-01:NoSchedule
|
kubectl taint nodes casa-mini-minion-01 infra.limbosolutions.com/dedicated=casa-mini-minion-01:NoSchedule
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -1 +1,3 @@
|
|||||||
k3s_version: "v1.36.3+k3s1"
|
k3s_version: "v1.36.3+k3s1"
|
||||||
|
# execute on server to get token
|
||||||
|
# cat /var/lib/rancher/k3s/server/node-token
|
||||||
@@ -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
|
||||||
@@ -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
|
||||||
Reference in New Issue
Block a user