harbor
by KubeSphere
An open source trusted cloud native registry that stores, signs, and scans content
About this chart
Helm Chart for Harbor
Notes: The master branch is in heavy development, please use the other stable versions instead. A highly available solution for Harbor based on chart can be find here. And refer to the guide to upgrade the existing deployment.
This repository, including the issues, focuses on deploying Harbor chart via helm. For functionality issues or Harbor questions, please open issues on goharbor/harbor
Introduction
This Helm chart installs Harbor in a Kubernetes cluster. Welcome to contribute to Helm Chart for Harbor.
Prerequisites
- Kubernetes cluster 1.20+
- Helm v3.2.0+
Installation
Add Helm repository
helm repo add harbor https://helm.goharbor.io
Configure the chart
The following items can be set via --set flag during installation or configured by editing the values.yaml directly (need to download the chart first).
Configure how to expose Harbor service
- Ingress: The ingress controller must be installed in the Kubernetes cluster. Notes: if TLS is disabled, the port must be included in the command when pulling/pushing images. Refer to issue #5291 for details.
- ClusterIP: Exposes the service on a cluster-internal IP. Choosing this value makes the service only reachable from within the cluster.
- NodePort: Exposes the service on each Node’s IP at a static port (the NodePort). You’ll be able to contact the NodePort service, from outside the cluster, by requesting
NodeIP:NodePort. - LoadBalancer: Exposes the service externally using a cloud provider’s load balancer.
Configure the external URL
The external URL for Harbor core service is used to:
- populate the docker/helm commands showed on portal
- populate the token service URL returned to docker/notary client
Format: protocol://domain[:port]. Usually:
- if service exposed via
Ingress, thedomainshould be the value ofexpose.ingress.hosts.core - if service exposed via
ClusterIP, thedomainshould be the value ofexpose.clusterIP.name - if service exposed via
NodePort, thedomainshould be the IP address of one Kubernetes node - if service exposed via
LoadBalancer, set thedomainas your own domain name and add a CNAME record to map the domain name to the one you got from the cloud provider
If Harbor is deployed behind the proxy, set it as the URL of proxy.
Configure how to persist data
- Disable: The data does not survive the termination of a pod.
- Persistent Volume Claim(default): A default
StorageClassis needed in the Kubernetes cluster to dynamically provision the volumes. Specify another StorageClass in thestorageClassor setexistingClaimif you already have existing persistent volumes to use. - External Storage(only for images and charts): For images and charts, the external storages are supported:
azure,gcs,s3swiftandoss.
Configure the other items listed in configuration section
Install the chart
Install the Harbor helm chart with a release name my-release:
helm install my-release harbor/harbor
Uninstallation
To uninstall/delete the my-release deployment:
helm uninstall my-release
Configuration
The following table lists the configurable parameters of the Harbor chart and the default values.
| Parameter | Description | Default |
|---|---|---|
| Expose | ||
expose.type | How to expose the service: ingress, clusterIP, nodePort or loadBalancer, other values will be ignored and the creation of service will be skipped. | ingress |
expose.tls.enabled | Enable TLS or not. Delete the ssl-redirect annotations in expose.ingress.annotations when TLS is disabled and expose.type is ingress. Note: if the expose.type is ingress and TLS is disabled, the port must be included in the command when pulling/pushing images. Refer to https://github.com/goharbor/harbor/issues/5291 for details. | true |
expose.tls.certSource | The source of the TLS certificate. Set as auto, secret or none and fill the information in the corresponding section: 1) auto: generate the TLS certificate automatically 2) secret: read the TLS certificate from the specified secret. The TLS certificate can be generated manually or by cert manager 3) none: configure no TLS certificate for the ingress. If the default TLS certificate is configured in the ingress controller, choose this option | auto |
expose.tls.auto.commonName | The common name used to generate the certificate, it's necessary when the type isn't ingress | |
expose.tls.secret.secretName | The name of secret which contains keys named: tls.crt - the certificate; tls.key - the private key | |
expose.tls.secret.notarySecretName | The name of secret which contains keys named: tls.crt - the certificate; tls.key - the private key. Only needed when the expose.type is ingress | |
expose.ingress.hosts.core | The host of Harbor core service in ingress rule | core.harbor.domain |
expose.ingress.hosts.notary | The host of Harbor Notary service in ingress rule | notary.harbor.domain |
expose.ingress.controller | The ingress controller type. Currently supports default, gce and ncp | default |
expose.ingress.kubeVersionOverride | Allows the ability to override the kubernetes version used while templating the ingress | |
expose.ingress.annotations | The annotations used commonly for ingresses | |
expose.ingress.harbor.annotations | The annotations specific to harbor ingress | {} |
expose.ingress.harbor.labels | The labels specific to harbor ingress | {} |
expose.ingress.notary.annotations | The annotations specific to notary ingress | {} |
expose.ingress.notary.labels | The labels specific to notary ingress | {} |
expose.clusterIP.name | The name of ClusterIP service |
Deploy harbor with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has harbor on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartharbor is pinned at v1.9.3 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply