mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-17 18:24:14 +02:00
feat: labels & taints in ansible playbooks
This commit is contained in:
29
README.md
29
README.md
@@ -36,32 +36,3 @@ gpg --export-secret-keys --armor <GPG_KEY_ID> | kubectl create secret generic so
|
|||||||
```bash
|
```bash
|
||||||
sops --encrypt --pgp=<GPG_KEY_ID> --encrypted-regex '^(data|stringData)$' --in-place <FILE_PATH>
|
sops --encrypt --pgp=<GPG_KEY_ID> --encrypted-regex '^(data|stringData)$' --in-place <FILE_PATH>
|
||||||
```
|
```
|
||||||
|
|
||||||
## Labels nodes
|
|
||||||
|
|
||||||
```bash
|
|
||||||
|
|
||||||
kubectl taint node k3s-server k3s-controlplane=true:NoSchedule
|
|
||||||
|
|
||||||
kubectl label node k3s-worker1 node-role.kubernetes.io/worker=true
|
|
||||||
kubectl label node k3s-worker2 node-role.kubernetes.io/worker=true
|
|
||||||
kubectl label node k3s-worker3 node-role.kubernetes.io/worker=true
|
|
||||||
|
|
||||||
kubectl annotate node k3s-worker1 node.longhorn.io/default-node-tags='["storage","fast"]'
|
|
||||||
kubectl annotate node k3s-worker2 node.longhorn.io/default-node-tags='["storage","fast"]'
|
|
||||||
kubectl annotate node k3s-worker3 node.longhorn.io/default-node-tags='["storage","fast"]'
|
|
||||||
|
|
||||||
kubectl annotate node k3s-worker1 node.longhorn.io/create-default-disk='config'
|
|
||||||
kubectl annotate node k3s-worker2 node.longhorn.io/create-default-disk='config'
|
|
||||||
kubectl annotate node k3s-worker3 node.longhorn.io/create-default-disk='config'
|
|
||||||
|
|
||||||
kubectl annotate node k3s-worker1 node.longhorn.io/default-disks-config=[ { "name":"fast-ssd-disk", "path":"/var/lib/longhorn", "allowScheduling":true, "storageReserved":304857600, "tags":[ "ssd", "fast" ] }]
|
|
||||||
kubectl annotate node k3s-worker2 node.longhorn.io/default-disks-config=[ { "name":"fast-ssd-disk", "path":"/var/lib/longhorn", "allowScheduling":true, "storageReserved":304857600, "tags":[ "ssd", "fast" ] }]
|
|
||||||
kubectl annotate node k3s-worker3 node.longhorn.io/default-disks-config=[ { "name":"fast-ssd-disk", "path":"/var/lib/longhorn", "allowScheduling":true, "storageReserved":304857600, "tags":[ "ssd", "fast" ] }]
|
|
||||||
|
|
||||||
kubectl annotate node k3s-worker1 k3s-upgrade='true'
|
|
||||||
kubectl annotate node k3s-worker2 k3s-upgrade='true'
|
|
||||||
kubectl annotate node k3s-worker3 k3s-upgrade='true'
|
|
||||||
```
|
|
||||||
|
|
||||||
https://github.com/rancher/k3s/issues/1401 for k3s-system deployment
|
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
---
|
---
|
||||||
|
|
||||||
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
# https://rancher.com/docs/k3s/latest/en/installation/install-options/server-config/
|
||||||
# https://github.com/PyratLabs/ansible-role-k3s#server-control-plane-configuration
|
# https://github.com/PyratLabs/ansible-role-k3s#server-control-plane-configuration
|
||||||
|
|
||||||
@@ -10,13 +9,15 @@ k3s_control_node: true
|
|||||||
k3s_server:
|
k3s_server:
|
||||||
node-ip: "{{ ansible_host }}"
|
node-ip: "{{ ansible_host }}"
|
||||||
docker: false
|
docker: false
|
||||||
flannel-backend: 'none' # This needs to be in quotes
|
flannel-backend: "none" # This needs to be in quotes
|
||||||
disable:
|
disable:
|
||||||
- flannel
|
- flannel
|
||||||
- traefik
|
- traefik
|
||||||
- servicelb
|
- servicelb
|
||||||
- metrics-server
|
- metrics-server
|
||||||
- local-storage
|
- local-storage
|
||||||
|
node-taint:
|
||||||
|
- "k3s-controlplane=true:NoSchedule"
|
||||||
disable-network-policy: true
|
disable-network-policy: true
|
||||||
disable-cloud-controller: true
|
disable-cloud-controller: true
|
||||||
write-kubeconfig-mode: "644"
|
write-kubeconfig-mode: "644"
|
||||||
|
@@ -8,3 +8,6 @@ k3s_control_node: false
|
|||||||
# k3s settings for all worker nodes
|
# k3s settings for all worker nodes
|
||||||
k3s_agent:
|
k3s_agent:
|
||||||
node-ip: "{{ ansible_host }}"
|
node-ip: "{{ ansible_host }}"
|
||||||
|
node-label:
|
||||||
|
- "node-role.kubernetes.io/worker=true"
|
||||||
|
- "k3s-upgrade=true"
|
||||||
|
Reference in New Issue
Block a user