«

rancher2.8.1连接带凭证的私有镜像仓库harbor

时间:2024-1-28 02:38     作者:Anglei     分类: 虚拟化


一、创建用于连接 harbor 的 secret

kubectl create secret docker-registry secret-harbor --namespace=myspace \
--docker-server=https://registry.XXX.cn --docker-username=admin \
--docker-password=xxxxxxx

secret-harbor 起一个 secret 名字
my-docs 为 secret 所属的 namespace
docker-server 为 harbor 私服地址
docker-username 为 harbor 私服登录账号
docker-password 为 harbor 私服登录密码


注:其中 imagePullSecrets 是声明拉取镜像时需要指定密钥,name 的值必须和上面生成密钥的键名一致, 另外检查一下 pod 和密钥是否在同一个 namespace(必须相同),之后k8s便可以拉取镜像。

本文完结,相关标签: harbor

 版权所有:Anglei
 文章标题:rancher2.8.1连接带凭证的私有镜像仓库harbor
 除非注明,本站文章如未特殊说明均为 MAXADA社区知识库 原创,且版权所有,请勿用于任何商业用途。

推荐阅读:

看完后感想如何?

路过(0)

雷人(0)

握手(0)

鲜花(0)

鸡蛋(0)
分享到: