Files
k8s-docs/k8s/xiongxiao.me/docs/00-master.md
2025-12-25 00:05:18 +08:00

49 lines
835 B
Markdown

# 安装 master
```sh
## 1. 安装 k3s
curl -sfL https://get.k3s.io | sh -
sudo cat /var/lib/rancher/k3s/server/node-token
```
## 2. 安装 node
```sh
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh |
INSTALL_K3S_MIRROR=cn K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh - - \
--system-default-registry=registry.cn-hangzhou.aliyuncs.com
```
## 3. 删除
```sh
## master 节点上执行
sudo /usr/local/bin/k3s-uninstall.sh
## node 节点上执行
sudo /usr/local/bin/k3s-agent-uninstall.sh
```
## 4. 这是 role
```
kubectl label nodes <node-name> role=<value> --overwrite
```
## 部署
如何在某一个节点vm-32-6-ubuntu部署verdaccio
```sh
# services
kubectl apply -f verdaccio-deployment.yaml
# ip
kubectl apply -f verdaccio-services.yaml
# 查看pod
kubectl get pods -o wide
```