diff --git a/Makefile b/Makefile index 5b8864f..c749911 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,5 @@ BINARY_NAME=pg-bkup IMAGE_NAME=jkaninda/pg-bkup -#IMAGE_NAME=ghcr.io/jkaninda/pg-bkup:v1.0 include .env export run: diff --git a/docs/how-tos/restore-from-s3.md b/docs/how-tos/restore-from-s3.md index 9f671d5..2580ac8 100644 --- a/docs/how-tos/restore-from-s3.md +++ b/docs/how-tos/restore-from-s3.md @@ -26,7 +26,7 @@ services: command: - /bin/sh - -c - - pg-bkup restore --storage s3 -d my-database -f store_20231219_022941.sql.gz --path /my-custom-path + - bkup restore --storage s3 -d my-database -f store_20231219_022941.sql.gz --path /my-custom-path volumes: - ./backup:/backup environment: @@ -48,4 +48,50 @@ services: - web networks: web: -``` \ No newline at end of file +``` +## Restore on Kubernetes + +Simple Kubernetes restore Job: + +```yaml +apiVersion: batch/v1 +kind: Job +metadata: + name: restore-db +spec: + template: + spec: + containers: + - name: pg-bkup + image: jkaninda/pg-bkup + command: + - /bin/sh + - -c + - bkup restore -s s3 --path /custom_path -f store_20231219_022941.sql.gz + env: + - name: DB_PORT + value: "5432" + - name: DB_HOST + value: "" + - name: DB_NAME + value: "" + - name: DB_USERNAME + value: "" + # Please use secret! + - name: DB_PASSWORD + value: "" + - name: AWS_S3_ENDPOINT + value: "https://s3.amazonaws.com" + - name: AWS_S3_BUCKET_NAME + value: "xxx" + - name: AWS_REGION + value: "us-west-2" + - name: AWS_ACCESS_KEY + value: "xxxx" + - name: AWS_SECRET_KEY + value: "xxxx" + - name: AWS_DISABLE_SSL + value: "false" + restartPolicy: Never + backoffLimit: 4 +``` diff --git a/docs/how-tos/restore-from-ssh.md b/docs/how-tos/restore-from-ssh.md index 1ec6845..12810e4 100644 --- a/docs/how-tos/restore-from-ssh.md +++ b/docs/how-tos/restore-from-ssh.md @@ -47,4 +47,50 @@ services: - web networks: web: +``` +## Restore on Kubernetes + +Simple Kubernetes restore Job: + +```yaml +apiVersion: batch/v1 +kind: Job +metadata: + name: restore-db +spec: + template: + spec: + containers: + - name: pg-bkup + image: jkaninda/pg-bkup + command: + - /bin/sh + - -c + - bkup restore -s ssh -f store_20231219_022941.sql.gz + env: + - name: DB_PORT + value: "5432" + - name: DB_HOST + value: "" + - name: DB_NAME + value: "" + - name: DB_USERNAME + value: "" + # Please use secret! + - name: DB_PASSWORD + value: "" + - name: SSH_HOST_NAME + value: "" + - name: SSH_PORT + value: "22" + - name: SSH_USER + value: "xxx" + - name: SSH_REMOTE_PATH + value: "/home/jkaninda/backups" + - name: AWS_ACCESS_KEY + value: "xxxx" + - name: SSH_IDENTIFY_FILE + value: "/tmp/id_ed25519" + restartPolicy: Never + backoffLimit: 4 ``` \ No newline at end of file