docs: update kubernetes deployment
This commit is contained in:
16
README.md
16
README.md
@@ -101,9 +101,6 @@ spec:
|
|||||||
command:
|
command:
|
||||||
- bkup
|
- bkup
|
||||||
- backup
|
- backup
|
||||||
- --storage
|
|
||||||
- ssh
|
|
||||||
- --disable-compression
|
|
||||||
resources:
|
resources:
|
||||||
limits:
|
limits:
|
||||||
memory: "128Mi"
|
memory: "128Mi"
|
||||||
@@ -120,19 +117,6 @@ spec:
|
|||||||
# Please use secret!
|
# Please use secret!
|
||||||
- name: DB_PASSWORD
|
- name: DB_PASSWORD
|
||||||
value: ""
|
value: ""
|
||||||
- name: SSH_HOST_NAME
|
|
||||||
value: "xxx"
|
|
||||||
- name: SSH_PORT
|
|
||||||
value: "22"
|
|
||||||
- name: SSH_USER
|
|
||||||
value: "xxx"
|
|
||||||
- name: SSH_PASSWORD
|
|
||||||
value: "xxxx"
|
|
||||||
- name: SSH_REMOTE_PATH
|
|
||||||
value: "/home/toto/backup"
|
|
||||||
# Optional, required if you want to encrypt your backup
|
|
||||||
- name: GPG_PASSPHRASE
|
|
||||||
value: "xxxx"
|
|
||||||
restartPolicy: Never
|
restartPolicy: Never
|
||||||
```
|
```
|
||||||
## Available image registries
|
## Available image registries
|
||||||
|
|||||||
@@ -85,7 +85,7 @@ networks:
|
|||||||
|
|
||||||
For Kubernetes, you don't need to run it in scheduled mode. You can deploy it as CronJob.
|
For Kubernetes, you don't need to run it in scheduled mode. You can deploy it as CronJob.
|
||||||
|
|
||||||
### Simple Kubernetes CronJob usage:
|
### Simple Kubernetes backup CronJob:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
|
|||||||
@@ -10,7 +10,60 @@ nav_order: 8
|
|||||||
To deploy PostgreSQL Backup on Kubernetes, you can use Job to backup or Restore your database.
|
To deploy PostgreSQL Backup on Kubernetes, you can use Job to backup or Restore your database.
|
||||||
For recurring backup you can use CronJob, you don't need to run it in scheduled mode. as described bellow.
|
For recurring backup you can use CronJob, you don't need to run it in scheduled mode. as described bellow.
|
||||||
|
|
||||||
## Backup Job
|
## Backup Job to S3 Storage
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: batch/v1
|
||||||
|
kind: Job
|
||||||
|
metadata:
|
||||||
|
name: backup
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: pg-bkup
|
||||||
|
# In production, it is advised to lock your image tag to a proper
|
||||||
|
# release version instead of using `latest`.
|
||||||
|
# Check https://github.com/jkaninda/pg-bkup/releases
|
||||||
|
# for a list of available releases.
|
||||||
|
image: jkaninda/pg-bkup
|
||||||
|
command:
|
||||||
|
- bkup
|
||||||
|
- backup
|
||||||
|
- --storage
|
||||||
|
- s3
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
memory: "128Mi"
|
||||||
|
cpu: "500m"
|
||||||
|
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
|
||||||
|
```
|
||||||
|
|
||||||
|
## Backup Job to SSH remote Server
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
@@ -182,6 +235,9 @@ spec:
|
|||||||
|
|
||||||
## Kubernetes Rootless
|
## Kubernetes Rootless
|
||||||
|
|
||||||
|
This image also supports Kubernetes security context, you can run it in Rootless environment.
|
||||||
|
It has been tested on Openshift, it works well.
|
||||||
|
Deployment on Openshift is supported, you need to remove `securityContext` section on your yaml file.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
apiVersion: batch/v1
|
apiVersion: batch/v1
|
||||||
|
|||||||
Reference in New Issue
Block a user