Kubernetes pods can't pull images from container registry (gcp)

后端 未结 2 1552
栀梦
栀梦 2021-02-19 15:06

I want to update my deployment on kubernetes with a new image which exists on \'eu.gcr.io\' (same project), I have done this before. But now the pods fail to pull the image beca

2条回答
  •  不知归路
    2021-02-19 15:28

    You will need to create a docker-registry secret and use imagePullSecrets in you pod definition:

    kubectl create secret docker-registry regcred --docker-server= --docker-username= --docker-password= --docker-email=
    
    
    apiVersion: v1
    kind: Pod
    metadata:
      name: private-reg
    spec:
      containers:
      - name: private-reg-container
        image: 
      imagePullSecrets:
      - name: regcred
    
    

    see this guide for more information

提交回复
热议问题