From 36e6a069390f57d26f793b5b2b358e8f4ef797cf Mon Sep 17 00:00:00 2001 From: kisfenyo Date: Tue, 30 Dec 2025 15:59:39 +0100 Subject: [PATCH] gitea moved to shared DB --- gitea-system/gitea.yaml | 101 +--------------------------------------- 1 file changed, 2 insertions(+), 99 deletions(-) diff --git a/gitea-system/gitea.yaml b/gitea-system/gitea.yaml index bbe7866..9ea47f1 100644 --- a/gitea-system/gitea.yaml +++ b/gitea-system/gitea.yaml @@ -53,8 +53,9 @@ spec: value: "1000" - name: GITEA__database__DB_TYPE value: postgres + # Database - using shared PostgreSQL in database-system namespace - name: GITEA__database__HOST - value: gitea-postgres:5432 + value: postgresql-rw.database-system.svc.cluster.local:5432 - name: GITEA__database__NAME value: gitea - name: GITEA__database__USER @@ -177,69 +178,6 @@ spec: path: /mnt/4_hdd/data/gitea/repositories type: DirectoryOrCreate --- -apiVersion: apps/v1 -kind: Deployment -metadata: - labels: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres - name: gitea-postgres - namespace: gitea-system -spec: - replicas: 1 - selector: - matchLabels: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres - strategy: - type: Recreate - template: - metadata: - labels: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres - spec: - containers: - - name: postgres - image: postgres:16-alpine - imagePullPolicy: IfNotPresent - env: - - name: POSTGRES_USER - valueFrom: - secretKeyRef: - name: gitea-db - key: username - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: gitea-db - key: password - - name: POSTGRES_DB - value: gitea - - name: PGDATA - value: /var/lib/postgresql/data/pgdata - ports: - - containerPort: 5432 - name: postgres - protocol: TCP - resources: - limits: - cpu: 500m - memory: 512Mi - requests: - cpu: 100m - memory: 128Mi - volumeMounts: - - name: data - mountPath: /var/lib/postgresql/data - subPath: data - securityContext: - fsGroup: 999 - volumes: - - name: data - persistentVolumeClaim: - claimName: gitea-postgres ---- apiVersion: v1 kind: Service metadata: @@ -264,25 +202,6 @@ spec: app.kubernetes.io/instance: gitea app.kubernetes.io/name: gitea --- -apiVersion: v1 -kind: Service -metadata: - labels: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres - name: gitea-postgres - namespace: gitea-system -spec: - type: ClusterIP - ports: - - name: postgres - port: 5432 - protocol: TCP - targetPort: postgres - selector: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres ---- apiVersion: networking.k8s.io/v1 kind: Ingress metadata: @@ -339,19 +258,3 @@ spec: requests: storage: 10Gi storageClassName: longhorn ---- -apiVersion: v1 -kind: PersistentVolumeClaim -metadata: - labels: - app.kubernetes.io/instance: gitea - app.kubernetes.io/name: postgres - name: gitea-postgres - namespace: gitea-system -spec: - accessModes: - - ReadWriteOnce - resources: - requests: - storage: 5Gi - storageClassName: longhorn