Skip to content

Deploy Harbor through LoadBalancer mode

Currently, DCE 5.0 Container Registry does not support deploying Harbor using LoadBalancer mode. It only supports Ingress and NodePort modes. This document briefly explains how to manually change the access type to LB.

1. Create a NodePort Harbor service

First, create a managed Harbor and create a Harbor service with the access mode set to NodePort.

2. Create a LoadBalancer SVC resource

In the Container Network -> Services of the cluster where Harbor is located, create an LB-type SVC resource.

Note

When creating an LB-type SVC resource, the labels need to match the labels of the nginx SVC and be created in the same namespace.

After creating the Harbor service, an nginx SVC resource will automatically appear in the Container Network -> Services of the cluster where Harbor is located. In the service list, click the button on the right side, and select Update in the dropdown menu to view the label information of nginx.

3. Modify the harborclusters.goharbor.io CR

Modify the externalUrl field in the harborclusters.goharbor.io to the IP address of the LB.

Modify with UI

  1. Search for harborclusters.goharbor.io in the Custom Resource List.

  2. Click the name to enter the details, select API version v1beta1, and save after modifying the API version.

Modify with CLI

Run the following command in the proper cluster:

kubectl edit harborclusters.goharbor.io

Comments