Node节点已经配置了docker私有库,docker pull镜像可以正常拉取,但是在k8s master节点创建deployment时,pod一直处于ImagePullBackOff,ErrImagePull状态来回切换。
kubectl describe pod 查看pod错误提示,看到Failed to pull image “xxx.xxx.xxx/job:latest”: rpc error: code = Unknown desc = Error response from daemon:pull access denied for xxx.xxx.xxx/job, repository does not exist or may require ‘docker login’: denied: requested access to the resource is denied
查了一会文档,为了方便以后操作,创建一个Secret,在deployment里指定imagePullSecrets,就可以正常拉取。
1.创建Secret
kubectl create secret docker-registry myregcred -n ceres\
--docker-server=<your-reg