简体   繁体   中英

Can not pull the Mongo image in Kubernetes

'''

 apiVersion: apps/v1 kind: Deployment metadata: name: mongodb-deployment labels: app: mongodb spec: replicas: 1 selector: matchLabels: app: mongodb template: metadata: labels: app: mongodb spec: containers: - name: mongodb image: mongo ports: - containerPort: 27017 env: - name: MONGO_INITDB_ROOT_USERNAME valueFrom: secretKeyRef: name: mongodb-secret key: mongo-root-username - name: MONGO_INITDB_ROOT_PASSWORD valueFrom: secretKeyRef: name: mongodb-secret key: mongo-root-password

'''

I have tried several times to apply Kubernetes pod with this Yaml file but don't understand the problem. It is always showing the error.

 ''' Failed to pull image "mongo": rpc error: code = Unknown desc = context deadline exceeded Warning Failed 13s kubelet Error: ErrImagePull Normal BackOff 13s kubelet Back-off pulling image "mongo" Warning Failed 13s kubelet Error: ImagePullBackOff '''

If anyone can help. I am stuck here for several days.

instead of "mongo" for the image use this: "registry.hub.docker.com/library/mongo"

You are missing the image tag. use mongo:latest

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM