initial git commit saving configs
This commit is contained in:
15
shared-db/postgres-nodeport.yaml
Normal file
15
shared-db/postgres-nodeport.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: shared-postgres-nodeport
|
||||
namespace: db
|
||||
spec:
|
||||
type: NodePort
|
||||
selector:
|
||||
cnpg.io/cluster: shared-postgres
|
||||
role: primary
|
||||
ports:
|
||||
- name: postgres
|
||||
port: 5432
|
||||
targetPort: 5432
|
||||
nodePort: 30432
|
||||
28
shared-db/postgres.yaml
Normal file
28
shared-db/postgres.yaml
Normal file
@@ -0,0 +1,28 @@
|
||||
apiVersion: postgresql.cnpg.io/v1
|
||||
kind: Cluster
|
||||
metadata:
|
||||
name: shared-postgres
|
||||
namespace: db
|
||||
spec:
|
||||
instances: 1
|
||||
|
||||
storage:
|
||||
pvcTemplate:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: pvc-shared-postgres
|
||||
volumeMode: Filesystem
|
||||
imageName: ghcr.io/cloudnative-pg/postgresql:16
|
||||
|
||||
bootstrap:
|
||||
initdb:
|
||||
database: dbtest
|
||||
owner: admin
|
||||
secret:
|
||||
name: shared-postgres-app
|
||||
postInitApplicationSQL:
|
||||
- ALTER USER admin WITH SUPERUSER;
|
||||
- CREATE EXTENSION vector;
|
||||
22
shared-db/pv-shared-postgres.yaml
Normal file
22
shared-db/pv-shared-postgres.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolume
|
||||
metadata:
|
||||
name: pv-shared-postgres
|
||||
spec:
|
||||
capacity:
|
||||
storage: 100Gi
|
||||
volumeMode: Filesystem
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
persistentVolumeReclaimPolicy: Retain
|
||||
storageClassName: shared-postgres
|
||||
local:
|
||||
path: /storage/shared-postgres
|
||||
nodeAffinity:
|
||||
required:
|
||||
nodeSelectorTerms:
|
||||
- matchExpressions:
|
||||
- key: kubernetes.io/hostname
|
||||
operator: In
|
||||
values:
|
||||
- master
|
||||
12
shared-db/pvc-shared-postgres.yaml
Normal file
12
shared-db/pvc-shared-postgres.yaml
Normal file
@@ -0,0 +1,12 @@
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: pvc-shared-postgres
|
||||
namespace: db
|
||||
spec:
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
resources:
|
||||
requests:
|
||||
storage: 100Gi
|
||||
storageClassName: shared-postgres
|
||||
Reference in New Issue
Block a user