Ask Your Question
0

How to setup docker insecure registry for kolla?

asked 2017-08-18 09:25:47 -0500

EchoGhost gravatar image

updated 2017-08-21 08:56:45 -0500

I have been working through the kolla ansible installation for openstack. https://docs.openstack.org/project-deploy-guide/kolla-ansible/ocata/multinode.html (Ocata Guide I am using here) . Currently using 3x centos 7 virtual machines in order to test a multi node deployment method. The problem I am running into is when deploying the insecure registry.

The following are the steps I am taking.

sudo /usr/share/kolla/tools/start-registry

Modify the /etc/sysconfig/docker file to contain the following where 192.168.1.100 is the IP address of the machine where the registry is currently running:

sudo nano /etc/sysconfig/docker

Adding to the file:

INSECURE_REGISTRY="--insecure-registry 192.168.1.100:5000"

Next, modify /etc/systemd/system/docker.service.d/kolla.conf, add environmentFile variable and add $DOCKER_OPTS to the end of ExecStart in [Service] section:

sudo nano /etc/systemd/system/docker.service

[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY

Restart Docker by executing the following commands:

sudo systemctl daemon-reload
sudo systemctl restart docker

Upon going through these steps, end up with the following result:

[bobtheuser@kolla ~]$ sudo systemctl restart docker
Failed to restart docker.service: Unit is not loaded properly: Invalid argument.

looking into the error more, I have the following information.

[bobtheuser@kolla ~]$ sudo systemctl status docker.service -l
[sudo] password for cloudmaster:
● docker.service - Docker Application Container Engine
   Loaded: error (Reason: Invalid argument)
  Drop-In: /etc/systemd/system/docker.service.d
           └─kolla.conf
   Active: inactive (dead)
     Docs: https://docs.docker.com

Aug 18 09:16:17 kolla.lab systemd[1]: docker.service has more than one ExecStart= setting, which is only allowed for Type=oneshot services. Refusing.

I have looked around online to see if anyone else has encountered this issue, but with no results. It seems to be an error with the ExecStart. Is there something that I am missing or a different procedure that needs to be followed?

Update 1:

[bobtheuser@kolla cloudmaster]# sudo systemctl status docker.service -l
● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/docker.service.d
└─kolla.conf
Active: failed (Result: start-limit) since Mon 2017-08-21 08:42:48 EDT; 2s ago
Docs: https://docs.docker.com
Process: 2536 ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY (code=exited, status=1/FAILURE)
Main PID: 2536 (code=exited, status=1/FAILURE)

Aug 21 08:42:47 kolla.lab systemd[1]: Failed to start Docker Application Container Engine.
Aug 21 08:42:47 kolla.lab systemd[1]: Unit docker.service entered failed state.
Aug 21 08:42:47 kolla.lab systemd[1]: docker.service failed.
Aug 21 08:42:48 kolla.lab systemd[1]: docker.service holdoff time over, scheduling restart.
Aug 21 08:42:48 kolla.lab systemd[1]: start request repeated too quickly for docker.service
Aug 21 08:42:48 kolla.lab systemd[1]: Failed to start Docker Application Container Engine.
Aug 21 08:42:48 kolla.lab systemd[1]: Unit docker.service entered ...
(more)
edit retag flag offensive close merge delete

Comments

What docker version are you using, as iGene commented in his answer, may be an issue with docker daemon.

Try setting dockerd in execstart

ExecStart=/usr/bin/dockerd $INSECURE_REGISTRY

also can try using directly the registry IP rather than the variable with --insecure-registry <url>

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-08-21 07:36:06 -0500 )edit

Have you done?

systemctl daemon-reload

before

systemctl restart docker

Also, please share current state of systemd docker's kolla.conf

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-08-21 07:55:13 -0500 )edit

Docker Version: 17.06.0-ce

And to answer your question, I was performing daemon-reload and restarting docker for each change/try attempt.

I posted working kolla.conf and docker file contents under "update 2" of original posting and under the answer post I made to this thread.

EchoGhost gravatar imageEchoGhost ( 2017-08-21 08:55:26 -0500 )edit

3 answers

Sort by » oldest newest most voted
0

answered 2017-08-21 03:33:20 -0500

Hi,

Problem is that ExecStart already have a value in default's docker configuration.

Before setting custom ExecStart, an empty value must be set to allow override.

Example:

[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
ExecStart=
ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY

Regards

edit flag offensive delete link more

Comments

Proceeded to backport the change, was already fixed in upstream master branch

Eduardo Gonzalez gravatar imageEduardo Gonzalez ( 2017-08-21 03:44:32 -0500 )edit

I forgot to mention that I had performed this setting suggestion in earlier attempt, since it was the main course of action suggested online. Sadly still results in a failed docker start. See update 1 in original post for result.

EchoGhost gravatar imageEchoGhost ( 2017-08-21 07:34:37 -0500 )edit
0

answered 2017-08-20 19:41:22 -0500

iGene gravatar image

Hi EchoGhost,

If you are using a newer version of docker. docker daemon command is no longer working. You should change ExecStart from ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY to ExecStart=/usr/bin/docked $INSECURE_REGISTRY

Hope this help.

edit flag offensive delete link more

Comments

combining your answer with answer from Eduardo Gonzalez seems to produced a working config. Posted under "update 2" in the original post is the working conf file configuration.

EchoGhost gravatar imageEchoGhost ( 2017-08-21 07:57:34 -0500 )edit
0

answered 2017-08-21 08:02:16 -0500

EchoGhost gravatar image

updated 2017-08-21 08:03:04 -0500

Working file configs:

/etc/systemd/system/docker.service.d/kolla.conf file contents:

[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
ExecStart=
ExecStart=/usr/bin/dockerd $INSECURE_REGISTRY

/etc/sysconfig/docker file contents:

INSECURE_REGISTRY="--insecure-registry 192.168.1.100:5000"
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-08-18 09:24:56 -0500

Seen: 980 times

Last updated: Aug 21 '17