OpenShift clusters on Proxmox made simple
ProxShift provides automated certificate backup and restore functionality for OpenShift clusters, specifically designed for the ocp-sno1 ACM hub cluster which hosts critical certificate secrets.
cert_backup (standalone, does NOT interfere with other operations)post,cert_restore (part of post-install workflow)tasks/cluster_login.yml for consistent authentication# Load ProxShift functions
source proxshift.sh
# Backup certificates from EXISTING ocp-sno1 (dry-run)
ps.backup_certs --dry-run
# Backup certificates from EXISTING ocp-sno1 (actual operation)
ps.backup_certs
β Important: The cluster ocp-sno1 must be running and accessible!
# Restore certificates to REBUILT ocp-sno1 (dry-run)
ps.restore_certs --dry-run
# Restore certificates to REBUILT ocp-sno1 (actual operation)
ps.restore_certs
β Important: Use this ONLY when rebuilding the ACM hub cluster!
config/site-config.yaml)backup_secrets:
- name: secret-homelab-ca-tls
namespace: cert-manager
- name: secret-homelab-io-tls
namespace: homelab
backup_dir: "/backups"
site.yaml)backup_operation: false # Set to true to backup certificate secrets
restore_operation: false # Set to true to restore certificate secrets
backup_verbose: false # Enable verbose output for backup/restore operations
enable_backup_restore: true # Enable certificate backup/restore functionality
ansible-playbook site.yaml \
-e cluster_name=ocp-sno1 \
-e backup_operation=true \
--tags=cert_backup
Note: Uses cert_backup tag - does NOT run any post-install tasks!
ansible-playbook site.yaml \
-e cluster_name=ocp-sno1 \
-e restore_operation=true \
--tags=cert_restore
Note: Uses cert_restore tag - runs as part of post-install workflow!
ansible-playbook site.yaml \
-e cluster_name=ocp-sno1 \
-e backup_operation=true \
-e backup_verbose=true \
--tags=cert_backup
ansible-playbook site.yaml \
-e cluster_name=ocp-sno1 \
-e backup_operation=true \
-e backup_dir="/custom/backup/path" \
--tags=backup
# Override in your inventory or command line
backup_secrets:
- name: my-custom-cert
namespace: my-namespace
- name: another-cert
namespace: cert-manager
The backup directory structure follows this pattern:
/
βββ ocp-sno1/
β βββ cert-manager/
β β βββ secret-homelab-ca-tls.yaml
β βββ homelab/
β βββ secret-homelab-io-tls.yaml
βββ metadata/
βββ backup-timestamp.txt
βββ cluster-info.yaml
ocp-sno1 using cluster_login.ymlocp-sno1 using cluster_login.ymlproxshift.openshift.secret_management rolesecret_management_*tasks/cluster_login.ymlbackup: Certificate backup operationsrestore: Certificate restore operationspost: Post-installation tasks (includes backup/restore)Currently configured for:
missing required arguments: secret_management_backup_dir, secret_management_cluster, secret_management_secrets
Solution: This was fixed by updating variable names in site.yaml to match the roleβs argument specifications.
β Login failed for cluster: ocp-sno1
Solutions:
Backup directory does not exist: /path/to/backup
Solutions:
backup_dir path exists and is writablegitops_root variable is correctly setSecret 'secret-name' not found in namespace 'namespace'
Solutions:
oc get secrets -n namespaceocp-sno1This guide provides comprehensive coverage of ProxShiftβs certificate backup and restore capabilities, ensuring reliable certificate management for your OpenShift infrastructure.