gitea: begin to phase in postgres

This commit is contained in:
Nico Schottelius 2021-06-27 19:57:52 +02:00
parent d5b6d704e4
commit 986d510802
2 changed files with 55 additions and 3 deletions

View file

@ -15,7 +15,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes # This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version. # to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/) # Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0 version: 0.1.2
# This is the version number of the application being deployed. This version number should be # This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to # incremented each time you make changes to the application. Versions are not expected to

View file

@ -35,6 +35,16 @@ spec:
mountPath: "/etc/nginx/conf.d/" mountPath: "/etc/nginx/conf.d/"
- name: etcletsencrypt - name: etcletsencrypt
mountPath: "/etc/letsencrypt" mountPath: "/etc/letsencrypt"
- name: postgres
image: postgres:13
ports:
- containerPort: 5432
envFrom:
- configMapRef:
name: {{ tpl .Values.identifier . }}-postgres-config
volumeMounts:
- name: postgres-data
mountPath: "/var/lib/postgresql/data"
- name: gitea - name: gitea
image: gitea/gitea:1.14 image: gitea/gitea:1.14
ports: ports:
@ -45,6 +55,25 @@ spec:
value: "1000" value: "1000"
- name: USER_GID - name: USER_GID
value: "1000" value: "1000"
- name: GITEA__database__DB_TYPE
value: "postgres"
- name: GITEA__database__HOST
value: "localhost"
- name: GITEA__database__NAME
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config
key: dbname
- name: GITEA__database__USER
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config
key: user
- name: GITEA__database__PASSWD
valueFrom:
configMapKeyRef:
name: {{ tpl .Values.identifier . }}-postgres-config
key: password
volumeMounts: volumeMounts:
- name: etcletsencrypt - name: etcletsencrypt
mountPath: "/etc/letsencrypt" mountPath: "/etc/letsencrypt"
@ -57,11 +86,13 @@ spec:
- name: data - name: data
persistentVolumeClaim: persistentVolumeClaim:
claimName: {{ tpl .Values.identifier . }}-data claimName: {{ tpl .Values.identifier . }}-data
- name: postgres-data
persistentVolumeClaim:
claimName: {{ tpl .Values.identifier . }}-postgres-data
- name: nginx-config - name: nginx-config
configMap: configMap:
name: {{ tpl .Values.identifier . }}-nginx-config name: {{ tpl .Values.identifier . }}-nginx-config
--- ---
apiVersion: v1 apiVersion: v1
kind: Service kind: Service
@ -113,6 +144,18 @@ spec:
storage: 100Mi storage: 100Mi
storageClassName: rook-cephfs storageClassName: rook-cephfs
--- ---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: {{ tpl .Values.identifier . }}-postgres-data
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 500Mi
storageClassName: rook-ceph-block
---
apiVersion: batch/v1 apiVersion: batch/v1
kind: Job kind: Job
metadata: metadata:
@ -151,7 +194,7 @@ spec:
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: {{ .Release.Name }}-nginx-config name: {{ tpl .Values.identifier . }}-nginx-config
data: data:
default.conf: | default.conf: |
server { server {
@ -169,3 +212,12 @@ data:
proxy_pass http://localhost:3000; proxy_pass http://localhost:3000;
} }
} }
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ tpl .Values.identifier . }}-postgres-config
data:
POSTGRES_USER: gitea
POSTGRES_PASSWORD: aiJohtoqueeng0oosh8ohfoh1chahPh3
POSTGRES_DB: gitea