This setup provide a Harbor registry with an external postgresql database.
Harbor is an open source trusted cloud native registry project that stores, signs, and scans content. You can use Harbor to store and distribute Docker images, Helm Charts, CNAB bundles, OPAs, and other OCI artifacts.
Disclaimer: In this setup, we will use cert-manager to generate a certificate for the domain name.
- A kubernetes cluster
- Helm
- A domain name pointing to the cluster
- Add necessary helm repositories
helm repo add bitnami https://charts.bitnami.com/bitnami
helm repo add harbor https://helm.goharbor.io- Create a
psql-values.yamlfile for the postgresql database with the following content:
auth:
username: harbor
password: STRONG_PASSWORD
postgresPassword: STRONG_PASSWORD # This value must be the same as the password
database: registry- Install the postgresql database
helm upgrade --install db bitnami/postgresql --values psql-values.yaml --create-namespace --namespace harbor- Create a
values.yamlfile with the following content:
expose:
tls:
enabled: true
certSource: secret
secret:
secretName: "harbor-registry-tls"
ingress:
hosts:
core: YOUR_DOMAIN_NAME
annotations:
cert-manager.io/cluster-issuer: "letsencrypt-prod"
externalURL: https://YOUR_DOMAIN_NAME
database:
type: external
external:
host: "db-postgresql"
username: "postgres"
coreDatabase: "registry"
existingSecret: "db-postgresql"- Install the harbor registry
helm upgrade --install harbor-registry harbor/harbor --values values.yaml --namespace harbor --create-namespace- Now you can access the harbor registry at
https://YOUR_DOMAIN_NAMEwith the default usernameadminand passwordHarbor12345. - It's recommended to change the default password after the first login and create users for personal use and not use the admin account.
- You can also login to the registry using the
docker login YOUR_DOMAIN_NAMEcommand.