K3s SQLite to etcd
nano /etc/systemd/system/k3s.service
ExecStart=/usr/local/bin/k3s server --cluster-init --etcd-expose-metrics
sudo systemctl daemon-reload
sudo systemctl restart k3s
etcdctl --endpoints=https://127.0.0.1:2379 endpoint status --write-out=table
如何安裝 etcdctl
curl -L https://github.com/etcd-io/etcd/releases/download/v3.5.7/etcd-v3.5.7-linux-amd64.tar.gz -o etcd.tar.gz
tar -xvzf etcd.tar.gz
sudo mv etcd-v3.5.7-linux-amd64/etcdctl /usr/local/bin/
tee -a ~/.bashrc <<EOF
export ETCDCTL_API=3
export ETCDCTL_CACERT="/var/lib/rancher/k3s/server/tls/etcd/server-ca.crt"
export ETCDCTL_CERT="/var/lib/rancher/k3s/server/tls/etcd/server-client.crt"
export ETCDCTL_KEY="/var/lib/rancher/k3s/server/tls/etcd/server-client.key"
EOF
source ~/.bashrc
增加多個 Node
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="server --server https://10.0.101.4:6443 --token <YOUR-TOKEN>" sh -
如果忘記 token
sudo cat /var/lib/rancher/k3s/server/node-token