Skip to content

Instantly share code, notes, and snippets.

@sfoolish
Created December 21, 2016 01:50
Show Gist options
  • Save sfoolish/090c93a1ff417cbed3b148b07f501ab2 to your computer and use it in GitHub Desktop.
Save sfoolish/090c93a1ff417cbed3b148b07f501ab2 to your computer and use it in GitHub Desktop.
Kolla Multinode Local Registry Setup

Kolla Multinode Local Registry Setup

Deploy node setup

install and configure docker

curl -sSL https://get.docker.io | bash
mkdir -p /etc/systemd/system/docker.service.d
tee /etc/systemd/system/docker.service.d/kolla.conf <<-'EOF'
[Service]
MountFlags=shared
EOF
systemctl daemon-reload
systemctl restart docker

start local registry

docker run -d -p 4000:5000 --restart=always --name registry registry:2

install kolla and pull image from docker hub

yum install -y epel-release
yum install -y python-pip
yum install -y vim wget
pip install -U pip

yum install -y ansible
pip install kolla
cp -r /usr/share/kolla/etc_examples/kolla /etc/

kolla-ansible pull

push kolla images to local registry

# push all image to local registry, e.g.:
#     docker tag kolla/centos-binary-heat-api:3.0.1 \
#         localhost:4000/kolla/centos-binary-heat-api:3.0.1
#     docker push localhost:4000/kolla/centos-binary-heat-api:3.0.1
docker images | grep kolla | grep -v local | awk '{print $1,$2}' | while read -r image tag; do
    docker tag ${image}:${tag} localhost:4000/${image}:${tag}
    docker push localhost:4000/${image}:${tag}
done

Target nodes setup

install and configure docker

curl -sSL https://get.docker.io | bash
echo 'INSECURE_REGISTRY="--insecure-registry 192.168.122.71:4000"' > /etc/sysconfig/docker

tee /etc/systemd/system/docker.service <<-'EOF'
# CentOS
[Service]
MountFlags=shared
EnvironmentFile=/etc/sysconfig/docker
ExecStart=/usr/bin/docker daemon $INSECURE_REGISTRY
EOF

systemctl daemon-reload
systemctl restart docker

try to pull a kolla image from local registry

docker pull kolla/centos-binary-kolla-toolbox:3.0.1

list local images

docker images

Reference

@satishdotpatel
Copy link

What are the advantage of maintaining local copy of registry? Just to save cost of bandwidth or are there any bigger advantage here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment