学习k8s
This commit is contained in:
3
k8s/xiongxiao.me/config/env.md
Normal file
3
k8s/xiongxiao.me/config/env.md
Normal file
@@ -0,0 +1,3 @@
|
||||
```sh
|
||||
cat /etc/systemd/system/k3s.service.env
|
||||
```
|
||||
@@ -24,4 +24,32 @@ kubectl label nodes vm-32-6-ubuntu machine- --overwrite
|
||||
kubectl label nodes on machine=on --overwrite
|
||||
### light
|
||||
|
||||
kubectl label nodes light machine=light --overwrite
|
||||
kubectl label nodes light machine=light --overwrite
|
||||
|
||||
|
||||
## 关于非内网需要设置实际ip地址
|
||||
|
||||
```sh
|
||||
# aliyun, ip: 121.199.37.154
|
||||
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_NODE_IP=121.199.37.154 K3S_NODE_EXTERNAL_IP=121.199.37.154 K3S_URL=https://light.xiongxiao.me:6443 K3S_TOKEN=K1035ea36d4925cfd0a7f7938fb3eff1225e458c1aee4fb99bda40bb95f529913bf::server:03e3ef7d17dadc2471b0f2369248250d sh -
|
||||
--pause-image=docker.m.daocloud.io/rancher/mirrored-pause:3.9
|
||||
|
||||
|
||||
kubectl label nodes aliyun machine=aliyun --overwrite
|
||||
|
||||
```
|
||||
|
||||
手动创建配置文件
|
||||
```sh
|
||||
# 停止 k3s-agent 服务
|
||||
sudo systemctl stop k3s-agent
|
||||
|
||||
# 编辑配置文件
|
||||
sudo vim /etc/systemd/system/k3s-agent.service.env
|
||||
|
||||
# 重新加载 systemd 配置
|
||||
sudo systemctl daemon-reload
|
||||
|
||||
# 启动服务
|
||||
sudo systemctl start k3s-agent
|
||||
```
|
||||
@@ -63,11 +63,11 @@ sudo systemctl restart containerd
|
||||
sudo ctr image pull docker.io/library/verdaccio:latest
|
||||
|
||||
# K3s 使用 k8s.io 命名空间
|
||||
sudo ctr -n k8s.io images pull docker.m.daocloud.io/rancher/mirrored-pause:3.6
|
||||
sudo ctr -n k8s.io images pull docker.m.daocloud.io/rancher/mirrored-pause:3.9
|
||||
|
||||
sudo ctr -n k8s.io images tag docker.m.daocloud.io/rancher/mirrored-pause:3.6 docker.io/rancher/mirrored-pause:3.6
|
||||
sudo ctr -n k8s.io images tag docker.m.daocloud.io/rancher/mirrored-pause:3.9 docker.io/rancher/mirrored-pause:3.9
|
||||
|
||||
sudo ctr -n k8s.io images delete docker.m.daocloud.io/rancher/mirrored-pause:3.6
|
||||
sudo ctr -n k8s.io images delete docker.m.daocloud.io/rancher/mirrored-pause:3.9
|
||||
|
||||
|
||||
# 查看镜像
|
||||
|
||||
Reference in New Issue
Block a user