下載harbor github最新版

wget https://github.com/goharbor/harbor/releases/download/v2.5.6/harbor-offline-installer-v2.5.6.tgz
tar zxvf harbor-offline-installer-v2.5.6.tgz
cd harbor
cp harbor.yml.tmpl harbor.yml
 
修改完配置後執行部署文件
./prepare
harbor 安裝的時候默認沒有helm charts的倉庫
docker-compose stop
./install.sh --with-chartmuseum
[Step 0]: checking if docker is installed ...
Note: docker version: 20.10.7
[Step 1]: checking docker-compose is installed ...
Note: docker-compose version: 1.27.4
 
[Step 2]: loading Harbor images ...
f9848e7e8e92: Loading layer [==================================================>] 5.758MB/5.758MB
eeef8189f3c8: Loading layer [==================================================>] 8.733MB/8.733MB
33c07edbb23d: Loading layer [==================================================>] 15.88MB/15.88MB
65964ae42f88: Loading layer [==================================================>] 29.29MB/29.29MB
a1c1e8ae0dc0: Loading layer [==================================================>] 22.02kB/22.02kB
f7eb512540ff: Loading layer [==================================================>] 15.88MB/15.88MB
Loaded image: goharbor/notary-server-photon:v2.5.6
Loaded image: goharbor/prepare:v2.5.6
37ed4d016fd5: Loading layer [==================================================>] 5.763MB/5.763MB
d6b9d121ca6d: Loading layer [==================================================>] 90.89MB/90.89MB
b643af2be176: Loading layer [==================================================>] 3.072kB/3.072kB
07b94cbf04b4: Loading layer [==================================================>] 4.096kB/4.096kB
66f3acc7a78b: Loading layer [==================================================>] 91.68MB/91.68MB
Loaded image: goharbor/chartmuseum-photon:v2.5.6
Loaded image: goharbor/harbor-jobservice:v2.5.6
b134753bfa42: Loading layer [==================================================>] 8.906MB/8.906MB
3fb4ce28c92b: Loading layer [==================================================>] 21.61MB/21.61MB
b020504e6bb1: Loading layer [==================================================>] 4.608kB/4.608kB
9387532f1281: Loading layer [==================================================>] 22.4MB/22.4MB
Loaded image: goharbor/harbor-exporter:v2.5.6
Loaded image: goharbor/redis-photon:v2.5.6
Loaded image: goharbor/registry-photon:v2.5.6
d2f0c30820ec: Loading layer [==================================================>] 6.291MB/6.291MB
f6c81343bee2: Loading layer [==================================================>] 4.096kB/4.096kB
589d1d7c7759: Loading layer [==================================================>] 3.072kB/3.072kB
053d6c45fa45: Loading layer [==================================================>] 185.6MB/185.6MB
eaced69aa7b6: Loading layer [==================================================>] 13.37MB/13.37MB
2bcbabc9be53: Loading layer [==================================================>] 199.7MB/199.7MB
Loaded image: goharbor/trivy-adapter-photon:v2.5.6
Loaded image: goharbor/harbor-portal:v2.5.6
Loaded image: goharbor/harbor-core:v2.5.6
Loaded image: goharbor/harbor-log:v2.5.6
Loaded image: goharbor/harbor-db:v2.5.6
Loaded image: goharbor/harbor-registryctl:v2.5.6
Loaded image: goharbor/nginx-photon:v2.5.6
1d42a30dc7c0: Loading layer [==================================================>] 5.758MB/5.758MB
93780bd8bab8: Loading layer [==================================================>] 8.733MB/8.733MB
5d3cb83f2a2f: Loading layer [==================================================>] 14.47MB/14.47MB
bfd317c15997: Loading layer [==================================================>] 29.29MB/29.29MB
7950a56e2f9a: Loading layer [==================================================>] 22.02kB/22.02kB
ec646689acd6: Loading layer [==================================================>] 14.47MB/14.47MB
Loaded image: goharbor/notary-signer-photon:v2.5.6
 
 
[Step 3]: preparing environment ...
 
[Step 4]: preparing harbor configs ...
prepare base dir is set to /opt/harbor
Clearing the configuration file: /config/log/logrotate.conf
Clearing the configuration file: /config/log/rsyslog_docker.conf
Clearing the configuration file: /config/nginx/nginx.conf
Clearing the configuration file: /config/core/app.conf
Clearing the configuration file: /config/core/env
Clearing the configuration file: /config/registryctl/config.yml
Clearing the configuration file: /config/registryctl/env
Clearing the configuration file: /config/portal/nginx.conf
Clearing the configuration file: /config/registry/root.crt
Clearing the configuration file: /config/registry/config.yml
Clearing the configuration file: /config/registry/passwd
Clearing the configuration file: /config/db/env
Clearing the configuration file: /config/jobservice/config.yml
Clearing the configuration file: /config/jobservice/env
Generated configuration file: /config/portal/nginx.conf
Generated configuration file: /config/log/logrotate.conf
Generated configuration file: /config/log/rsyslog_docker.conf
Generated configuration file: /config/nginx/nginx.conf
Generated configuration file: /config/core/env
Generated configuration file: /config/core/app.conf
Generated configuration file: /config/registry/config.yml
Generated configuration file: /config/registryctl/env
Generated configuration file: /config/registryctl/config.yml
Generated configuration file: /config/db/env
Generated configuration file: /config/jobservice/env
Generated configuration file: /config/jobservice/config.yml
loaded secret from file: /data/secret/keys/secretkey
Generated configuration file: /config/chartserver/env
Generated configuration file: /compose_location/docker-compose.yml
Clean up the input dir
 
 
Note: stopping existing Harbor instance ...
Removing harbor-jobservice ... done
Removing nginx ... done
Removing harbor-core ... done
Removing harbor-db ... done
Removing registry ... done
Removing redis ... done
Removing harbor-portal ... done
Removing registryctl ... done
Removing harbor-log ... done
Removing network harbor_harbor
Removing network harbor_harbor-chartmuseum
WARNING: Network harbor_harbor-chartmuseum not found.
 
 
[Step 5]: starting Harbor ...
Creating network "harbor_harbor" with the default driver
Creating network "harbor_harbor-chartmuseum" with the default driver
Creating harbor-log ... done
Creating harbor-portal ... done
Creating registry ... done
Creating registryctl ... done
Creating redis ... done
Creating harbor-db ... done
Creating chartmuseum ... done
Creating harbor-core ... done
Creating nginx ... done
Creating harbor-jobservice ... done
✔ ----Harbor has been installed and started successfully.----vi /etc/hosts
 
登入harbor
root@rancher-dev tmp]# helm registry login https://harbor.xxx.com
Username: admin
Password:
Login Succeeded
 
helm新增push的插件
[root@rancher-dev plugins]# helm plugin install https://github.com/chartmuseum/helm-push
Downloading and installing helm-push v0.10.3 ...
https://github.com/chartmuseum/helm-push/releases/download/v0.10.3/helm-push_0.10.3_linux_amd64.tar.gz
Installed plugin: cm-push
查看插件
helm plugin list
添加倉庫
helm repo add harbor https://harbor.xxx.com/chartrepo/library
# 如需要配置用戶和密碼
helm repo add harbor --username=xxx --password=xxx https://harbor.xxx.com/chartrepo/library
上傳helm包
tar zcvf nginx-server.tgz nginx-server/
[root@rancher-dev helm-demo]# helm cm-push --username=admin --password=Harbor12345 nginx-server.tgz harbor
Pushing nginx-server-0.1.0.tgz to harbor...
Done.
上傳完畢harbor library裡面的helm chart 可以看到剛才上傳的包

 
下載應用
helm repo update
helm pull --version 0.1.0 harbor/nginx1-server
安裝應用
helm install nginx-server harbor/nginx-server

 

ArgoCD設定Harbor Helm repo來源

新增application

Save存檔後手動Sync一次

同步完成

 
 

Hits: 140

By tony

自由軟體愛好者~喜歡不斷的思考各種問題,有新的事物都會想去學習嘗試 做實驗並熱衷研究 沒有所謂頂天的技術 只有謙虛及不斷的學習 精進專業,本站主要以分享系統及網路相關知識、資源而建立。 Github http://stnet253.github.io

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料