Deploy Harbor
Harbor is an open source image repository management platform that helps you securely store, manage and distribute images.
Cautions
The service access address defaults to the IPV4 address. If you need to use IPV6 and the cluster network card supports IPV6, please modify the IPV4 address to the IPV6 address.
Prerequisites
Storage
Please ensure that at least one of the following prerequisites is met. Each prerequisite corresponds to a different storage method .
-
Dynamically generated PVC: A storage class already exists in the cluster. The access mode defined by the storage class must be ReadWriteMany (RWX).
Caution: NFS storage classes are not supported when deploying a highly available architecture. -
Use available PVC: A persistent volume claim (PVC) already exists in the cluster. The access mode selected in the PVC must be ReadWriteMany (RWX), and the volume mode must be File system.
Caution: NFS storage classes used in PVCs are not supported when deploying a highly available architecture. -
Use node storage: There is sufficient storage resources in the cluster nodes.
Tip: After deleting the tool created by the
Network
-
If you want to access the tool through a domain name, please create a domain name in advance.
-
If you want to use the HTTPS protocol, you need to prepare a certificate that matches the domain name. The certificate sources include
Platform administratorandImport ConfigSecret.Certificate Source Description Platform administrator A certificate created in Networking > Certificate . The certificate needs to be assigned to the project where Harbor will be deployed. Import ConfigSecret A TLS type secret dictionary created in Container Platform. The secret dictionary needs to be in the same namespace as Harbor.
High availability
Requirements for deploying Harbor as highly available:
-
PostgreSQL and Redis Operator must be deployed in the target cluster. In addition, the Redis Operator must be in the Own-namespace deployment mode.
-
The default StorageClass that is NOT
NFSalready exists to automatically deploy the required components.
On-premise deployment
-
In the left navigation bar, click DevOps Toolchain > Instances.
-
Click Create Instance.
-
On the Deploy and Integrate page, select Harbor.
-
In the Location area, select the Clusters and Namespaces where you want to deploy the tool.
-
In the Architecture area, select whether to use a high-availability architecture.
Caution: The architecture type cannot be modified after deployment.
-
In the Resources section, select a CPU and memory allocation method and complete the configuration.
Allocation Method Description Tool Allocate total resources for the tool to ensure overall availability. If you have no special requirements for the characteristics of individual components, the global allocation method will be more convenient. Components Allocate resources for each component of the tool to ensure business performance related to specific components. For example, you can set exclusive resource requirements for the PostgreSQL database to avoid performance bottlenecks. -
In the storage section, select a storage method and complete the configuration.
Caution: Storage configuration cannot be modified after the instance is created.
Storage Method Description Dynamically created PVCs Prerequisites: A storage class must be prepared in advance.
After setting the required storage capacity for each component of Harbor, the platform will dynamically generate a PVC for each component of Harbor and dynamically create a persistent volume for each component based on the storage class requested by the PVC. If you need to expand storage, go to Container Platform for PVC expansion.Available PVCs Prerequisites: PVCs must be prepared in advance.
After specifying an available PVC for each component of Harbor, the platform will dynamically create a persistent volume for each component based on the storage class requested by the PVC to meet the different storage demands of each component (expansion, snapshots, etc.). Supports direct storage expansion in Platform Management.Node storage Request storage resources on cluster nodes through the hostpath storage solution. NO StorageClasses is required.
Caution:- This solution is not applicable to highly available architecture.
- To avoid mounting failure, ensure that the path has not been used.
- When deploying the tool in a public cloud cluster, this solution is unavailable to avoid data loss because of node elasticty.
-
In the Networking section, configure network requirements.
Caution:
-
After deployment, please be cautious when updating the service access address. If updated, external settings need to be coordinated to ensure normal access, such as configuring DNS resolution. And this update only applies to the current network setting status. When the network setting changes again, the service access address will be automatically replaced with a restricted value.
-
If there are dual NIC nodes in the cluster where the tool is to be deployed, check whether the default load balancer IP address or node IP address used for service access is available outside the cluster ), otherwise the tool cannot be accessed normally after deployment, and the error message “check xx alive failed” will appear.
-
Ingress method
Parameter Description Domain Select a domain name that already exists in the platform. Make sure that the selected domain name has been allocated to the project that will use this tool. Scheme Supports selecting HTTP and HTTPS protocols.
Note: If you choose the HTTP protocol, you may encounter a situation where you cannot push images after quickly deploying and integrating Harbor. This is because Docker does not allow the use of Docker Registry without permission verification by default. In this case, you need to edit the/etc/docker/daemon.jsonfile in each cluster resource node of the Harbor image repository and add the Harbor access address to theinsecure-registriesfield, for example:"insecure-registries": ["192.168.0.100:5000"]. After completing the configuration, restart to take effect.Certificate If using the HTTPS protocol, you also need to configure a certificate that matches the domain name. Service access address Will be automatically generated, following the rule http://{Ingress name}orhttps://{Ingress name}. -
Nodeport: set up HTTP port, HTTPS port, and Notary port as planned.
-
-
In the Account section, configure the account-related information.
Parameter Description Name Default value is admin and cannot be modified. Password To ensure environment security, set a password in the credentials: click Create, fill in a recognizable name, and enter the password after HARBOR_ADMIN_PASSWORD in Configuration.
Note: If you need to modify the password later, please update the credential data information .SSO login Single sign-on. If enabled, you can use the platform account to log in to Harbor, and the authorized account can also pull images.
Note: After enabling SSO login, the following restrictions apply.- After quick deployment and integration with Harbor, updating the SSO button switch status is not supported.
- When logging in with a local Harbor user, only the default administrator account is supported.
- When binding the Harbor tool under the platform project, the SSO authorized account cannot be used for binding.
- The Name and CLI Password in the User Settings can also be used to access Harbor using Helm or Docker CLI.
-
In the Integration area, enter an integration name that will help the project members to identify and select this tool in DevOps.
-
After the configuration is complete, click Deploy and Integrate.
The instance integrates into the plaftform automatically.
Public cloud deployment
It is recommended to open a virtual machine and deploy a public cloud cluster before deploying DevOps tools, and use the same storage and network solution as the native cluster. In this way, the tools and capabilities supported for deployment are synchronized with the native cluster deployment tools.
Verification
Once the deployment status become Deployed, verify the tool’s accessibility by accessing the URL.