Moving to kubernetes-users

On Tue, Jun 13, 2017 at 01:46:02AM -0700, Akash Agrawal wrote:
> 
> Team,
> 
> I have an ubuntu installed on my laptop. 
> 
> I started a private docker registry (ssl enabled + htpasswd secured) and 
> added it on overlay network (so it can be accessed from other hosts/vms)
> 
> here is the code (docker-compose.yaml):
> 
> version: "3"
> 
> services:
>  registry:
>   restart: always
>   image: registry:2
>   ports:
>     - 5000:5000
>   environment:
>     REGISTRY_HTTP_TLS_CERTIFICATE: /certs/domain.crt
>     REGISTRY_HTTP_TLS_KEY: /certs/domain.key
>     REGISTRY_AUTH: htpasswd
>     REGISTRY_AUTH_HTPASSWD_PATH: /auth/htpasswd
>     REGISTRY_AUTH_HTPASSWD_REALM: Registry Realm
>   volumes:
>     - /certs:/certs
>     - ~/caas_rd/workspace/ci_cd_pipeline/registry_setup:/auth
>   networks:
>     - overlaynetwork
> networks:
>   overlaynetwork:
> 
> 
> so my registry is running in the following link (with dns, i can verify it 
> in browser) : https://home-thinkpad-t420s:5000/v2/_catalog
> 
> Now I installed "Minikube" on my laptop. && ssh it by "minikube ssh".
> 
> I created a folder "/etc/docker/certs.d" on minikube vm & added 
> certificates as per instructions : 
> 
> https://docs.docker.com/engine/security/certificates/#understanding-the-configuration
> 
> I also modified /etc/hosts && appended ca.cert on 
> /etc/ssl/certs/ca-certificates.crt.
> 
> and restarted docker service on minikube vm by : sudo systemctl restart 
> docker.service
> 
> after this I am able to pull the images on minikube vm by "docker login & 
> docker pull" & also by "curl with (cacert + username/password)"
> above is working perfectly fine, means I can successfully access/pull 
> private registry images inside minikube vm.
> 
> Then I tried to create a secret (on my laptop with kubectl create -f 
> <secret file name>) defined as below:
> 
> apiVersion: "v1"
> kind: "Secret"
> metadata:
>   name: "ssl-proxy-secret"
>   namespace: "default"
> data:
>  proxycert: "LS0..."
>  proxykey: "LS0t..."
>  htpasswd: "YWRt..."
> 
> 
> and created a pod (on my laptop with kubectl create -f <pod file name>) 
> defined as below:
> 
> apiVersion: v1
> kind: Pod
> metadata:
>   name: private-jenkins
> spec:
>   containers:
>   - name: private-jenkins-container
>     image: home-thinkpad-t420s:5000/my-jenkins
>     volumeMounts:
>     - name: secrets
>       mountPath: /etc/secrets
>   volumes:
>   - name: secrets
>     secret:
>        secretName: ssl-proxy-secret
> 
> 
> but when I try to run this pod, it throws error :
> 
> Failed to pull image "home-thinkpad-t420s:5000/my-jenkins": rpc error: code 
> = 2 desc = Error: image my-jenkins not found 
> Error syncing pod, skipping: failed to "StartContainer" for 
> "private-jenkins-container" with ErrImagePull: "rpc error: code = 2 desc = 
> Error: image my-jenkins not found" 
> 
> 
> If I am able to pull images inside the minikube vm successfully by curl & 
> docker login/pull......then when why pod creation is failing with above 
> error ?

To use the jenkins image from a private registry, you should specify a imagePull
secret. See https://kubernetes.io/docs/concepts/containers/images/ for detailed
info.

I think that should do the trick. But let me know otherwise! :)

-- 
You received this message because you are subscribed to the Google Groups 
"Kubernetes user discussion and Q&A" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to kubernetes-users+unsubscr...@googlegroups.com.
To post to this group, send email to kubernetes-users@googlegroups.com.
Visit this group at https://groups.google.com/group/kubernetes-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to