Skip to content

Commit

Permalink
Add postgres skeleton.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 committed Aug 25, 2023
1 parent 5fd9ec0 commit 536fd77
Show file tree
Hide file tree
Showing 3 changed files with 501 additions and 45 deletions.
155 changes: 112 additions & 43 deletions deploy/postgres-local.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,28 @@
# DO NOT EDIT! This is auto-generated by the integration tests
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
creationTimestamp: null
labels:
app: postgres
name: postgres
spec:
serviceName: postgres
replicas: 1
selector:
matchLabels:
app: postgres
serviceName: postgres
template:
metadata:
creationTimestamp: null
labels:
app: postgres
spec:
containers:
- image: postgres:12-alpine
name: postgres
command:
- command:
- backup-restore-sidecar
- wait
ports:
- containerPort: 5432
env:
- name: POSTGRES_DB
valueFrom:
Expand All @@ -45,17 +44,54 @@ spec:
secretKeyRef:
key: POSTGRES_DATA
name: postgres
image: postgres:15-alpine
livenessProbe:
exec:
command:
- /bin/sh
- -c
- exec
- pg_isready
- -U
- test
- -h
- 127.0.0.1
- -p
- "5432"
failureThreshold: 6
initialDelaySeconds: 30
periodSeconds: 10
successThreshold: 1
timeoutSeconds: 5
name: postgres
ports:
- containerPort: 5432
readinessProbe:
exec:
command:
- /bin/sh
- -c
- exec
- pg_isready
- -U
- test
- -h
- 127.0.0.1
- -p
- "5432"
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
resources: {}
volumeMounts:
- name: postgres
mountPath: /data
- name: bin-provision
- mountPath: /data
name: data
- mountPath: /usr/local/bin/backup-restore-sidecar
name: bin-provision
subPath: backup-restore-sidecar
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
- image: postgres:12-alpine
name: backup-restore-sidecar
command:
- mountPath: /etc/backup-restore-sidecar
name: backup-restore-sidecar-config
- command:
- backup-restore-sidecar
- start
- --log-level=debug
Expand All @@ -70,74 +106,105 @@ spec:
secretKeyRef:
key: POSTGRES_USER
name: postgres
image: postgres:15-alpine
name: backup-restore-sidecar
ports:
- containerPort: 8000
name: grpc
resources: {}
volumeMounts:
- name: postgres
mountPath: /data
- name: bin-provision
- mountPath: /backup
name: backup
- mountPath: /data
name: data
- mountPath: /etc/backup-restore-sidecar
name: backup-restore-sidecar-config
- mountPath: /usr/local/bin/backup-restore-sidecar
name: bin-provision
subPath: backup-restore-sidecar
mountPath: /usr/local/bin/backup-restore-sidecar
- name: backup-restore-sidecar-config
mountPath: /etc/backup-restore-sidecar
initContainers:
- name: backup-restore-sidecar-provider
image: ghcr.io/metal-stack/backup-restore-sidecar:latest
imagePullPolicy: IfNotPresent
command:
- command:
- cp
- /backup-restore-sidecar
- /bin-provision
ports:
- containerPort: 2112
image: ghcr.io/metal-stack/backup-restore-sidecar:latest
imagePullPolicy: IfNotPresent
name: backup-restore-sidecar-provider
resources: {}
volumeMounts:
- name: bin-provision
mountPath: /bin-provision
- mountPath: /bin-provision
name: bin-provision
volumes:
- name: postgres
- name: data
persistentVolumeClaim:
claimName: data
- name: backup
persistentVolumeClaim:
claimName: postgres
- name: backup-restore-sidecar-config
configMap:
claimName: backup
- configMap:
name: backup-restore-sidecar-config-postgres
- name: bin-provision
emptyDir: {}
name: backup-restore-sidecar-config
- emptyDir: {}
name: bin-provision
updateStrategy: {}
volumeClaimTemplates:
- metadata:
name: postgres
creationTimestamp: null
name: data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
- metadata:
creationTimestamp: null
name: backup
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Gi
status: {}
status:
availableReplicas: 0
replicas: 0
---
apiVersion: v1
kind: ConfigMap
metadata:
name: backup-restore-sidecar-config-postgres
data:
config.yaml: |
---
bind-addr: 0.0.0.0
db: postgres
db-data-directory: /data/postgres/
backup-provider: local
backup-cron-schedule: "*/1 * * * *"
object-prefix: postgres-test
compression-method: tar
post-exec-cmds:
- docker-entrypoint.sh postgres
- docker-entrypoint.sh postgres
kind: ConfigMap
metadata:
creationTimestamp: null
name: backup-restore-sidecar-config-postgres
---
apiVersion: v1
kind: Secret
metadata:
creationTimestamp: null
name: postgres
stringData:
POSTGRES_DATA: /data/postgres/
POSTGRES_DB: postgres
POSTGRES_USER: test
POSTGRES_PASSWORD: test123!
POSTGRES_DATA: /data/postgres/
POSTGRES_USER: test
---
apiVersion: v1
kind: Service
metadata:
creationTimestamp: null
labels:
app: postgres
name: postgres
Expand All @@ -146,8 +213,10 @@ spec:
- name: "5432"
port: 5432
targetPort: 5432
- name: "metrics"
- name: metrics
port: 2112
targetPort: 2112
selector:
app: postgres
status:
loadBalancer: {}
Loading

0 comments on commit 536fd77

Please sign in to comment.