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 on public clouds. What if you also wanted the ability to run them on any cloud you choose at any time? Well now you can. In this guide I will show you how to setup replication to push images out to a public cloud then I will show you how you can pull them locally from the registry on that public cloud provider.
- Locally installed Harbor Registry with at least one image uploaded, see my guide here
- Harbor registry installed in a public cloud instruction here
- Internet access from the internal Harbor Registry Server to port 80 of the public cloud Harbor instance
- A docker environment in both the internal vSphere environment and the public cloud to test with
- A quiet place where you will not be interrupted see my guide here
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.
- Give a name for the job
- Give a name for the new connection
- Enter in the endpoint address of the instance of harbor in the cloud
- Enter the user name and password of an admin user
- Click test connection
- If it tested successfully click ok
NOTE: If your test fails and you are running an instance in a VPC see this for help.
Now scroll down and see the status of the replication job, it should only take a few minutes if you only have one image.
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 on the public cloud instance by running an image from there. Start an instance in the public cloud and point to the registry there.
NOTE: I have setup the registry 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/