add(gitea): postgres

This commit is contained in:
nold 2022-12-13 21:35:35 +01:00
parent 3cd2dbe352
commit 78cf0be942
2 changed files with 76 additions and 14 deletions

View file

@ -0,0 +1,57 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: gitea-db
namespace: gitea
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:15
bootstrap:
initdb:
import:
type: microservice
databases:
- gitea
source:
externalCluster: gitea
backup:
barmanObjectStore:
destinationPath: "s3://gitea-db/"
endpointURL: "http://minio.minio.svc.cluster.local:9000"
s3Credentials:
accessKeyId:
name: bucket
key: accesskey
secretAccessKey:
name: bucket
key: secretkey
wal:
compression: gzip
#encryption: AES256
data:
compression: gzip
#encryption: AES256
retentionPolicy: "90d"
resources:
requests:
memory: "64Mi"
cpu: "50m"
limits:
memory: "1Gi"
cpu: "1"
storage:
size: 10Gi
externalClusters:
- name: gitea
connectionParameters:
host: gitea-postgresql.gitea.svc.cluster.local
user: gitea
dbname: gitea
password:
name: postgres
key: postgresql-password

View file

@ -27,8 +27,8 @@ securityContext:
drop: drop:
- ALL - ALL
# # https://gitea.com/gitea/helm-chart/issues/161 # # https://gitea.com/gitea/helm-chart/issues/161
# add: add:
# - SYS_CHROOT - SYS_CHROOT
privileged: false privileged: false
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
runAsGroup: 1000 runAsGroup: 1000
@ -104,6 +104,8 @@ gitea:
config: config:
APP_NAME: "Git with a lot of coffee" APP_NAME: "Git with a lot of coffee"
webhook:
ALLOWED_HOST_LIST: argocd-server.argocd.svc.cluster.local
ui: ui:
DEFAULT_THEME: arc-green DEFAULT_THEME: arc-green
repository: repository:
@ -114,7 +116,8 @@ gitea:
DOMAIN: git.nold.in DOMAIN: git.nold.in
ROOT_URL: https://git.nold.in ROOT_URL: https://git.nold.in
database: database:
HOST: gitea-postgresql.gitea.svc.cluster.local:5432 NAME: app
HOST: gitea-db-rw.gitea.svc.cluster.local:5432
service: service:
DISABLE_REGISTRATION: true DISABLE_REGISTRATION: true
lfs: lfs:
@ -128,20 +131,22 @@ gitea:
oauth: oauth:
ENABLE: false ENABLE: false
additionalConfigFromEnvs:
- name: ENV_TO_INI__DATABASE__PASSWD
valueFrom:
secretKeyRef:
name: gitea-db-app
key: password
- name: ENV_TO_INI__DATABASE__USER
valueFrom:
secretKeyRef:
name: gitea-db-app
key: username
memcached: memcached:
enabled: true enabled: true
service: service:
port: 11211 port: 11211
postgresql: postgresql:
enabled: true enabled: false
global:
#storageClass: slow
postgresql:
existingSecret: postgres
persistence:
size: 10Gi
psp:
create: true
rbac:
create: true