Skip to content

Latest commit

 

History

History
61 lines (42 loc) · 1.32 KB

harbor.md

File metadata and controls

61 lines (42 loc) · 1.32 KB

Overview

Harbor is an open source container image registry that secures artifacts with policies and role-based access control, ensures images are scanned and free from vulnerabilities, and signs images as trusted.

Prepare database

Create a postgres client pod on the Kubernetes cluster to login into the database.

export POSTGRES_HOST=postgres.local.naim.run
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=<passowrd>

kubectl run postgres-client --rm --tty -i \
	--image bitnami/postgresql \
	--env="PGPASSWORD=$POSTGRES_PASSWORD" \
	--command -- psql --host $POSTGRES_HOST -U $POSTGRES_USER

Create a postgres user with login privilege

CREATE ROLE harbor;
ALTER USER harbor ENCRYPTED PASSWORD '<password>'; # See path: harbor/secrets.enc.yaml
ALTER ROLE harbor with LOGIN;

List all user accounts (or roles)

\du

Create registry database and grant login privilege to harbor user

CREATE DATABASE registry;
\c registry
GRANT CONNECT ON DATABASE registry to harbor;
GRANT ALL ON SCHEMA public TO harbor WITH GRANT OPTION;

List all databases

\l

Secrets encryption using sops

sops -e harbor/secrets.default.yaml > harbor/secrets.enc.yaml

Harbor Installation

kubectl apply -f ../applications/harbor.yaml