Hello everybody. Recently I started to study kubernetes and I readed guide in docker and k8s.
I have a question: Can Kubernetes work with docker registry (optional: without some secret and authification) ? And how ?
I want to create custom Image in docker registry and deploy in kubernetes.
Right now I have a problem. And I dont understand what wrong ?
Maybe you have a some article with example ?
My steps:
docker run -d -p 5000:5000 --name registry registry:2
docker pull tomcat
docker image tag tomcat localhost:5000/tomcat
docker push localhost:5000/tomcat
5, My yaml
apiVersion: v1
kind: Pod
metadata:
name: tomcat
spec:
containers:
name: tomcat
image: localhost:5000/tomcat
imagePullSecrets:
name: regcred
kubectl create -f my-test.yaml pod/tomcat created
kubectl get pod
tomcat 0/1 ImagePullBackOff 0 83s
kubectl describe pod tomcat
Name: tomcat
Namespace: default
Priority: 0
Node: pr40/myIP
Start Time: Tue, 01 Oct 2019 22:08:32 +0600
Labels:
Annotations:
Status: Pending
IP: 172.17.3.45
IPs:
IP: 172.17.3.45
Containers:
tomcat:
Container ID:
Image: localhost:5000/tomcat
Image ID:
Port:
Host Port:
State: Waiting
Reason: ImagePullBackOff
Ready: False
Restart Count: 0
Environment:
Mounts:
/var/run/secrets/kubernetes.io/serviceaccount from default-token-r56nj (ro)
Conditions:
Type Status
Initialized True
Ready False
ContainersReady False
PodScheduled True
Volumes:
default-token-r56nj:
Type: Secret (a volume populated by a Secret)
SecretName: default-token-r56nj
Optional: false
QoS Class: BestEffort
Node-Selectors:
Tolerations: node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message
Normal Scheduled default-scheduler Successfully assigned default/tomcat to pr40
Normal Pulling 29s (x4 over 2m) kubelet, pr40 Pulling image âlocalhost:5000/tomcatâ
Warning Failed 29s (x4 over 2m) kubelet, pr40 Failed to pull image âlocalhost:5000/tomcatâ: rpc error: code = Unknown desc = Error response from daemon: Get http://localhost:5000/v2/: dial tcp [::1]:5000: connect: connection refused
Warning Failed 29s (x4 over 2m) kubelet, pr40 Error: ErrImagePull
Normal BackOff 17s (x6 over 2m) kubelet, pr40 Back-off pulling image âlocalhost:5000/tomcatâ
Warning Failed 5s (x7 over 2m) kubelet, pr40 Error: ImagePullBackOff