How to deploy application to minikube use registry in Kubernetes?

11/10/2017

Intalled registry in Kubernetes kubectl create -f kube-registry.yaml.

There has docker image in it:

curl http://192.168.99.100:5000/v2/_catalog
{"repositories":["app1"]}

Also did port-forward:

kubectl port-forward --namespace kube-system \
$(kubectl get po -n kube-system | grep kube-registry-v0 | \
awk '{print $1;}') 5000:5000

Set image: 192.168.99.100:5000/app1 in Kubernetes deployment file(deployment.yaml).

After deploy it to cluster:

kubectl create -f deployment.yaml

Check status from Kubernetes dashboard on Deployments menu, got error:

Failed to pull image "192.168.99.100:5000/app1": rpc error: code = 2 desc = Error response from daemon: {"message":"Get https://192.168.99.100:5000/v1/_ping: http: server gave HTTP response to HTTPS client"}
Error syncing pod

The reason is can't get registry content from http protocol. How to resolve it?


Added insecure-registries by (The real content is 192.168.99.100:5000. Here is a different IP/port picture.)

enter image description here

-- online
docker-registry
http
https
kubernetes
minikube

2 Answers

11/13/2017

Useful resource

minikube start --insecure-registry "10.0.0.0/24"

https://github.com/kubernetes/minikube/blob/master/docs/insecure_registry.md

-- online
Source: StackOverflow

11/10/2017
  1. Configure docker to pull image using http insecure-registries

create this file in your node and restart docker process, then try to deploy

/etc/docker/daemon.json

{
  "insecure-registries" : ["192.168.99.100:5000"]
}
-- sfgroups
Source: StackOverflow