ErrImagePull when creating a kubernetes deployment

12/8/2018

We have a .yaml file like this :

apiVersion: apps/v1 # for versions before 1.9.0 use apps/v1beta2
kind: Deployment
metadata:
  name: redis-master
  labels:
    app: redis
spec:
  selector:
    matchLabels:
      app: redis
      role: master
      tier: backend
  replicas: 1
  template:
    metadata:
      labels:
        app: redis
        role: master
        tier: backend
    spec:
      containers:
      - name: master
        image: k8s.gcr.io/redis:e2e  # or just image: redis
        resources:
          requests:
            cpu: 100m
            memory: 100Mi
        ports:
        - containerPort: 6379

I working with kubeadm and we have a master machine and a worker machine . When I start up the deployment and get the pods kubectl get pods it gives this :

redis-master-57fc67768d-28kng   0/1     ImagePullBackOff   0          11s

Whats wrong with it?

-- Majid Rajabi
kubeadm
kubernetes

1 Answer

12/8/2018

tl;dr; There is no e2e tag for Redis, you need to use a valid tag

Kubernetes is requesting a container image from the repository that doesn't exist. While images for redis and k8s.gcr.io/redis do exist, you are telling Kubernetes (which is in turn telling Docker) to pull the image with the tag e2e, which does not exist.

You can find a listing of which tags are available for the redis image on Docker Hub.

-- chaosaffe
Source: StackOverflow