一、配置一个secret获取docker镜像
参考文档《k8s的pull下载image时私有仓库认证配置》
二、获取secret的值
[root@xiangys0134-k8s-node01 tmp]# kubectl get secret xc-osp-aliyun-image-secret -n xc-ops -o yaml
三、制作成对应secret资源对象广泛应用
[root@xiangys0134-k8s-node01 templates]# vim tls-secrets.yaml
kind: Secret
apiVersion: v1
metadata:
name: {{ template "xc-osp.fullname" . }}-aliyun-image-secret
data:
.dockerconfigjson: >-
ewoJImFc1dGhzIjogewoJCSJyZWdpc3RyeS5jbi1oYW5ne5mhvdS5hbGl5dW5jcy5jb20iOi7CgkJCSJhdXRoIjogIlpHOWpaWEl0YVcxaFoyVkFl2iR010Y21Wc1pXRnpaVHBzVTNwS2VYgXdOMUpDYUROSlFnPT0iCgkJfQoJfwKCSJIdHRwSGVhZGVycyI6IHsKCQkiXNlci1BZ2VudCI6ICJEb2NrZItQ2xpZW50LzE5LjAzLjEyIChsaW5eCkiCgl9Cn0=
type: kubernetes.io/dockerconfigjson
留言