3 Angajamente d3da449bdc ... ca7fe1f49f

Autor SHA1 Permisiunea de a trimite mesaje. Dacă este dezactivată, utilizatorul nu va putea trimite nici un fel de mesaj Data
  Breandan Dezendorf ca7fe1f49f change postgres service name 11 luni în urmă
  Breandan Dezendorf 4ff2b12428 Fixed postgres-mas 11 luni în urmă
  Breandan Dezendorf efbc084158 Adding postgres-mas 11 luni în urmă

+ 1 - 1
dezendorf/homelab/k3s/matrix/matrix.yaml

@@ -364,7 +364,7 @@ data:
       public_base: https://matrix-auth.dezendorf.net
       issuer: https://matrix-auth.dezendorf.net
     database:
-      host: postgres
+      host: postgres-mas
       port: 5432
       username: mas_user
       password: "Bee1701Charming1!"

+ 13 - 0
dezendorf/homelab/k3s/postgres/postgres-claim.yaml

@@ -0,0 +1,13 @@
+apiVersion: v1
+kind: PersistentVolumeClaim
+metadata:
+  name: postgres-mas-volume-claim
+  labels:
+    app: postgres-mas
+spec:
+  storageClassName: longhorn
+  accessModes:
+    - ReadWriteMany
+  resources:
+    requests:
+      storage: 10Gi

+ 10 - 0
dezendorf/homelab/k3s/postgres/postgres-cm.yaml

@@ -0,0 +1,10 @@
+apiVersion: v1
+kind: ConfigMap
+metadata:
+  name: postgres-mas-secret
+  labels:
+    app: postgres-mas
+data:
+  POSTGRES_DB: psql_db
+  POSTGRES_USER: psql_user
+  POSTGRES_PASSWORD: Bee1701Charming1!

+ 37 - 0
dezendorf/homelab/k3s/postgres/postgres-deployment.yaml

@@ -0,0 +1,37 @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: postgres-mas
+spec:
+  replicas: 1
+  selector:
+    matchLabels:
+      app: postgres-mas
+  template:
+    metadata:
+      labels:
+        app: postgres-mas
+    spec:
+      initContainers:
+      - name: init-database
+        image: busybox
+        command: ['sh', '-c', 'rm -rf /var/lib/postgresql/data/lost+found']
+        volumeMounts:
+            - mountPath: /var/lib/postgresql/data
+              name: postgresdata-mas
+      containers:
+        - name: postgres
+          image: 'postgres:14'
+          imagePullPolicy: IfNotPresent
+          ports:
+            - containerPort: 5432
+          envFrom:
+            - configMapRef:
+                name: postgres-mas-secret
+          volumeMounts:
+            - mountPath: /var/lib/postgresql/data
+              name: postgresdata-mas
+      volumes:
+        - name: postgresdata-mas
+          persistentVolumeClaim:
+            claimName: postgres-mas-volume-claim

+ 14 - 0
dezendorf/homelab/k3s/postgres/postgres-pv.yaml

@@ -0,0 +1,14 @@
+apiVersion: v1
+kind: PersistentVolume
+metadata:
+  name: postgres-mas-volume
+  labels:
+    app: postgres-mas
+spec:
+  storageClassName: longhorn
+  capacity:
+    storage: 10Gi
+  accessModes:
+    - ReadWriteOnce
+  hostPath:
+    path: /data/postgresql-mas

+ 12 - 0
dezendorf/homelab/k3s/postgres/postgres-service.yaml

@@ -0,0 +1,12 @@
+apiVersion: v1
+kind: Service
+metadata:
+  name: postgres-mas
+  labels:
+    app: postgres-mas
+spec:
+  type: NodePort
+  ports:
+    - port: 5432
+  selector:
+    app: postgres-mas