Harbor is an open source registry that secures artifacts with policies and role-based access control, ensures images are scanned and free from vulnerabilities, and signs images as trusted. As a CNCF Incubating project, Harbor delivers compliance, performance, and interoperability to help you consistently and securely manage artifacts across cloud native compute platforms like Kubernetes and Docker.
In loft, Harbor can be installed as an App and loft users can login into Harbor via loft or your configured external authentication provider in loft. Before you start, please make sure you have a running loft instance available.
In order to deploy Harbor, you have to connect a cluster first where you want to install Harbor in. Next go to the cluster overview page. To access Harbor in the cluster, you will need to deploy an ingress controller (if you don't already have one) and the cert-manager for creating a tls certificate. You can do this by deploying the predefined apps nginx-ingress, cert-manager and cert-issuer (you will only need to deploy those, if the connected cluster is NOT the cluster where loft is installed in):
Once you have an ingress controller and cert-manager running, click on the Harbor Icon. The drawer should open, where you are now able to configure harbor. A complete overview of all Harbor configuration options is available at the official Harbor helm chart documentation.
An example configuration to configure Harbor could look like this:
After configuring the correct values for Harbor press the 'Install' button.
If you misconfigured anything, you can just click on the Harbor button again and change the values. After installing the helm chart into the cluster, wait until all Harbor pods and certificates are Ready:
Now Harbor should be up and running under your configured URL:
Congratulations, you have now a fully working Harbor instance! See the next chaptor how to configure Harbor to handle authentication through loft.
Configure Harbor to use loft as login provider
In order to let your loft users log into the Harbor instance with their loft user, you can configure loft as the OIDC provider for Harbor. To configure loft as an OIDC provider you can edit the loft config in the loft UI:
Use the following values to allow harbor to connect to loft:
After you have changed the loft config, head over to Harbor and change the AuthMode in Administration -> Configuration to OIDC:
Make sure the field OIDC Endpoint is set to your loft instance URL with the path
/oidc. Furthermore make sure you use the same client id & secret in the harbor configuration as in the loft-config configmap. After you have configured Harbor with the loft OIDC options, press 'Save' and you should now be able to login via loft to your Harbor instance!
One note regarding loft teams: loft teams are passed to Harbor as groups with the prefix
loft:team:. If you have configured loft to use an OIDC itself to login users, groups will be forwarded from your external OIDC provider to Harbor.