您好,登錄后才能下訂單哦!
這篇文章給大家分享的是有關helm3如何安裝harbor的內容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。
1、下載并修改
helm repo add harbor https://helm.goharbor.io
helm pull harbor/harbor --version 1.2.3
修改values.yaml文件
2、安裝
helm install harbor ./harbor Error: unable to build kubernetes objects from release manifest: unable to recognize "": no matches for kind "Deployment" in version "extensions/v1beta1"
由于我是最新版的k8s集群,所以不支持version "extensions/v1beta1",下面修改版本為apps
grep -irl "extensions/v1beta1" harbor | grep deployment
grep -irl "extensions/v1beta1" harbor | grep deploy | xargs sed -i 's#extensions/v1beta1#apps/v1#g'
再次執行安裝
服務需要請求pv,所以這里我們使用hostPath來創建pv
apiVersion: v1 kind: PersistentVolume metadata: name: harbor-pv1 spec: capacity: storage: 10Gi volumeMode: Filesystem accessModes: - ReadWriteOnce persistentVolumeReclaimPolicy: Retain hostPath: path: /helm/harbor/pv1
3、訪問web界面
使用用戶密碼登錄胡發現登錄不了。我們查看pod日志會發現
kubectl logs harbor-harbor-registry-6f7765fd94-kxt74 Error from server (BadRequest): a container name must be specified for pod harbor-harbor-registry-6f7765fd94-kxt74, choose one of: [registry registryctl]
由于容器中名字重復,修改為一致即可。
kubectl logs harbor-harbor-redis-0 1:M 18 Dec 02:00:08.032 * 10 changes in 300 seconds. Saving... 1:M 18 Dec 02:00:08.033 * Background saving started by pid 97 97:C 18 Dec 02:00:08.033 # Failed opening the RDB file dump.rdb (in server root dir /var/lib/redis) for saving: Permission denied 1:M 18 Dec 02:00:08.133 # Background saving error
由于redis請求的pv權限不夠
kubectl get pvc #查看綁定的pv是主機的路徑,然后給與777的權限即可
chmod 777 /helm/harbor/pv4/
kubectl logs harbor-harbor-clair-c9757f6cb-9x8nr {"Event":"could not download Oracle's update list","Level":"error","Location":"oracle.go:162","Time":"2019-12-18 01:54:54.608195","error":"Get https://linux.oracle.com/oval/com.oracle.elsa- 20161292.xml: read tcp 10.244.2.34:35278-\u003e23.63.35.142:443: read: connection reset by peer"} {"Event":"an error occured when fetching update","Level":"error","Location":"updater.go:246","Time":"2019-12-18 01:54:54.609261","error":"could not download requested resource","updater name":"oracle"}
將pod刪除,自動生成即可
再次根據設置的密碼登錄,我這里是admin/admin12345
感謝各位的閱讀!關于“helm3如何安裝harbor”這篇文章就分享到這里了,希望以上內容可以對大家有一定的幫助,讓大家可以學到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。