mirror of
https://github.com/auricom/home-cluster.git
synced 2025-09-17 18:24:14 +02:00
🩹 postgres-external-backup hook
This commit is contained in:
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Possible actions: error, pre-backup, post-backup
|
||||||
|
ACTION="$1"
|
||||||
|
|
||||||
|
if [ "$WEBHOOK_URL" != "**None**" ]; then
|
||||||
|
case "$ACTION" in
|
||||||
|
"error")
|
||||||
|
echo "Execute error webhook call to $WEBHOOK_URL"
|
||||||
|
curl --url "$WEBHOOK_URL" \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--max-time 10 \
|
||||||
|
--retry 5 \
|
||||||
|
$WEBHOOK_EXTRA_ARGS
|
||||||
|
;;
|
||||||
|
# "pre-backup")
|
||||||
|
# echo "Nothing to do"
|
||||||
|
# ;;
|
||||||
|
"post-backup")
|
||||||
|
echo "Execute post-backup webhook call to $WEBHOOK_URL"
|
||||||
|
curl --url "$WEBHOOK_URL" \
|
||||||
|
--header 'Content-Type: application/json' \
|
||||||
|
--max-time 10 \
|
||||||
|
--retry 5 \
|
||||||
|
$WEBHOOK_EXTRA_ARGS
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
@@ -75,8 +75,15 @@ spec:
|
|||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: backups
|
- name: backups
|
||||||
mountPath: /backups
|
mountPath: /backups
|
||||||
|
- name: files
|
||||||
|
subPath: 00-webhook
|
||||||
|
mountPath: /hooks/00-webhook
|
||||||
volumes:
|
volumes:
|
||||||
- name: backups
|
- name: backups
|
||||||
nfs:
|
nfs:
|
||||||
server: "${LOCAL_LAN_TRUENAS}"
|
server: "${LOCAL_LAN_TRUENAS}"
|
||||||
path: /mnt/storage/backups/postgresql
|
path: /mnt/storage/backups/postgresql
|
||||||
|
- name: files
|
||||||
|
configMap:
|
||||||
|
name: postgres-external-backup
|
||||||
|
defaultMode: 0555
|
||||||
|
@@ -2,3 +2,9 @@ apiVersion: kustomize.config.k8s.io/v1beta1
|
|||||||
kind: Kustomization
|
kind: Kustomization
|
||||||
resources:
|
resources:
|
||||||
- ./helm-release.yaml
|
- ./helm-release.yaml
|
||||||
|
configMapGenerator:
|
||||||
|
- name: postgres-external-backup
|
||||||
|
files:
|
||||||
|
- ./00-webhook
|
||||||
|
generatorOptions:
|
||||||
|
disableNameSuffixHash: true
|
||||||
|
Reference in New Issue
Block a user