Remote site replicated Docker Registries with VMware Harbor

One of the great features of VMware Harbor registry is the out of the box image replication. Some of you may just use this feature for a simple way to back up your registry but I found another use case that may be of interest.  Let’s say you wanted to build and update container images locally but you then wanted to run some of them out at remote data centers or remote branch offices. What if you also wanted the ability to run the same images at multiple locations? Well now you can. In this guide I will show you how to setup replication to push images out to remote locations then I will show you how you can pull them locally from the registry at that remote location.

Pre-Reqs

  • Centrally installed Harbor Registry with at least one image uploaded, see my guide here
  • A second Harbor registry installed at a remote location
  • Intranet access from the source Harbor Registry Server to port 80 of the remote Harbor registry instance
  • A docker environment in both the source vSphere environment and the remote vSphere environment
  • A quiet place where you will not be interrupted see my guide here

Login to your local Harbor registry as an administrator

Now click on projects

Now click on the library project

Now click replication

No click +Add New Policy

Here we will enter the details for our Harbor registry hosted out on a Public Cloud, in my example I am using Amazon but any cloud will work.

  1. Give a name for the job
  2. Description
  3. Give a name for the new connection
  4. Enter in the endpoint address of the instance of harbor in the cloud
  5. Enter the user name and password of an admin user
  6. Click test connection
  7. If it tested successfully click ok

Now scroll down and see the status of the replication job, it should only take a few minutes if you only have one image.

Now login to your Harbor registry hosted in the cloud

Now click projects

Now click the library project

Notice that you now have that image replicated here. Also not anything you add to the local Harbor registry will appear here.

Now test the Harbor registry in the remote location by running an image from there. Start an a VM with Docker from the remote location and point to the registry there.

NOTE: I have setup the Harbor registries in insecure mode if you are using Photon OS see my guide here for RHEL/CENTOS see this guide https://docs.docker.com/registry/insecure/

Go to the web page and see that the container is running

Remember sharing is caring!

Leave a Reply

Your email address will not be published. Required fields are marked *

*

This site uses Akismet to reduce spam. Learn how your comment data is processed.