diff --git a/k8s/xiongxiao.me/README.md b/k8s/xiongxiao.me/README.md index b0c1ecd..02b9b0c 100644 --- a/k8s/xiongxiao.me/README.md +++ b/k8s/xiongxiao.me/README.md @@ -20,4 +20,12 @@ kubectl delete job -n kube-system helm-install-traefik helm-install-traefik-crd # 安装 Traefik CRD kubectl apply -f https://raw.githubusercontent.com/traefik/traefik/v3.0/docs/content/reference/dynamic-configuration/kubernetes-crd-definition-v1.yml +``` + +## use devcontext + +```sh +kubectl config use-context dev-context +# ls context +kubectl config use-context kevisual-context ``` \ No newline at end of file diff --git a/k8s/xiongxiao.me/config/registry.md b/k8s/xiongxiao.me/config/registry.md index 91b4898..8b13789 100644 --- a/k8s/xiongxiao.me/config/registry.md +++ b/k8s/xiongxiao.me/config/registry.md @@ -1,113 +1 @@ -sudo vim /etc/rancher/k3s/registries.yaml - -```yaml -mirrors: - docker.io: - endpoint: - - 'https://docker.1ms.run' - - 'https://docker.m.daocloud.io' - - 'https://docker.1panel.live' - - 'https://docker-0.unsee.tech' - - 'https://dytt.online' - - 'https://lispy.org' - - 'https://docker.xiaogenban1993.com' - - 'https://666860.xyz' - - 'https://hub.rat.dev' - - 'https://demo.52013120.xyz' - - 'https://proxy.vvvv.ee' - - 'https://registry.cyou' - - 'http://hub-mirror.c.163.com' - - "registry.k8s.io": - endpoint: - - 'https://k8s.m.daocloud.io' - - 'https://docker.m.daocloud.io' - # rancher 镜像加速 - 'rancher': - endpoint: - - 'https://docker.1ms.run/rancher' - -configs: - 'docker.1ms.run': - tls: - insecure_skip_verify: true -``` - -```bash -# Master 节点重启 k3s -sudo systemctl restart k3s - -# Worker 节点重启 k3s-agent -sudo systemctl restart k3s-agent -``` - -## container ctr - -```bash -vim /etc/containerd/config.toml - - -disabled_plugins = ["cri"] - -[plugins."io.containerd.grpc.v1.cri".registry] - [plugins."io.containerd.grpc.v1.cri".registry.mirrors] - [plugins."io.containerd.grpc.v1.cri".registry.mirrors."docker.io"] - endpoint = [ - "https://docker.1ms.run", - "https://docker.m.daocloud.io", - "https://docker.1panel.live", - "https://dytt.online", - "https://docker-0.unsee.tech", - "https://lispy.org", - "https://docker.xiaogenban1993.com", - "https://666860.xyz", - "https://hub.rat.dev", - "https://demo.52013120.xyz", - "https://proxy.vvvv.ee", - "https://registry.cyou" - ] - - -# [plugins."io.containerd.grpc.v1.cri".registry.mirrors."registry.k8s.io"] -# endpoint = [ -# "https://k8s.m.daocloud.io" -# "https://docker.m.daocloud.io", -# ] -``` - -# 重启 containerd - -```bash -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 tag docker.m.daocloud.io/rancher/mirrored-pause:3.6 docker.io/rancher/mirrored-pause:3.6 - -sudo ctr -n k8s.io images delete docker.m.daocloud.io/rancher/mirrored-pause:3.6 - - -# 查看镜像 -sudo ctr -n k8s.io images ls | grep pause -``` - -## 安装 cluster-api-controller - -```bash -registry.k8s.io/cluster-api/cluster-api-controller:v1.10.6 - -sudo ctr image pull registry.k8s.io/cluster-api/cluster-api-controller:v1.10.6 - -# proxy 镜像 -sudo ctr -n k8s.io image pull k8s.m.daocloud.io/cluster-api/cluster-api-controller:v1.10.6 - -# 打标签 -sudo ctr -n k8s.io images tag k8s.m.daocloud.io/cluster-api/cluster-api-controller:v1.10.6 registry.k8s.io/cluster-api/cluster-api-controller:v1.10.6 - -# 删除镜像 -sudo ctr -n k8s.io images delete k8s.m.daocloud.io/cluster-api/cluster-api-controller:v1.10.6 - -```