initial commit
This commit is contained in:
18
prod/postgres13/README.md
Normal file
18
prod/postgres13/README.md
Normal file
@@ -0,0 +1,18 @@
|
||||
#corrupte WAL-archive
|
||||
|
||||
#postgres starten zonder database te starten door volgende toe te voegen in yaml::
|
||||
|
||||
command: ["sh"]
|
||||
args: ["-c", "while true; do echo $(date -u) >> /tmp/run.log; sleep 5; done"]
|
||||
|
||||
#dan inloggen in draaiende container
|
||||
|
||||
kubectl exec -it postgres14-0 -n postgres -- sh
|
||||
|
||||
#Switchen naar user POSTGRES
|
||||
|
||||
su postgres
|
||||
|
||||
#WAL-arhive resetten:
|
||||
|
||||
pg_resetwal /var/lib/postgresql/data -f
|
||||
11
prod/postgres13/catalog-info.yaml
Normal file
11
prod/postgres13/catalog-info.yaml
Normal file
@@ -0,0 +1,11 @@
|
||||
apiVersion: backstage.io/v1alpha1
|
||||
kind: Component
|
||||
metadata:
|
||||
name: prod-postgres13
|
||||
title: Postgres13 (prod)
|
||||
spec:
|
||||
type: service
|
||||
lifecycle: production
|
||||
owner: platform-team
|
||||
partOf:
|
||||
- ../catalog-info.yaml
|
||||
93
prod/postgres13/postgres13prod.yaml
Executable file
93
prod/postgres13/postgres13prod.yaml
Executable file
@@ -0,0 +1,93 @@
|
||||
apiVersion: v1
|
||||
kind: Namespace
|
||||
metadata:
|
||||
name: postgres
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: postgres13-pv
|
||||
spec:
|
||||
storageClassName: ""
|
||||
capacity:
|
||||
storage: 2Gi
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
mountOptions:
|
||||
- hard
|
||||
- nfsvers=4.1
|
||||
nfs:
|
||||
server: 192.168.2.110
|
||||
path: /mnt/nfs_share/postgres13prod
|
||||
readOnly: false
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: postgres13-pvc
|
||||
namespace: postgres
|
||||
spec:
|
||||
storageClassName: ""
|
||||
volumeName: postgres13-pv
|
||||
accessModes:
|
||||
- ReadWriteMany
|
||||
volumeMode: Filesystem
|
||||
resources:
|
||||
requests:
|
||||
storage: 2Gi
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
spec:
|
||||
serviceName: postgres13
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app: postgres13
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: postgres13
|
||||
spec:
|
||||
containers:
|
||||
- name: postgres13
|
||||
image: postgres:13
|
||||
ports:
|
||||
- containerPort: 5432
|
||||
env:
|
||||
- name: POSTGRES_DB
|
||||
value: zabbix
|
||||
- name: POSTGRES_USER
|
||||
value: zabbix
|
||||
- name: POSTGRES_PASSWORD
|
||||
value: zabbix
|
||||
- name: POSTGRES_EXTENSIONS
|
||||
value: pg_trgm
|
||||
volumeMounts:
|
||||
- mountPath: /var/lib/postgresql/data
|
||||
name: postgres
|
||||
volumes:
|
||||
- name: postgres
|
||||
persistentVolumeClaim:
|
||||
claimName: postgres13-pvc
|
||||
nodeSelector:
|
||||
kubernetes.io/arch: arm64
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: postgres13
|
||||
labels:
|
||||
name: postgres13
|
||||
namespace: postgres
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: 5432
|
||||
name: postgres
|
||||
selector:
|
||||
app: postgres13
|
||||
Reference in New Issue
Block a user