Thursday, December 21, 2017

docker insecure registry

I have been tortured for a long time by this:

sudo oc cluster up

[sudo] password for centos:
Starting OpenShift using openshift/origin:v3.7.0 ...
-- Checking OpenShift client ... OK
-- Checking Docker client ... OK
-- Checking Docker version ... OK
-- Checking for existing OpenShift container ... OK
-- Checking for openshift/origin:v3.7.0 image ... OK
-- Checking Docker daemon configuration ... FAIL
Error: did not detect an --insecure-registry argument on the Docker daemon
Solution:

Ensure that the Docker daemon is running with the following argument:
--insecure-registry 172.30.0.0/16





"docker info" will output you a wealth of information, including this:

Insecure Registries:
127.0.0.0/8


( you can use docker info | grep -A 4 -i insecure )

So the only way to start Openshift Cluster was

sudo oc cluster up --skip-registry-check=true


It turned out that https://stackoverflow.com/questions/42211380/add-insecure-registry-to-docker to add the extra entry for insecure-registry one should

sudo vi /etc/docker/daemon.json

and enter this:

{
"insecure-registries" : [ "172.30.0.0/16" ]
}


sudo systemctl daemon-reload
sudo systemctl restart docker
sudo oc cluster down
sudo oc cluster up



and no more errors! Great!

To the Openshift lazy developers: in future please provide also a hint how to troubleshoot the issue... it would save a LOT of time to us frustrated users.

The more I use Openshift the more it feels like a huge Goldberg machine, a Zeppelin.






No comments: