在k8s集群中使用helm安裝harbor

2021-09-27 01:50:18 字數 3286 閱讀 1649

使用helm安裝harbor需要準備如下:

1、安裝helm

2、安裝provisioner

3、安裝traefik

使用helm安裝harbor

$ git clone

開啟看一下分支

$ cd harbor-helm

$ git checkout 1.1.0 #進入1.1.0分支

$ ls

cert contributing.md readme.md templates

chart.yaml docs license values.yaml

準備乙個配置檔案用來覆蓋values.yaml內的值,原配置檔案values.yaml要保留

$ vim harbor-values.yaml

expose:

type: ingress

tls:

enabled: true

ingress:

hosts:

core: registry.example.com

notary: notary.example.com

annotations:

kubernetes.io/ingress.class: "traefik"

ingress.kubernetes.io/ssl-redirect: "true"

ingress.kubernetes.io/proxy-body-size: "0"

externalurl:

persistence:

enabled: true

resourcepolicy: "keep"

persistentvolumeclaim:

registry:

storageclass: "harbor-data"

chartmuseum:

storageclass: "harbor-data"

jobservice:

storageclass: "harbor-data"

database:

storageclass: "harbor-data"

redis:

storageclass: "harbor-data"

準備儲存類

$ vim harbor-sc.yaml

apiversion: storage.k8s.io/v1

kind: storageclass

metadata:

name: harbor-data

provisioner: fuseim.pri/ifs

安裝harbor

$ helm install --name harbor -f harbor-values.yaml . --namespace kube-ops

$ kubectl get pod -n kube-ops |grep harbor

harbor-harbor-chartmuseum-67669f98f-twctk 1/1 running 0 24

hharbor-harbor-clair-5bd8f76d9c-xrzks 1/1 running 73 24

hharbor-harbor-core-86d9c7c448-qdp68 1/1 running 2 66

mharbor-harbor-database-0 1/1 running 0 24

hharbor-harbor-jobservice-79f7fccb97-t4bhw 1/1 running 4 67

mharbor-harbor-notary-server-56db4cc64d-c2mck 1/1 running 67 24

hharbor-harbor-notary-signer-67d4df59fd-z8v4z 1/1 running 67 24

hharbor-harbor-portal-64cff84747-lpngl 1/1 running 0 24

hharbor-harbor-redis-0 1/1 running 0 67

mharbor-harbor-registry-5b774574b7-qwqs8 2/2 running 0 24

$ kubectl get ingress -n kube-ops |grep harbor

harbor-harbor-ingress registry.example.com,notary.example.com 80

, 443 24h

在客戶端模擬dns

$ vim /etc/hosts

192.168.1.243 registry.example.com registry

192.168.1.243 notary.example.com notary

在客戶端用瀏覽器開啟:

預設使用者名稱是admin

預設密碼是harbor12345,在values.yaml內

$ cat values.yaml

harboradminpassword: 「harbor12345」

預設情況下會有乙個名叫library的專案,該專案預設是公開訪問許可權的

projects----library----配置----自動掃瞄上傳的映象

在客戶端使用命令列登入harbor:

$ vim /etc/docker/daemon.json

$ systemctl restart docker

$ docker login registry.example.com

測試$ docker pull busybox

解除安裝harbor

$ helm del --purge harbor

$ kubectl delete pvc harbor-harbor-chartmuseum -n kube-ops

$ kubectl delete pvc harbor-harbor-jobservice -n kube-ops

$ kubectl delete pvc harbor-harbor-registry -n kube-ops

K8S 集群安裝

1 作業系統 centos 7.4 2 主機資訊 k8smaster主機 kb master 001 192.168 0.11 kb master 002 192.168 0.12 kb master 003 192.168 0.13 k8snode主機 kb node 001 192.168 0....

K8S集群安裝

node設定 部署k8s的dashboard 本文記錄在centoos7上安裝k8s集群。環境配置 master 10.192.33.249 node1 10.192.33.248 兩台機器均已安裝docker18.06,沒有配置docker的registry,且都已經配置為自啟動 timedate...

k8s集群部署 docker部署k8s安裝篇

1 安裝docker 緊接著配置乙個穩定 stable 的倉庫 倉庫配置會儲存到 etc yum.repos.d docker ce.repo檔案中 yum config manager add repo 更新yum安裝的相關docke軟體包 安裝docker ce yum update y yum...