docs: update kubernetes deployment

This commit is contained in:
2024-08-28 20:27:27 +02:00
parent 3e60f18df1
commit 31145ff29b
5 changed files with 100 additions and 69 deletions

View File

@@ -100,32 +100,47 @@ spec:
template: template:
spec: spec:
containers: containers:
- name: pg-bkup - name: pg-bkup
# In production, it is advised to lock your image tag to a proper # In production, it is advised to lock your image tag to a proper
# release version instead of using `latest`. # release version instead of using `latest`.
# Check https://github.com/jkaninda/pg-bkup/releases # Check https://github.com/jkaninda/pg-bkup/releases
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- bkup - /bin/sh
- backup - -c
resources: - bkup
limits: - backup
memory: "128Mi" - --storage
cpu: "500m" - s3
env: resources:
- name: DB_PORT limits:
value: "5432" memory: "128Mi"
- name: DB_HOST cpu: "500m"
value: "" env:
- name: DB_NAME - name: DB_PORT
value: "dbname" value: "5432"
- name: DB_USERNAME - name: DB_HOST
value: "postgres" value: ""
# Please use secret! - name: DB_NAME
- name: DB_PASSWORD value: ""
value: "" - name: DB_USERNAME
restartPolicy: Never 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"
``` ```
## Available image registries ## Available image registries

View File

@@ -13,12 +13,13 @@
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on. # you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible # You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}. # in the templates via {{ site.myvariable }}.
title: Postgres database backup title: PostgreSQL Backup Docker container image
email: hi@jonaskaninda.com email: hi@jonaskaninda.com
description: >- # this means to ignore newlines until "baseurl:" description: >- # this means to ignore newlines until "baseurl:"
PostgreSQL Backup and Restore Docker container image. Backup database to AWS S3 storage or SSH remote server. PostgreSQL Backup is a Docker container image that can be used to backup and restore Postgres database.
It supports local storage, AWS S3 or any S3 Alternatives for Object Storage, and SSH compatible storage.
baseurl: "" # the subpath of your site, e.g. /blog baseurl: "https://jkaninda.github.io/mysql-bkup/" # the subpath of your site, e.g. /blog
url: "jkaninda.github.io/pg-bkup/" # the base hostname & protocol for your site, e.g. http://example.com url: "jkaninda.github.io/pg-bkup/" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jonaskaninda twitter_username: jonaskaninda
github_username: jkaninda github_username: jkaninda

View File

@@ -28,6 +28,8 @@ spec:
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- /bin/sh
- -c
- bkup - bkup
- backup - backup
- --storage - --storage
@@ -82,6 +84,8 @@ spec:
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- /bin/sh
- -c
- bkup - bkup
- backup - backup
- --storage - --storage
@@ -138,6 +142,8 @@ spec:
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- /bin/sh
- -c
- bkup - bkup
- restore - restore
- --storage - --storage
@@ -196,6 +202,8 @@ spec:
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- /bin/sh
- -c
- bkup - bkup
- backup - backup
- --storage - --storage
@@ -262,6 +270,8 @@ spec:
# for a list of available releases. # for a list of available releases.
image: jkaninda/pg-bkup image: jkaninda/pg-bkup
command: command:
- /bin/sh
- -c
- bkup - bkup
- backup - backup
- --storage - --storage

View File

@@ -84,8 +84,6 @@ spec:
value: "xxx" value: "xxx"
- name: SSH_REMOTE_PATH - name: SSH_REMOTE_PATH
value: "/home/jkaninda/backups" value: "/home/jkaninda/backups"
- name: AWS_ACCESS_KEY
value: "xxxx"
- name: SSH_IDENTIFY_FILE - name: SSH_IDENTIFY_FILE
value: "/tmp/id_ed25519" value: "/tmp/id_ed25519"
restartPolicy: Never restartPolicy: Never

View File

@@ -1,42 +1,49 @@
apiVersion: batch/v1 apiVersion: batch/v1
kind: CronJob kind: Job
metadata: metadata:
name: bkup-job name: backup
spec: spec:
schedule: "* * * * *" template:
jobTemplate:
spec: spec:
template: containers:
spec: - name: pg-bkup
containers: # In production, it is advised to lock your image tag to a proper
- name: pg-bkup # release version instead of using `latest`.
image: jkaninda/pg-bkup:v1.2.1 # Check https://github.com/jkaninda/pg-bkup/releases
command: # for a list of available releases.
- pg-bkup backup -s s3 --path /custom_path image: jkaninda/pg-bkup
env: command:
- name: DB_PORT - /bin/sh
value: "5432" - -c
- name: DB_HOST - bkup
value: "" - backup
- name: DB_NAME - --storage
value: "" - s3
- name: DB_USERNAME resources:
value: "" limits:
# Please use secret! memory: "128Mi"
- name: DB_PASSWORD cpu: "500m"
value: "" env:
- name: ACCESS_KEY - name: DB_PORT
value: "" value: "5432"
- name: AWS_S3_ENDPOINT - name: DB_HOST
value: "https://s3.amazonaws.com" value: ""
- name: AWS_S3_BUCKET_NAME - name: DB_NAME
value: "xxx" value: ""
- name: AWS_REGION - name: DB_USERNAME
value: "us-west-2" value: ""
- name: AWS_ACCESS_KEY # Please use secret!
value: "xxxx" - name: DB_PASSWORD
- name: AWS_SECRET_KEY value: ""
value: "xxxx" - name: AWS_S3_ENDPOINT
- name: AWS_DISABLE_SSL value: "https://s3.amazonaws.com"
value: "false" - name: AWS_S3_BUCKET_NAME
restartPolicy: OnFailure 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"