modified: docs/k3s-cluster.md
This commit is contained in:
@@ -76,7 +76,40 @@ cat /var/lib/rancher/k3s/server/node-token
|
||||
|
||||
``` bash
|
||||
# install k3s as agent / worker node
|
||||
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --server https://casa.dev.lan:6443 --token <TOKEN>" sh -s -
|
||||
TOKEN="???"
|
||||
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --data-dir /dataDisk/k3s --server https://casa.dev.lan:6443 --token ${TOKEN}" sh -s -
|
||||
```
|
||||
|
||||
**Move default k3s folder:**
|
||||
|
||||
``` bash
|
||||
apt install rsync
|
||||
sudo systemctl stop k3s-agent
|
||||
sudo rsync -a /var/lib/rancher/k3s/ /dataDisk/k3s/
|
||||
```
|
||||
|
||||
Execute install k3s default update script with --data-dir /dataDisk/k3s argument.
|
||||
|
||||
Change kubectl -n kube-system edit configmap local-path-config on kube-system to set path to provisioner.
|
||||
|
||||
``` yaml
|
||||
config.json: |-
|
||||
{
|
||||
"nodePathMap":[
|
||||
{
|
||||
"node":"DEFAULT_PATH_FOR_NON_LISTED_NODES",
|
||||
"paths":["/var/lib/rancher/k3s/storage"]
|
||||
},
|
||||
{
|
||||
"node":"casa-minion-01",
|
||||
"paths":["/dataDisk/k3s/storage"]
|
||||
}
|
||||
]
|
||||
}
|
||||
```
|
||||
|
||||
``` bash
|
||||
rm -rf /var/lib/rancher/k3s
|
||||
```
|
||||
|
||||
**Set node labels:**
|
||||
|
||||
Reference in New Issue
Block a user