This tutorial will guides you to have a quick first try of the Harbor operator and the Harbor cluster deployed and managed by the operator.
If you want to learn the overall design of the Harbor operator before starting the quick try, check the design doc.
Check the prerequisites and install the Harbor operator base on your needs by following the installation guide.
Before moving on, make sure the harbor operator is successfully deployed in the Kubenetes cluster.
~/harbor-operator$ kubectl get all -n harbor-operator-ns
NAME READY STATUS RESTARTS AGE
pod/harbor-operator-6fd4dc66b-sh6cc 1/1 Running 0 3h18m
pod/minio-operator-667b56db9c-q6v4j 1/1 Running 0 3h18m
pod/postgres-operator-749db5dd66-phw98 1/1 Running 0 3h18m
pod/redisoperator-64dc645c84-9jlv6 1/1 Running 0 3h18m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/operator ClusterIP 10.96.202.139 <none> 4222/TCP,4233/TCP 3h18m
service/postgres-operator ClusterIP 10.96.193.93 <none> 8080/TCP 3h18m
service/webhook-service ClusterIP 10.96.251.203 <none> 443/TCP 3h18m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/harbor-operator 1/1 1 1 3h18m
deployment.apps/minio-operator 1/1 1 1 3h18m
deployment.apps/postgres-operator 1/1 1 1 3h18m
deployment.apps/redisoperator 1/1 1 1 3h18m
NAME DESIRED CURRENT READY AGE
replicaset.apps/harbor-operator-6fd4dc66b 1 1 1 3h18m
replicaset.apps/minio-operator-667b56db9c 1 1 1 3h18m
replicaset.apps/postgres-operator-749db5dd66 1 1 1 3h18m
replicaset.apps/redisoperator-64dc645c84 1 1 1 3h18m
To deploy a Harbor cluster, you need to prepare a deployment manifest first. For creating the deployment manifest, you can clone one from the sample manifests listed in the manifests/samples folder and do any modifications based on your needs, or create from scratch by following the CRD spec.
Learn more about the sample manifests, you can check manifests reference.
NOTES: to allow the deployed Harbor cluster to be accessible outside the Kubenetes cluster, make sure the ingress hosts and host in the
externalURL
should be mapping with accessible IPs in the /etc/hosts (for local development environments) or can be resolved and accessible by DNS resolver. TIPS: for local development, some plan-domain services likesub-domain.<IP>.nip.io
can be used to provide simple public accessible hosts.
Here we clone the full stack sample manifest as an example and modify the external host and ingress hosts with sub-domain.<IP>.nip.io
pattern. Modified content is shown as below. Please pay attention here, the 'namespace', 'admin core secret', 'minio access secret' and 'cert-manager issuer/certificate/key' are pre-defined resources and bound to the deploying Harbor cluster.
my_full_stack.yaml
:
# Sample namespace
apiVersion: v1
kind: Namespace
metadata:
name: cluster-sample-ns
---
# A secret of harbor admin password.
apiVersion: v1
kind: Secret
metadata:
name: admin-core-secret
namespace: cluster-sample-ns
data:
secret: SGFyYm9yMTIzNDU=
type: Opaque
---
# A secret for minIO access.
apiVersion: v1
kind: Secret
metadata:
name: minio-access-secret
namespace: cluster-sample-ns
data:
accesskey: YWRtaW4=
secretkey: bWluaW8xMjM=
type: Opaque
---
apiVersion: v1
kind: Secret
metadata:
name: harbor-test-ca
namespace: cluster-sample-ns
data:
tls.crt: LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSUZpekNDQTNPZ0F3SUJBZ0lVU2Fva1FldWczaGJHQVF3U1BqaklsMmV1akl3d0RRWUpLb1pJaHZjTkFRRUwKQlFBd1ZERUxNQWtHQTFVRUJoTUNRMDR4RERBS0JnTlZCQWdNQTFCRlN6RVJNQThHQTFVRUJ3d0lRbVZwSUVwcApibWN4RVRBUEJnTlZCQW9NQ0dkdmFHRnlZbTl5TVJFd0R3WURWUVFEREFoSVlYSmliM0pEUVRBZ0Z3MHlNREE0Ck1USXhNRFV5TkROYUdBOHlNVEl3TURjeE9URXdOVEkwTTFvd1ZERUxNQWtHQTFVRUJoTUNRMDR4RERBS0JnTlYKQkFnTUExQkZTekVSTUE4R0ExVUVCd3dJUW1WcElFcHBibWN4RVRBUEJnTlZCQW9NQ0dkdmFHRnlZbTl5TVJFdwpEd1lEVlFRRERBaElZWEppYjNKRFFUQ0NBaUl3RFFZSktvWklodmNOQVFFQkJRQURnZ0lQQURDQ0Fnb0NnZ0lCCkFPWlJaWWtGbVZCTmFiRVU0Y0RhcWEyN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jZqQVFqY0RxVzdxQ3I0SHRFTXJBNjJGWT0KLS0tLS1FTkQgUFJJVkFURSBLRVktLS0tLQo=
---
# Cert issuer
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: selfsigned-issuer
namespace: cluster-sample-ns
spec:
ca:
secretName: harbor-test-ca
---
# Certificates of ingress
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: sample-public-certificate
namespace: cluster-sample-ns
spec:
secretName: sample-public-certificate
dnsNames:
- core.10.10.10.100.nip.io
- notary.10.10.10.100.nip.io
- minio.10.10.10.100.nip.io
issuerRef:
name: selfsigned-issuer
kind: Issuer
---
# Full stack Harbor
apiVersion: goharbor.io/v1beta1
kind: HarborCluster
metadata:
name: harborcluster-sample
namespace: cluster-sample-ns
spec:
version: 2.3.0
logLevel: info
network:
ipFamilies:
- IPv4
- IPv6
imageSource:
repository: ghcr.io/goharbor
harborAdminPasswordRef: admin-core-secret
externalURL: https://core.10.10.10.100.nip.io
expose:
core:
ingress:
host: core.10.10.10.100.nip.io
controller: default
tls:
certificateRef: sample-public-certificate
notary:
ingress:
host: notary.10.10.10.100.nip.io
controller: default
tls:
certificateRef: sample-public-certificate
internalTLS:
enabled: true
portal: {}
registry:
metrics:
enabled: true
core:
tokenIssuer:
name: selfsigned-issuer
kind: Issuer
metrics:
enabled: true
chartmuseum: {}
exporter: {}
trivy:
skipUpdate: false
storage: {}
notary:
migrationEnabled: true
database:
kind: Zlando/PostgreSQL
spec:
zlandoPostgreSql:
operatorVersion: "1.5.0"
storage: 1Gi
replicas: 1
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 250Mi
storage:
kind: MinIO
spec:
minIO:
operatorVersion: "4.0.6"
replicas: 2
secretRef: minio-access-secret
redirect:
enable: true
expose:
ingress:
host: minio.10.10.10.100.nip.io
tls:
certificateRef: sample-public-certificate
volumesPerServer: 2
volumeClaimTemplate:
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 10Gi
cache:
kind: RedisFailover
spec:
redisFailover:
operatorVersion: "1.0.0"
server:
replicas: 1
resources:
limits:
cpu: 500m
memory: 500Mi
requests:
cpu: 100m
memory: 250Mi
sentinel:
replicas: 1
Notes: for using the
inClusterStorage
withredirect
isenable(=true)
, make sure the ingress route set in theredirect.expose.ingress.host
field can be accessed from both inside and outside the cluster.
Apply the above modified deployment manifest to your cluster.
kubectl create -f my_full_stack.yaml
Check the overall status of the deployed Harbor cluster.
kubectl get harborcluster/harborcluster-sample -n cluster-sample-ns -o wide
The name
, public URL
, status
, operator version
and operator commit
info are printed out:
NAME PUBLIC URL STATUS OPERATOR VERSION OPERATOR GIT COMMIT
harborcluster-sample https://core.10.10.10.100.xip.io healthy 1.1.1 20072ed0511e59778f5325416314e41af8d76087
You can check more detailed status(conditions) info of the deployed Harbor cluster with appending -o yaml
.
kubectl get harborcluster/harborcluster-sample -n cluster-sample-ns -o yaml
Some status info like the following data is printed out:
status:
conditions:
- lastTransitionTime: "2021-09-28T07:40:45Z"
status: "True"
type: StorageReady
- lastTransitionTime: "2021-09-28T07:40:45Z"
message: Harbor component database secrets are already create
reason: Database is ready
status: "True"
type: DatabaseReady
- lastTransitionTime: "2021-09-28T07:23:55Z"
message: harbor component redis secrets are already create.
reason: redis already ready
status: "True"
type: CacheReady
- lastTransitionTime: "2021-09-28T07:40:34Z"
status: "False"
type: InProgress
- lastTransitionTime: "2021-09-28T10:20:14Z"
status: "True"
type: ServiceReady
- status: "False"
type: Failed
You can also check what Kubernetes resources are created by getting all.
kubectl get all -n cluster-sample-ns
A few of resources info like the following data are output:
NAME READY STATUS RESTARTS AGEpod/harborcluster-sample-harbor-harbor-chartmuseum-5fcd966f47-6c2vb 1/1 Running 0 3h1m
pod/harborcluster-sample-harbor-harbor-core-74bb457c94-wmsjr 1/1 Running 0 3h1m
pod/harborcluster-sample-harbor-harbor-exporter-5dfb5c6f4-kbmtf 1/1 Running 0 3h17m
pod/harborcluster-sample-harbor-harbor-jobservice-58c8946c6c-bwg84 1/1 Running 0 3h17m
pod/harborcluster-sample-harbor-harbor-notaryserver-7dc7dc5f8dfnqkj 1/1 Running 0 3h1m
pod/harborcluster-sample-harbor-harbor-notarysigner-85459fbbb5rxsk5 1/1 Running 0 3h17m
pod/harborcluster-sample-harbor-harbor-portal-844cf56674-4c657 1/1 Running 0 3h17m
pod/harborcluster-sample-harbor-harbor-registry-89487bb8c-gkfn6 1/1 Running 0 21m
pod/harborcluster-sample-harbor-harbor-registryctl-7db9744d44-xl76b 1/1 Running 0 3h17m
pod/harborcluster-sample-harbor-harbor-trivy-5c795b8c77-ksdhk 1/1 Running 0 3h17m
pod/minio-harborcluster-sample-gn4qb 0/1 Completed 0 3h1m
pod/minio-harborcluster-sample-zone-harbor-0 1/1 Running 0 3h
pod/minio-harborcluster-sample-zone-harbor-1 1/1 Running 0 3h1m
pod/postgresql-cluster-sample-ns-harborcluster-sample-0 1/1 Running 0 3h18m
pod/rfr-harborcluster-sample-redis-0 1/1 Running 0 3h18m
pod/rfs-harborcluster-sample-redis-6fddf664-c7vj7 1/1 Running 0 3h18m
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/harborcluster-sample-harbor-harbor-chartmuseum ClusterIP 10.96.180.44 <none> 443/TCP 3h17m
service/harborcluster-sample-harbor-harbor-core ClusterIP 10.96.147.11 <none> 443/TCP,8001/TCP 3h17m
service/harborcluster-sample-harbor-harbor-exporter ClusterIP 10.96.242.24 <none> 8001/TCP 3h17m
service/harborcluster-sample-harbor-harbor-jobservice ClusterIP 10.96.90.187 <none> 443/TCP 3h17m
service/harborcluster-sample-harbor-harbor-notaryserver ClusterIP 10.96.18.168 <none> 443/TCP 3h17m
service/harborcluster-sample-harbor-harbor-notarysigner ClusterIP 10.96.242.45 <none> 7899/TCP 3h17m
service/harborcluster-sample-harbor-harbor-portal ClusterIP 10.96.54.68 <none> 443/TCP 3h17m
service/harborcluster-sample-harbor-harbor-registry ClusterIP 10.96.249.140 <none> 443/TCP,8001/TCP 3h17m
service/harborcluster-sample-harbor-harbor-registryctl ClusterIP 10.96.44.32 <none> 443/TCP 3h17m
service/harborcluster-sample-harbor-harbor-trivy ClusterIP 10.96.231.198 <none> 443/TCP 3h17m
service/minio ClusterIP 10.96.74.160 <none> 80/TCP 3h17m
service/minio-harborcluster-sample-hl ClusterIP None <none> 9000/TCP 3h17m
service/postgresql-cluster-sample-ns-harborcluster-sample ClusterIP 10.96.75.26 <none> 5432/TCP 3h18m
service/postgresql-cluster-sample-ns-harborcluster-sample-config ClusterIP None <none> <none> 3h17m
service/postgresql-cluster-sample-ns-harborcluster-sample-repl ClusterIP 10.96.135.172 <none> 5432/TCP 3h18m
service/rfs-harborcluster-sample-redis ClusterIP 10.96.217.247 <none> 26379/TCP 3h18m
NAME READY UP-TO-DATE AVAILABLE AGE
deployment.apps/harborcluster-sample-harbor-harbor-chartmuseum 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-core 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-exporter 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-jobservice 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-notaryserver 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-notarysigner 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-portal 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-registry 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-registryctl 1/1 1 1 3h17m
deployment.apps/harborcluster-sample-harbor-harbor-trivy 1/1 1 1 3h17m
deployment.apps/rfs-harborcluster-sample-redis 1/1 1 1 3h18m
NAME DESIRED CURRENT READY AGE
replicaset.apps/harborcluster-sample-harbor-harbor-chartmuseum-5fcd966f47 1 1 1 3h1m
replicaset.apps/harborcluster-sample-harbor-harbor-core-74bb457c94 1 1 1 3h1m
replicaset.apps/harborcluster-sample-harbor-harbor-exporter-5dfb5c6f4 1 1 1 3h17m
replicaset.apps/harborcluster-sample-harbor-harbor-jobservice-58c8946c6c 1 1 1 3h17m
replicaset.apps/harborcluster-sample-harbor-harbor-notaryserver-7dc7dc5f8d 1 1 1 3h1m
replicaset.apps/harborcluster-sample-harbor-harbor-notarysigner-85459fbbb5 1 1 1 3h17m
replicaset.apps/harborcluster-sample-harbor-harbor-portal-844cf56674 1 1 1 3h17m
replicaset.apps/harborcluster-sample-harbor-harbor-registry-89487bb8c 1 1 1 3h1m
replicaset.apps/harborcluster-sample-harbor-harbor-registryctl-7db9744d44 1 1 1 3h17m
replicaset.apps/harborcluster-sample-harbor-harbor-trivy-5c795b8c77 1 1 1 3h17m
replicaset.apps/rfs-harborcluster-sample-redis-6fddf664 1 1 1 3h18m
NAME READY AGE
statefulset.apps/minio-harborcluster-sample-zone-harbor 2/2 3h17m
statefulset.apps/postgresql-cluster-sample-ns-harborcluster-sample 1/1 3h18m
statefulset.apps/rfr-harborcluster-sample-redis 1/1 3h18m
NAME COMPLETIONS DURATION AGE
job.batch/minio-harborcluster-sample 1/1 11s 3h1m
NAME AGE
redisfailover.databases.spotahome.com/harborcluster-sample-redis 3h18m
Of course, you can also check other resources such as ingress
, secret
, pv
, certificate
and configMap
etc. under the specified namespace with kubectl get xxxx -n cluster-sample-ns
commands.
Now you can try the deployed Harbor cluster.
-
Navigate to the Harbor home address
https://core.10.10.10.100.xip.io
and login Harbor with the root useradmin
and the password you provided in the deployment manifest above.In case you forgot the password, try to get it with the command:
kubectl get secret \ "$(kubectl get harborcluster harborcluster-sample -n cluster-sample-ns -o jsonpath='{.spec.harborAdminPasswordRef}')" \ -n cluster-sample-ns \ -o jsonpath='{.data.secret}' \ | base64 --decode
-
Navigate to the
Projects
list page and clickNEW PROJECT
button to create a new project namedmy-harbor
. -
Open the
Registries
management view that is underAdministration
part and click theNEW ENDPOINT
button to open theNew Registry Endpoint
dialog. -
Select
Docker Hub
as theProvider
and inputmyhub
as the name of this creating endpoint. Test the connection by clickingTEST CONNECTION
at the bottom and then clickOK
button to create it after connection health is confirmed. -
Open the
Replications
management view that is underAdministration
part and clickNEW REPLICATION RULE
button to open theNew Replication Rule
dialog. -
Input
my-first-rule
as the name of the creating replication rule. SelectPull-based
radio to switch to pull mode. For theSource resource filter
section, inputgoharbor/harbor-core
in theName
field and**
in theTag
field. -
Select
myhub-https://hub.docker.com
as theSource registry
. -
Input
my-harbor
in theDestination namespace
. -
Keep
Manual
in theTrigger mode
. -
Click
SAVE
to persist the replication rule. -
Select the replication rule
my-first-rule
in the list and click theREPLICATION
button to start execute the replication process defined by the selected rule. -
Check the overall status from the created execution with ID
1
after the replication process is started. -
Navigate back to the project
my-harbor
and you'll see the related artifacts have been already put under the project once the replication process is successfully completed.
For fully using the deployed Harbor cluster, you have to get the certificate authority used to generate the public certificate and install it on your computer (on the system scope, docker daemon + browser).
kubectl get secret sample-public-certificate -n cluster-sample-ns \
-o jsonpath='{.data.ca\.crt}' \
| base64 --decode
Of course, you can try other operations of Harbor like scanning etc.