环境信息:
RKE2 版本: v1.26.10+rke2r2
问题描述:
1.crictl的拉取得镜像怎么推送到harbor仓库里
2./run/k3s/containerd/ 目录怎么更改
3./etc/rancher/rke2/registries.yaml 每次重启这个配置都会没掉
求大佬指点
环境信息:
RKE2 版本: v1.26.10+rke2r2
问题描述:
1.crictl的拉取得镜像怎么推送到harbor仓库里
2./run/k3s/containerd/ 目录怎么更改
3./etc/rancher/rke2/registries.yaml 每次重启这个配置都会没掉
求大佬指点
/etc/rancher/rke2/registries.yaml
就会被覆盖2.没改过,只会docker的修改
我目前也是用2.7.6离线安装 k3s+rancher 下游rke2
这个我试过了,推不到Harbor上面,要配置登录harbor地址吗,我在网上找的在/etc/containerd/config.toml 这个配置里加了仓库地址都没用
新版太难用了
我自己测试没问题,我不知道你是咋弄的,说不好用,步骤如下:
export CONTAINERD_ADDRESS="unix:///run/k3s/containerd/containerd.sock"
root@RancherWorker-3:/home/ubuntu# nerdctl -n k8s.io image tag nginx wanghl041/nginx-delete
root@RancherWorker-3:/home/ubuntu# nerdctl login
Enter Username: wanghl041
Enter Password:
WARNING: Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
root@RancherWorker-3:/home/ubuntu# nerdctl -n k8s.io image push wanghl041/nginx-delete
INFO[0000] pushing as a reduced-platform image (application/vnd.docker.distribution.manifest.list.v2+json, sha256:a713720fede42ff207cb8cc88e344c078b26cd98461b322b7942116111d19c75)
index-sha256:a713720fede42ff207cb8cc88e344c078b26cd98461b322b7942116111d19c75: done |++++++++++++++++++++++++++++++++++++++|
manifest-sha256:3c4c1f42a89e343c7b050c5e5d6f670a0e0b82e70e0e7d023f10092a04bbb5a7: done |++++++++++++++++++++++++++++++++++++++|
config-sha256:a6bd71f48f6839d9faae1f29d3babef831e76bc213107682c5cc80f0cbb30866: done |++++++++++++++++++++++++++++++++++++++|
elapsed: 4.2 s total: 10.0 K (2.4 KiB/s)
root@RancherWorker-3:/home/ubuntu# rke2 -v
rke2 version v1.27.7+rke2r2 (b0106a62b46c557e73512a02b2e4348e30dac7d7)
go version go1.20.10 X:boringcrypto
/etc/rancher/{k3s/rke2}/registries.yaml
这个都配过了 不行
你的configs 一个节点可以了,把tls放上去
mirrors:
"192.168.199.124":
endpoint:
- "https://192.168.199.124"
configs:
"192.168.199.124":
auth:
username: admin
password: Harbor12345
tls:
insecure_skip_verify: true
需要重启systemctl restart rke2-server / rke2-agent,然后就会生效