k8s pull private image imagepullsecrets

k8s pull private image imagepullsecrets

Instructions:

spec:
  imagePullSecrets:
  - name: aliyun-registry

Use the command to create the Secret command as follows:

kubectl create secret docker-registry aliyun-registry --docker-server=registry.cn-hangzhou.aliyuncs.com --docker-username=XXX --docker-password=XXX -n XXX

among them:

aliyun-registry: 指定密钥的键名称, 可自行定义
--docker-server: 指定docker仓库地址
--docker-username: 指定docker仓库账号
--docker-password: 指定docker仓库密码
-n : 命名空间,在那个命名空间创建,就只能在那个命名空间使用这个secret

Guess you like

Origin blog.csdn.net/lswzw/article/details/113326286