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