[root@www.wulaoer.org ~]# helm repo add harbor https://helm.goharbor.io [root@www.wulaoer.org ~]# helm fetch harbor/harbor --untar [root@www.wulaoer.org ~]# ls harbor [root@www.wulaoer.org ~]# cd harbor/ [root@www.wulaoer.org harbor]# ls cert Chart.yaml conf LICENSE README.md templates values.yaml #创建harbor namespace [root@www.wulaoer.org harbor]# kubectl create ns harbor
下载了harbor的charts,但是这些都是默认的,我们需要根据自己的环境设置一下。
[root@www.wulaoer.org ~]# vim harbor/values.yaml ................................................ auto: # The common name used to generate the certificate, it's necessary # when the type isn't "ingress" commonName: "ops-harbor.wulaoer.org" #访问的域名 .................................................. ingress: hosts: core: ops-harbor.wulaoer.org notary: ops-core.wulaoer.org .................................................. externalURL: https://ops-harbor.wulaoer.org ....................................... persistence: enabled: true #不使用块存储 ...................................... # The initial password of Harbor admin. Change it from portal after launching Harbor harborAdminPassword: "www.wulaoer.org" #默认密码
这里的配置主要配置的是域名,存储这块暂时没有做,等下我们在做。看一下安装后的harbor的组件。
[root@www.wulaoer.org ~]# helm install harbor ./harbor -n harbor [root@www.wulaoer.org ~]# kubectl get pod -n harbor NAME READY STATUS RESTARTS AGE harbor-chartmuseum-5fb46c7c6d-tjkvr 1/1 Running 0 131m harbor-core-b899bcf4d-454fl 1/1 Running 1 131m harbor-database-0 1/1 Running 0 131m harbor-jobservice-96cd484c9-8bg25 1/1 Running 0 131m harbor-notary-server-f67cc647c-2nqgs 1/1 Running 3 131m harbor-notary-signer-b4c66c55-t2zsf 1/1 Running 3 131m harbor-portal-687bd5bc7-ts4qn 1/1 Running 0 131m harbor-redis-0 1/1 Running 0 131m harbor-registry-6576f65cd-cjq6f 2/2 Running 0 131m harbor-trivy-0 1/1 Running 0 131m
这里安装后,会自动给你把ingress解析好,解析后就是在文件中设置的域名,这里使用两个域名。注意,在使用之前一定要把域名的证书加到命名空间中,否则容易出现解析失败
[root@ali-bj-ops-h-jump ~]# kubectl get ingress -n harbor NAME CLASS HOSTS ADDRESS PORTS AGE harbor-ingress <none> ops-harbor.wulaoer.org 172.32.241.11 80, 443 97m harbor-ingress-notary <none> ops-core.wulaoer.org 172.32.241.11 80, 443 97m
域名解析后,需要做一下dns解析,如果自己测试没有dns就在本机的hosts文件中做本地解析即可,不管什么平台路径是一样的/etc/hosts
[root@www.wulaoer.org ~]# vim /etc/hosts 172.32.241.11 ops-harbor.wulaoer.org 172.32.241.11 ops-core.wulaoer.org
这里需要注意,在pvc harbor-registry 中存储的是镜像文件,所以如果用在生产环境中一定要注意挂载文件大小,避免后期资源不足。
[root@www.wulaoer.org ~]# kubectl get pvc -n harbor NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE data-harbor-redis-0 Bound pvc-5c610083-06e5-40b8-8dd8-9cfe296530a9 5Gi RWO rook-cephfs 101m data-harbor-trivy-0 Bound pvc-09c8ce05-dec2-40fe-853e-b47ecdb63bba 5Gi RWO rook-cephfs 102m database-data-harbor-database-0 Bound pvc-d724425d-8066-46ea-9ed6-2c0f667fdf23 5Gi RWO rook-cephfs 102m harbor-chartmuseum Bound pvc-a266fca7-5a7f-4ceb-85e8-7aca79283cca 5Gi RWO rook-cephfs 103m harbor-jobservice Bound pvc-09a86f9d-dae5-459b-a7f6-cb1c81c1939c 5Gi RWO rook-cephfs 103m harbor-registry Bound d-2ze9oab4dnjr8dyd32a9 500Gi RWO alicloud-disk-efficiency 66m
harbor就安装好了,下个文章看一下harbor如何使用,没有了,看看其他的吧。。。。。。
您可以选择一种方式赞助本站
支付宝扫一扫赞助
微信钱包扫描赞助
赏