Not able to pull image from local docker registry when tried to create a POD using yaml file

3/9/2017

I'm not able to pull an image from my local docker registry when I try to create a POD using yaml file. Here are the diagnostic steps taken:

kubectl describe pod <pod name>

error msg: Error while pulling image: Get http://localhost:5001/v1/repositories/hello_world_application/images: dial tcp [::1]:5001: getsockopt: connection refused


docker images

REPOSITORY TAG IMAGE ID CREATED SIZE

img_app latest 259dc6d7b6fe 18 hours ago 689.3 MB localhost:5001/img_app latest 259dc6d7b6fe 18 hours ago 689.3 MB docker.io/python 2.7 ca388cdb5ac1 8 days ago 676.1 MB


netstat -anp | grep 5001

tcp6 0 0 :::5001 :::* LISTEN 31971/registry


Here's my Pod configuration (my-pod.yaml):

apiVersion: v1
kind: Pod
metadata:
  name: my-pod-1
  labels:
    name: my-pod-label
spec:
  containers:
  - name: my-application
    image: localhost:5001/img_app:latest
    imagePullPolicy: IfNotPresent
    ports:
    - containerPort: 5000
      name: my-pod-label
-- dev
connection
containers
docker
image
kubernetes

1 Answer

3/9/2017

Reading through your debugging output, it seems that you have the images laying on your local docker host without running a registry. Therefore using imagePullPolicy: Never in your POD config would allow you to use the local images from the docker daemon without going the detour through an additional registry.

-- pagid
Source: StackOverflow