kubectl create secret docker-registry regsecret --docker-server=registry-internal.cn-hangzhou.aliyuncs.com --docker-username=abc@aliyun.com --docker-password=xxxxxx --docker-email=abc@aliyun.com
其中:
- regsecret: 指定密钥的键名称,可自行定义。
- —docker-server:指定 Docker 仓库地址。
- —docker-username: 指定 Docker 仓库用户名。
- —docker-password:指定 Docker 仓库登录密码。
- —docker-email:指定邮件地址(选填)。
yml 文件加入密钥参数。
containers:
- name: foo
image: registry-internal.cn-hangzhou.aliyuncs.com/abc/test:1.0
imagePullSecrets:
- name: regsecret
其中:
imagePullSecrets
是声明拉取镜像时需要指定密钥。regsecret
必须和上面生成密钥的键名一致。image
中的 Docker 仓库名称必须和--docker-server
中的 Docker 仓库名一致。
详情信息参见官方文档 使用私有仓库。
在文档使用中是否遇到以下问题
更多建议
匿名提交