您好,登錄后才能下訂單哦!
今天就跟大家聊聊有關harbor在kubernetes helm是怎樣安裝使用的,可能很多人都不太了解,為了讓大家更加了解,小編給大家總結了以下內容,希望大家根據這篇文章可以有所收獲。
環境:kubernetes 1.18+,helm3
添加Harbor的Helm repository
helm repo add harbor https://helm.goharbor.io helm repo update
創建namespace
kubectl create namespace harbor-system
創建harbor-overrides.yaml。導出類型修改為clusterIP,后面會用traefik導出外網并自動管理證書,pvc根據實際情況修改。存儲方案參考我的 https://my.oschina.net/u/160697/blog/4422610
externalURL: https://registry.your_domain.com:31000 expose: type: clusterIP tls: auto: commonName: harbor persistence: persistentVolumeClaim: registry: storageClass: rook-cephfs accessMode: ReadWriteMany size: 1024Gi chartmuseum: storageClass: rook-cephfs accessMode: ReadWriteMany jobservice: storageClass: rook-cephfs accessMode: ReadWriteMany database: storageClass: rook-cephfs accessMode: ReadWriteMany redis: storageClass: rook-cephfs accessMode: ReadWriteMany trivy: storageClass: rook-cephfs accessMode: ReadWriteMany
安裝,要拉鏡像,啟動10多個容器需要多等,也可以刪除pod嘗試
helm install -f harbor-overrides.yaml --namespace harbor-system harbor harbor/harbor
升級
helm upgrade -f harbor-overrides.yaml --namespace harbor-system harbor harbor/harbor
卸載
helm uninstall harbor -n harbor-system # 下面這個刪除命名空間,會把存儲一起刪除 # kubectl delete ns harbor-system
導出traefik。參考 https://my.oschina.net/u/160697/blog/4437939
kind: Ingress apiVersion: networking.k8s.io/v1beta1 metadata: name: harbor-ingress namespace: harbor-system annotations: traefik.ingress.kubernetes.io/router.tls: "true" traefik.ingress.kubernetes.io/router.entrypoints: websecure traefik.ingress.kubernetes.io/router.tls.certresolver: aliyun traefik.ingress.kubernetes.io/router.tls.domains.0.main: registry.your_domain.com spec: rules: - host: registry.your_domain.com http: paths: - path: / pathType: ImplementationSpecific backend: serviceName: harbor-harbor-portal servicePort: 80 - path: /api/ pathType: ImplementationSpecific backend: serviceName: harbor-harbor-core servicePort: 80 - path: /service/ pathType: ImplementationSpecific backend: serviceName: harbor-harbor-core servicePort: 80 - path: /v2/ pathType: ImplementationSpecific backend: serviceName: harbor-harbor-core servicePort: 80 - path: /chartrepo/ pathType: ImplementationSpecific backend: serviceName: harbor-harbor-core servicePort: 80 - path: /c/ pathType: ImplementationSpecific backend: serviceName: harbor-harbor-core servicePort: 80
登錄https://registry.your_domain.com:31000。默認帳號密碼是admin/Harbor12345。單獨創建一個使用的帳號密碼,具體就不寫了。
docker中使用。輸入docker login后輸入帳號密碼。然后就可以docker tag。在docker push就ok
#輸入帳號密碼 sudo docker login
看完上述內容,你們對harbor在kubernetes helm是怎樣安裝使用的有進一步的了解嗎?如果還想了解更多知識或者相關內容,請關注億速云行業資訊頻道,感謝大家的支持。
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。