diff --git a/manifests/configmap.yaml b/manifests/configmap.yaml index 544cfbf..89d7c4c 100644 --- a/manifests/configmap.yaml +++ b/manifests/configmap.yaml @@ -7,6 +7,7 @@ data: APP_NAME: Halia hosted git solution RUN_MODE: prod GITEA__server__DISABLE_SSH: "true" + GITEA__server__ROOT_URL: "https://git.beta.halia.dev" GITEA__security__INSTALL_LOCK: "true" GITEA__service__DISABLE_REGISTRATION: "true" GITEA__metrics__ENABLED: "true" diff --git a/manifests/database.yaml b/manifests/database.yaml index e86f8ce..23ce029 100644 --- a/manifests/database.yaml +++ b/manifests/database.yaml @@ -1,26 +1,27 @@ -kind: "postgresql" -apiVersion: "acid.zalan.do/v1" - +apiVersion: postgresql.cnpg.io/v1 +kind: Cluster metadata: - name: "gitea" - namespace: "gitea" - labels: - team: acid + name: gitea-db + namespace: gitea spec: - teamId: "acid" + instances: 1 + + storage: + size: 1Gi + storageClass: flat-storage-class + + bootstrap: + initdb: + database: gitea + owner: gitea + secret: + name: gitea-db + postgresql: - version: "15" - numberOfInstances: 1 - volume: - size: "1Gi" - storageClass: "flat-storage-class" - users: - gitea: [] - databases: - gitea: gitea - allowedSourceRanges: - # IP ranges to access your cluster go here + pg_hba: + - host all all all md5 + resources: requests: cpu: 100m diff --git a/manifests/deployment.yaml b/manifests/deployment.yaml index c34afaa..6b9906a 100644 --- a/manifests/deployment.yaml +++ b/manifests/deployment.yaml @@ -29,7 +29,7 @@ spec: - name: GITEA__database__DB_TYPE value: "postgres" - name: GITEA__database__HOST - value: "gitea.gitea.svc.cluster.local:5432" + value: "gitea-db-rw.gitea.svc.cluster.local:5432" - name: GITEA__database__NAME value: "gitea" - name: GITEA__database__SSL_MODE @@ -37,12 +37,12 @@ spec: - name: GITEA__database__USER valueFrom: secretKeyRef: - name: gitea.gitea.credentials.postgresql.acid.zalan.do + name: gitea-db key: username - name: GITEA__database__PASSWD valueFrom: secretKeyRef: - name: gitea.gitea.credentials.postgresql.acid.zalan.do + name: gitea-db key: password - name: GITEA__server__LFS_JWT_SECRET valueFrom: @@ -76,10 +76,12 @@ spec: - mountPath: "/admin-creator.sh" name: gitea-admin-creator subPath: admin-creator.sh + - mountPath: "/data" + name: gitea-data volumes: - - name: gitea-pv - hostPath: - path: "/mnt/gitea" + - name: gitea-data + persistentVolumeClaim: + claimName: gitea-pvc - name: gitea-config-volume configMap: name: gitea-config diff --git a/manifests/kustomization.yaml b/manifests/kustomization.yaml index 0719848..745c82c 100644 --- a/manifests/kustomization.yaml +++ b/manifests/kustomization.yaml @@ -9,4 +9,5 @@ resources: - ingress.yaml - configmap.yaml - admin-creator.yaml + - pvc.yaml - deployment.yaml diff --git a/manifests/pvc.yaml b/manifests/pvc.yaml new file mode 100644 index 0000000..a7f9ed3 --- /dev/null +++ b/manifests/pvc.yaml @@ -0,0 +1,12 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: gitea-pvc + namespace: gitea +spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: 5Gi + storageClassName: flat-storage-class