Overview
Harbor certificate rotation steps.
Steps
- Stop the Harbor service
# Stop the systemd unit.
sudo systemctl stop harbor
- Backup the existing certificates
# Create a directory
sudo mkdir -p ${HOME}/backup/$(date +%Y%m%d)
# Copy the files
sudo cp /storage/data/secret/cert/server.crt ${HOME}/backup/$(date +%Y%m%d)/server.crt
sudo cp /storage/data/secret/cert/server.key ${HOME}/backup/$(date +%Y%m%d)/server.key
sudo cp /storage/data/secret/cert/ca.crt ${HOME}/backup/$(date +%Y%m%d)/ca.crt
- Overwrite the existing certificates with the new ones
# Place the new certificates in the ${HOME}/certs directory
sudo mkdir -p "${HOME}/certs"
# Copy the files
sudo cp "${HOME}/certs/server.crt" /storage/data/secret/cert/server.crt
sudo cp "${HOME}/certs/server.key" /storage/data/secret/cert/server.key
sudo cp "${HOME}/certs/ca.crt" /storage/data/secret/cert/ca.crt
- Start the Harbor service
# Start the system unit
sudo systemctl start harbor
