k8s从需要认证的registry获取images

方法1:

kubectl create secret docker-registry regsecret --docker-server=registry.cn-hangzhou.aliyuncs.com --docker-username=xxxxxx --docker-password=xxxxxx

方法2:

echo -n password | docker login --username=xxxxxx --password-stdin registry.cn-hangzhou.aliyuncs.com
kubectl create secret generic regcred \
    --from-file=.dockerconfigjson=/home/user/.docker/config.json \
    --type=kubernetes.io/dockerconfigjson