No documentation for pulling an image from the registry
S1naHeidari opened this issue · 1 comments
S1naHeidari commented
Hello everyone,
I am using this helm chart to set up a local docker registry inside my cluster. After I installed the chart, it asks to enter the following two commands:
export POD_NAME=$(kubectl get pods --namespace default -l "app=docker-registry,release=docker-registry" -o jsonpath="{.items[0].metadata.name}")
kubectl -n default port-forward $POD_NAME 8080:5000
Then I was able to push my locally created image to the registry with the following command:
docker push 127.0.0.1:8080/random-scheduler:v1
Now I can pull or push the image using docker, but when I reference this image inside a deployment I get an error. The following is the deployment file that uses random-scheduler:v1 image:
apiVersion: v1
kind: ReplicationController
metadata:
name: random-scheduler
spec:
replicas: 1
selector:
app: random-scheduler
template:
metadata:
name: random-scheduler
labels:
app: random-scheduler
spec:
containers:
- name: random-scheduler-container
image: 127.0.0.1:8080/random-scheduler:v1
ports:
- containerPort: 9999
When I apply this file, the following is the output of kubectl describe of the pod:
Events:
Type Reason Age From Message
---- ------ ---- ---- -------
Normal Scheduled 14s default-scheduler Successfully assigned default/random-scheduler-cfqvr to k8s-n-2
Normal BackOff 11s (x2 over 13s) kubelet Back-off pulling image "127.0.0.1:8080/random-scheduler:v1"
Warning Failed 11s (x2 over 13s) kubelet Error: ImagePullBackOff
Normal Pulling 0s (x2 over 13s) kubelet Pulling image "127.0.0.1:8080/random-scheduler:v1"
Warning Failed 0s (x2 over 13s) kubelet Failed to pull image "127.0.0.1:8080/random-scheduler:v1": rpc error: code = Unknown desc = failed to pull and unpack image "127.0.0.1:8080/random-scheduler:v1": failed to resolve reference "127.0.0.1:8080/random-scheduler:v1": failed to do request: Head http://127.0.0.1:8080/v2/random-scheduler/manifests/v1: dial tcp 127.0.0.1:8080:
connect: connection refused
Warning Failed 0s (x2 over 13s) kubelet Error: ErrImagePull
What is the correct way to reference this image inside my deployment?