在每个namespace下都有一个默认的service account
使用 kubectl get sa -n test 查看
kubectl describe sa -n test查看serviceaccount信息
Image pull secrets 是ns下拉取镜像的秘钥
1.创建secret
kubectl create secret docker-registry registrykey --namespace=default --docker-username='harbor_user' --docker-password=harbor_password --docker-server=harbar_url
2.配置进service account
kubectl patch serviceaccount default -p '{"imagePullSecrets": [{"name": "registrykey"}]}' -n default
至此在test下拉取镜像无需配置镜像拉取秘钥了