sikalabs-harbor-master-snapshot

by SikaLabs

Helm chartv2023.6.20App devApache-2.0

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:

  1. populate the docker/helm commands showed on portal
  2. populate the token service URL returned to docker client

Format: protocol://domain[:port]. Usually:

  • if service exposed via Ingress, the domain should be the value of expose.ingress.hosts.core
  • if service exposed via ClusterIP, the domain should be the value of expose.clusterIP.name
  • if service exposed via NodePort, the domain should be the IP address of one Kubernetes node
  • if service exposed via LoadBalancer, set the domain as 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 StorageClass is needed in the Kubernetes cluster to dynamically provision the volumes. Specify another StorageClass in the storageClass or set existingClaim if 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, s3 swift and oss.

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.

ParameterDescriptionDefault
Expose
expose.typeHow 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.enabledEnable 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.certSourceThe 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 optionauto
expose.tls.auto.commonNameThe common name used to generate the certificate, it's necessary when the type isn't ingress
expose.tls.secret.secretNameThe name of secret which contains keys named: tls.crt - the certificate; tls.key - the private key
expose.ingress.hosts.coreThe host of Harbor core service in ingress rulecore.harbor.domain
expose.ingress.controllerThe ingress controller type. Currently supports default, gce, alb, f5-bigip and ncpdefault
expose.ingress.kubeVersionOverrideAllows the ability to override the kubernetes version used while templating the ingress
expose.ingress.annotationsThe annotations used commonly for ingresses
expose.ingress.harbor.annotationsThe annotations specific to harbor ingress{}
expose.ingress.harbor.labelsThe labels specific to harbor ingress{}
expose.clusterIP.nameThe name of ClusterIP serviceharbor
expose.clusterIP.annotationsThe annotations attached to the ClusterIP service{}
expose.clusterIP.ports.httpPortThe service port Harbor listens on when serving HTTP80
expose.clusterIP.ports.httpsPortThe service port Harbor listens on when serving HTTPS443
expose.nodePort.nameThe name of NodePort service

Deploy sikalabs-harbor-master-snapshot with OpenTenant

Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has sikalabs-harbor-master-snapshot 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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartsikalabs-harbor-master-snapshot is pinned at v2023.6.20 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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