Add backup as crontab

This commit is contained in:
Jack Jackson 2024-04-06 14:39:54 -07:00
parent 68f83a23b3
commit a98d915658

View File

@ -10,6 +10,22 @@ appDef.helmApplication(
enabled: true,
hostname: "keycloak.avril"
},
initContainers: [
// https://stackoverflow.com/a/70947232/1040915
{
name: "add-backup-to-crontab",
image: "ubuntu",
command: [
"/bin/sh",
"-c",
'apt update; apt install -y cron; echo "* * * * * /opt/bitnami/keycloak/bin/kc.sh export --file /backup/realm-export-$(date +%s).json --realm new-realm" | crontab -'
],
securityContext: {
allowPrivilegeEscalation: true,
runAsUser: 0
}
}
],
image: {
tag: "24.0.2"
},