snapshots #10
@ -70,106 +70,3 @@ data:
|
|||||||
RESTIC_PASSWORD: bHIyOXhtOTU=
|
RESTIC_PASSWORD: bHIyOXhtOTU=
|
||||||
AWS_ACCESS_KEY_ID: OWFTSXZBSEVzWlNVMmkyTU9zVGxWSk1lL1NjPQ==
|
AWS_ACCESS_KEY_ID: OWFTSXZBSEVzWlNVMmkyTU9zVGxWSk1lL1NjPQ==
|
||||||
AWS_SECRET_ACCESS_KEY: WVN5ck9ncVllcjBWNFNLdlVOcmx2OGhjTllhZGZuN2xaNjBIaXRlL3djWT0=
|
AWS_SECRET_ACCESS_KEY: WVN5ck9ncVllcjBWNFNLdlVOcmx2OGhjTllhZGZuN2xaNjBIaXRlL3djWT0=
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Repo
|
|
||||||
metadata:
|
|
||||||
name: repo-local
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
backend:
|
|
||||||
local:
|
|
||||||
emptyDir:
|
|
||||||
repositorySecrets: secret-minio
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Repo
|
|
||||||
metadata:
|
|
||||||
name: repo-minio
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
backend:
|
|
||||||
s3:
|
|
||||||
server: raid5.desmojim.fr:9000
|
|
||||||
bucket: testbucket2
|
|
||||||
repositorySecrets: secret-minio
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: restore-pg
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: restore-pg
|
|
||||||
image: desmo999r/formolcli:latest
|
|
||||||
args: ["postgres", "restore", "--hostname", $(PGHOST), "--database", $(PGDATABASE), "--username", $(PGUSER), "--password", $(PGPASSWD), "--file", "/output/backup-pg.sql"]
|
|
||||||
env:
|
|
||||||
- name: PGHOST
|
|
||||||
value: postgres
|
|
||||||
- name: PGDATABASE
|
|
||||||
value: demopostgres
|
|
||||||
- name: PGUSER
|
|
||||||
value: demopostgres
|
|
||||||
- name: PGPASSWD
|
|
||||||
value: password123!
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: with-envfrom
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: with-envfrom
|
|
||||||
command: ["touch", $(title)]
|
|
||||||
envFrom:
|
|
||||||
- secretRef:
|
|
||||||
name: with-envfrom-secret
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: with-env
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: with-env
|
|
||||||
command: ["touch", $(TESTFILE)]
|
|
||||||
env:
|
|
||||||
- name: TESTFILE
|
|
||||||
value: /data/testfile
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: backup-pg
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: backup-pg
|
|
||||||
image: desmo999r/formolcli:latest
|
|
||||||
args: ["postgres", "backup", "--hostname", $(PGHOST), "--database", $(PGDATABASE), "--username", $(PGUSER), "--password", $(PGPASSWD), "--file", "/output/backup-pg.sql"]
|
|
||||||
env:
|
|
||||||
- name: PGHOST
|
|
||||||
value: postgres
|
|
||||||
- name: PGDATABASE
|
|
||||||
value: demopostgres
|
|
||||||
- name: PGUSER
|
|
||||||
value: demopostgres
|
|
||||||
- name: PGPASSWD
|
|
||||||
value: password123!
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: maintenance-off
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: maintenance-off
|
|
||||||
command: ["/bin/sh", "-c", "echo $(date +%Y/%m/%d-%H:%M:%S) maintenance-off >> /data/logs.txt"]
|
|
||||||
---
|
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
|
||||||
kind: Function
|
|
||||||
metadata:
|
|
||||||
name: maintenance-on
|
|
||||||
namespace: demo
|
|
||||||
spec:
|
|
||||||
name: maintenance-on
|
|
||||||
command: ["/bin/sh", "-c", "echo $(date +%Y/%m/%d-%H:%M:%S) maintenance-on >> /data/logs.txt"]
|
|
||||||
|
|||||||
@ -84,9 +84,11 @@ spec:
|
|||||||
name: postgres-config-demo
|
name: postgres-config-demo
|
||||||
ports:
|
ports:
|
||||||
- containerPort: 5432
|
- containerPort: 5432
|
||||||
name: postgredb
|
name: postgresdb
|
||||||
volumeMounts:
|
volumeMounts:
|
||||||
- name: postgredb
|
- name: postgres-volume
|
||||||
mountPath: /var/lib/postgresql/data
|
mountPath: /var/lib/postgresql/data
|
||||||
volumes:
|
volumes:
|
||||||
- name: postgredb
|
- name: postgres-volume
|
||||||
|
hostPath:
|
||||||
|
path: /data/postgresdb
|
||||||
|
|||||||
@ -1,5 +1,104 @@
|
|||||||
---
|
---
|
||||||
apiVersion: formol.desmojim.fr/v1alpha1
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Repo
|
||||||
|
metadata:
|
||||||
|
name: repo-local
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
backend:
|
||||||
|
local:
|
||||||
|
emptyDir:
|
||||||
|
repositorySecrets: secret-minio
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Repo
|
||||||
|
metadata:
|
||||||
|
name: repo-minio
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
backend:
|
||||||
|
s3:
|
||||||
|
server: raid5.desmojim.fr:9000
|
||||||
|
bucket: testbucket2
|
||||||
|
repositorySecrets: secret-minio
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: restore-pg
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: restore-pg
|
||||||
|
image: desmo999r/formolcli:latest
|
||||||
|
args: ["postgres", "restore", "--hostname", $(PGHOST), "--database", $(PGDATABASE), "--username", $(PGUSER), "--password", $(PGPASSWD), "--file", "/output/backup-pg.sql"]
|
||||||
|
env:
|
||||||
|
- name: PGHOST
|
||||||
|
value: postgres
|
||||||
|
- name: PGDATABASE
|
||||||
|
value: demopostgres
|
||||||
|
- name: PGUSER
|
||||||
|
value: demopostgres
|
||||||
|
- name: PGPASSWD
|
||||||
|
value: password123!
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: with-envfrom
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: with-envfrom
|
||||||
|
command: ["touch", $(title)]
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: with-envfrom-secret
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: with-env
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: with-env
|
||||||
|
command: ["touch", $(TESTFILE)]
|
||||||
|
env:
|
||||||
|
- name: TESTFILE
|
||||||
|
value: /data/testfile
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: backup-pg
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: backup-pg
|
||||||
|
command: ["pg_dump"]
|
||||||
|
args: ["--username", $(PGUSER), "--clean", "--if-exists", "--inserts", "--file", "/formol-shared/backup-pg.sql"]
|
||||||
|
env:
|
||||||
|
- name: PGUSER
|
||||||
|
value: demopostgres
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: maintenance-off
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: maintenance-off
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "echo $(date +%Y/%m/%d-%H:%M:%S) maintenance-off >> /data/logs.txt"]
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
|
kind: Function
|
||||||
|
metadata:
|
||||||
|
name: maintenance-on
|
||||||
|
namespace: demo
|
||||||
|
spec:
|
||||||
|
name: maintenance-on
|
||||||
|
command: ["/bin/sh"]
|
||||||
|
args: ["-c", "echo $(date +%Y/%m/%d-%H:%M:%S) maintenance-on >> /data/logs.txt"]
|
||||||
|
---
|
||||||
|
apiVersion: formol.desmojim.fr/v1alpha1
|
||||||
kind: BackupConfiguration
|
kind: BackupConfiguration
|
||||||
metadata:
|
metadata:
|
||||||
name: backup-demo
|
name: backup-demo
|
||||||
@ -32,6 +131,8 @@ spec:
|
|||||||
targetName: postgres-demo
|
targetName: postgres-demo
|
||||||
containers:
|
containers:
|
||||||
- name: postgres
|
- name: postgres
|
||||||
|
job:
|
||||||
|
- name: backup-pg
|
||||||
# - kind: Job
|
# - kind: Job
|
||||||
# name: backup-pg
|
# name: backup-pg
|
||||||
# steps:
|
# steps:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user