How to deploy Harbor private image registry?

If you don’t want to use public image registry for any reason, Harbor offers you the opportunity to distribute your own image registry.

In this way, you have a registry where you can store your images even in your air-gap environments.

How to deploy Harbor?

First, let’s download the Harbor helm chart files.

helm repo add harbor https://helm.goharbor.io
helm fetch harbor/harbor --untar
cd harbor

This helm chart offers many different configuration options that we can use when deploying Harbor.

I will distribute this Harbor in demo environment. For this reason
I’ll go with auto-generated certificate (you can also use your own TLS certificates), default storage class, default storage sizes and access Harbor via ingress.

You can find out what else you can configure by examining the values.yaml file.

Edit and run the following command according to your own hostname

helm install harbor-demo --namespace harbor --set expose.ingress.hosts.core=registry.suleyman.lab --set expose.ingress.hosts.notary=notary.suleyman.lab --set externalURL=https://registry.suleyman.lab --create-namespace .

We have successfully accessed the Harbor interface.

After this step, you need to configure your worker nodes according to the CNI you are using so that they can access the Harbor private registry.

Now let’s login to the image registry with Docker. (Default password: Harbor12345)

Now let’s try to push an image.

For this, I create a private project in Harbor.

We successfully pushed our image.

I hope you enjoyed the article. See you next time :)

Resources:

https://docs.docker.com

--

--