harbor 使用

Download harbor helm chart

helm repo add harbor https://helm.goharbor.io
helm fetch harbor/harbor --untar
kubectl create ns harbor

Update values.yaml

vi .harbor/values.yaml

And change:

expose:
  type: nodePort
tls:
  commonName: 'core.harbor.domain'

persistence: false

Install helm chart

helm install harbor ./harbor -n harbor

Wait for all pod being ready and access harbor portal

http://192.168.34.2:30002

admin/Harbor12345

Download repository certs from

https://192.168.34.2:30003/harbor/projects/1/repositories

Copy the downloaded ca.crt to vm docker certs configuration folder

mkdir /etc/docker/certs.d/core.harbor.domain
copy the ca.crt to this folder
systemctl restart docker

Edit /etc/hosts to map core.harbor.domain to harbor svc clusterip

# host 配置harbor svc的集群ip
10.104.231.99 core.harbor.domain

Docker login

docker login -u admin -p Harbor12345 core.harbor.domain

Docker tag a image to core.harbor.domain and push it and you will see it in harbor portal

Check repositories and blobs

kubectl exec -it harbor-registry-7d686859d7-xs5nv -n harbor bash
ls -la /storage/docker/registry/v2/repositories/
ls -la /storage/docker/registry/v2/blobs

Database operator

kubectl exec -it harbor-database-0 -n harbor -- bash
psql -U postgres -d postgres -h 127.0.0.1 -p 5432
\c registry
select * from harbor_user;
\dt

   转载规则


《harbor 使用》 by XieJiayi is licensed under a 知识共享署名 4.0 国际许可协议 许可协议。转载请注明来源
 上一篇
cronjob 使用 cronjob 使用
.spec.schedule 指定任务运行周期,格式同 Cron .spec.jobTemplate 指定需要运行的任务,格式同 Job .spec.startingDeadlineSeconds 指定任务开始的截止期限 .spec.co
2023-01-06
下一篇 
容器组pod 使用 容器组pod 使用
资源限制 spec.containers[].resources.limits.cpu : CPU 上限, 可以短暂超过, 容器也不会被停止 spec.containers[].resources.limits.memory : 内存上限,
2023-01-06
  目录