Skip to content




Table of Content

harbor

https://goharbor.io/

Harbor is an open source registry that secures artifacts with policies and role-based access control, ensures images are scanned and free from vulnerabilities, and signs images as trusted. Harbor, a CNCF Graduated project, delivers compliance, performance, and interoperability to help you consistently and securely manage artifacts across cloud native compute platforms like Kubernetes and Docker.

upgrade

# steps to upgrade from v2.10.1 to v2.12.0
# 2024-12-11

# shutdown containers
# on harbor docker compose dir
sudo docker compose down

# backup the entire directory
# and to clean up previous backup before the backup
# rm -rf ~/harbor_backup
cd ..
mv harbor ~/harbor_backup
# remove previous db backup
sudo rm -rf ~/harbor_db_backup
# backup database dir
sudo cp -r /data/database ~/harbor_db_backup

# download the latest
curl -LO https://github.com/goharbor/harbor/releases/download/v2.12.0/harbor-online-installer-v2.12.0.tgz
tar zxvf harbor-online-installer-v2.12.0.tgz

# pull prepare image
docker pull goharbor/prepare:v2.12.0

# get the working harbor.yml from the backup
cp ~/harbor_backup/harbor.yml harbor/.

# migration
cd harbor
sudo docker run -it --rm -v /:/hostfs goharbor/prepare:v2.12.0 migrate -i harbor.yml

# get the cert from the backup
cp -r ~/harbor_backup/cert cert

# upgrade and run
sudo ./install.sh --with-trivy

restore from backup on a different node

WIP

  • copy the same files used to upgrade
    • harbor.yml
    • cert directory containing TLS cert and key
    • /data/database with appropriate permission and owner settings