feat: Add Gitea

This commit is contained in:
2026-01-22 12:31:52 +01:00
parent 0801c0c6c7
commit ad258bf3fe
11 changed files with 72 additions and 61 deletions
+33
View File
@@ -0,0 +1,33 @@
apiVersion: barmancloud.cnpg.io/v1
kind: ObjectStore
metadata:
name: hel-store
namespace: gitea
spec:
retentionPolicy: "7d"
configuration:
destinationPath: s3://obx-cnpg/hel1/gitea-db
endpointURL: https://hel1.your-objectstorage.com
s3Credentials:
accessKeyId:
name: cnpg-s3
key: access_key
secretAccessKey:
name: cnpg-s3
key: access_secret
wal:
compression: snappy
---
apiVersion: postgresql.cnpg.io/v1
kind: ScheduledBackup
metadata:
name: gitea-db
namespace: gitea
spec:
schedule: "0 0 1 * * *"
backupOwnerReference: self
cluster:
name: gitea-db
method: plugin
pluginConfiguration:
name: barman-cloud.cloudnative-pg.io
+11
View File
@@ -0,0 +1,11 @@
apiVersion: postgresql.cnpg.io/v1
kind: Cluster
metadata:
name: gitea-db
namespace: gitea
spec:
instances: 1
imageName: ghcr.io/cloudnative-pg/postgresql:18-system-trixie
storage:
resizeInUseVolumes: true
size: 10Gi
+25
View File
@@ -0,0 +1,25 @@
apiVersion: dragonflydb.io/v1alpha1
kind: Dragonfly
metadata:
name: dragonfly-gitea
namespace: gitea
spec:
replicas: 1
resources:
requests:
cpu: 150m
memory: 256Mi
limits:
memory: 256Mi
args:
- --dbfilename=dump # Static filename prevents disk exhaustion
- --maxmemory=$(MAX_MEMORY)Mi # Graceful memory management (90% of limit)
- --proactor_threads=1 # Auto-detect CPU cores (optimal threading)
- --cluster_mode=emulated
- --logtostderr
env:
- name: MAX_MEMORY
valueFrom:
resourceFieldRef:
resource: limits.memory
divisor: 1Mi
+42
View File
@@ -0,0 +1,42 @@
{{- if .Values.clusterConfig.argo.enabled }}
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
name: gitea
namespace: argocd
annotations:
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
finalizers:
- resources-finalizer.argocd.argoproj.io
spec:
destination:
namespace: gitea
server: https://kubernetes.default.svc
project: sys
sources:
- repoURL: {{ .Values.clusterConfig.manifests }}
targetRevision: HEAD
path: helmfile.d
plugin:
name: helmfile-cmp
env:
- name: CLUSTER_NAME
value: {{ .Values.clusterConfig.cluster }}
- name: HELMFILE_ENVIRONMENT
value: {{ .Values.gitea.env }}
- name: HELMFILE_FILE_PATH
value: gitea.yaml.gotmpl
syncPolicy:
managedNamespaceMetadata:
labels:
component: sys
syncOptions:
- CreateNamespace=true
- ApplyOutOfSyncOnly=true
# - ServerSideApply=true
{{- if .Values.gitea.autosync }}
automated:
prune: true
# selfHeal: false
{{- end }}
{{- end }}
+11
View File
@@ -0,0 +1,11 @@
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
name: gitea-db-monitor
namespace: gitea
spec:
selector:
matchLabels:
cnpg.io/cluster: gitea-db
podMetricsEndpoints:
- port: metrics