Installation
To proceed with the installation of Harbor on our platform as with other tools we first need to clone the Harbor repository, so we can see the values we want to use in our deployment.
Repo
https://github.com/goharbor/harbor-helm.git
We make
git clone https://github.com/goharbor/harbor-helm.git
Let's go to the newly cloned directory.
cd harbor-helm
And we will proceed to copy or modify the values.yaml. In the values.yaml we must have the following parameters.
expose:
type: ingress
tls:
enabled: true
secret:
secretName: "SECRET_CERT"
certSource: secret
ingress:
hosts:
core: "harbor.yourdomain.com"
# Set the ingressClassName on the ingress record
className: "appsec-nginx"
annotations:
k8s.io/appsec-nginx: appsec-nginx
nginx.ingress.kubernetes.io/proxy-body-size: "0"
trivy:
enabled: true
notary:
enabled: false
externalURL: "https://harbor.yourdomain.com"
harborAdminPassword: admin
persistence:
persistentVolumeClaim:
registry:
size: 20Gi
and then proceed to the installation with the helm
helm repo add harbor https://helm.goharbor.io
helm upgrade --install -n harbor harbor -f values.yaml harbor/harbor --create-namespace
From the previous command we can note the following details:
- You use 'helm upgrade --install' because if it does not exist, install it and if it does exist, upgrade it.
- Use '--create-namespace' to create the namespace in Kuberentes if it is not already created.
- We use '-n harbor' to indicate the namespace where we want to install our application.
warning
The helm has a bug and you have to edit the harbor ingress and add ingressClassName: appsec-nginx under spec for the ingress to get IP