update
This commit is contained in:
37
k8s/kevisual.cn/README.md
Normal file
37
k8s/kevisual.cn/README.md
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
## 安装k3s + calico 网络插件
|
||||||
|
### 安装k3s 同时禁用默认的traefik和flannel
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | \
|
||||||
|
INSTALL_K3S_MIRROR=cn \
|
||||||
|
K3S_KUBECONFIG_MODE="644" \
|
||||||
|
INSTALL_K3S_EXEC="server --disable=traefik --flannel-backend=none" \
|
||||||
|
sh -
|
||||||
|
```
|
||||||
|
# 编辑服务文件
|
||||||
|
vim /etc/systemd/system/k3s.service
|
||||||
|
|
||||||
|
## 查看
|
||||||
|
journalctl -u k3s.service -f
|
||||||
|
|
||||||
|
### 安装有问题
|
||||||
|
https://chat.xiongxiao.me/s/10b9aefa-5ba5-45d6-ba2c-b80c638468f3
|
||||||
|
|
||||||
|
### 安装Calico
|
||||||
|
|
||||||
|
```sh
|
||||||
|
curl -sfL https://docs.projectcalico.org/manifests/calico.yaml | kubectl apply -f -
|
||||||
|
```
|
||||||
|
|
||||||
|
### 获取token
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo cat /var/lib/rancher/k3s/server/node-token
|
||||||
|
```
|
||||||
|
|
||||||
|
## 换源
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo vim /etc/rancher/k3s/registries.yaml
|
||||||
|
```
|
||||||
26
k8s/kevisual.cn/config/master-token.md
Normal file
26
k8s/kevisual.cn/config/master-token.md
Normal file
@@ -0,0 +1,26 @@
|
|||||||
|
K106e5eb70f699db4a043873e452b636cd50be9a5794ff1a912a7b96f22268eb204::server:afa9aade36b27a6eec44d47983441d59
|
||||||
|
|
||||||
|
# Agent 节点安装命令
|
||||||
|
|
||||||
|
```sh
|
||||||
|
|
||||||
|
curl -sfL https://rancher-mirror.rancher.cn/k3s/k3s-install.sh | INSTALL_K3S_MIRROR=cn K3S_URL=https://kevisual.cn:6443 K3S_TOKEN=K106e5eb70f699db4a043873e452b636cd50be9a5794ff1a912a7b96f22268eb204::server:afa9aade36b27a6eec44d47983441d59 sh -
|
||||||
|
|
||||||
|
```
|
||||||
|
会输出类似
|
||||||
|
```
|
||||||
|
[INFO] systemd: Enabling k3s-agent unit
|
||||||
|
Created symlink /etc/systemd/system/multi-user.target.wants/k3s-agent.service → /etc/systemd/system/k3s-agent.service.
|
||||||
|
[INFO] systemd: Starting k3s-agent
|
||||||
|
|
||||||
|
## 设置label
|
||||||
|
|
||||||
|
```sh
|
||||||
|
kubectl label nodes <node-name> machine=<value> --overwrite
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
kubectl label nodes kevisual machine=kevisual --overwrite
|
||||||
|
|
||||||
|
kubectl label nodes pro machine=pro --overwrite
|
||||||
|
```
|
||||||
@@ -68,11 +68,11 @@ disabled_plugins = ["cri"]
|
|||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
[plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
|
# [plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"]
|
||||||
endpoint = [
|
# endpoint = [
|
||||||
"https://k8s.m.daocloud.io"
|
# "https://k8s.m.daocloud.io"
|
||||||
"https://docker.m.daocloud.io",
|
# "https://docker.m.daocloud.io",
|
||||||
]
|
# ]
|
||||||
```
|
```
|
||||||
|
|
||||||
# 重启 containerd
|
# 重启 containerd
|
||||||
|
|||||||
@@ -11,3 +11,5 @@ brew install kubectl
|
|||||||
```sh
|
```sh
|
||||||
cat /etc/rancher/k3s/k3s.yaml
|
cat /etc/rancher/k3s/k3s.yaml
|
||||||
```
|
```
|
||||||
|
|
||||||
|
###
|
||||||
Reference in New Issue
Block a user