This is my deployment manifest
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 manifest with this Yaml file but it is throws the below mentioned 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 someone could hep me fix this issue it would be helpful.
2
Answers
instead of "mongo" for the image use this: "registry.hub.docker.com/library/mongo"
I just copied the manifest from your request and deployed it in my cluster
mongo was deployed without issues. You must not have connectivity to internet. please check