增加验证到指定的namespaces
代码语言:javascript复制kubectl create secret docker-registry regsecret --docker-server=registry-vpc.cn-hangzhou.aliyuncs.com --docker-username=admin --docker-password=123456 --docker-email=xxxx@qq.com -n namespaces
yaml的方式
代码语言:javascript复制kind: Secret
apiVersion: v1
metadata:
name: regsecret
type: kubernetes.io/dockercfg
data:
".dockercfg": eyJyZWdpc3RyeS12cGMuY24taGFuZ3pob3UuYWxpeXVuY3MuY29tIjp7InVzZXJuYW1lIjoiYWRtaW4iLCJwYXNzd29yZCI6IjEyMzQ1NiIsImVtYWlsIjoieHh4eEBxcS5jb20iLCJhdXRoIjoiWVdSdGFXNDZNVEl6TkRVMiJ9fQ==
base64的由来
代码语言:javascript复制#cat > xx <<EOF
{"registry-vpc.cn-hangzhou.aliyuncs.com":{"username":"admin","password":"123456","email":"xxxx@qq.com","auth":"YWRtaW46MTIzNDU2"}}
EOF
#base64 xx
使用
代码语言:javascript复制...
"template" => ['spec' => [
"hostNetwork" => true,
"imagePullSecrets" => [['name' => 'your-registry-secret-name']],
"restartPolicy" => 'Never',
"containers" => [[
...