nxtgauge-gitops/apps/forgejo/deployment.yaml
Ashwin Kumar Sivakumar cbc7fb42e6 fix: restore all services after registry wipe
- Fix PostgreSQL endpoints (now auto-creating correctly)
- Fix Forgejo DB connection
- Update retention to keep 10 SHA tags (was 2, too aggressive)
- Update all deployments to use available tags
- Add missing base images to registry (alpine, node, rust, python)
- Protect base images from retention deletion
2026-06-13 00:25:51 +05:30

168 lines
3.9 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: forgejo
---
apiVersion: v1
kind: ConfigMap
metadata:
name: forgejo-config
namespace: forgejo
data:
app.ini: |
RUN_MODE = prod
RUN_USER = forge
[server]
DOMAIN = ci.nxtgauge.com
HTTP_PORT = 3000
ROOT_URL = https://ci.nxtgauge.com/
DISABLE_SSH = false
SSH_PORT = 22
LFS_OBJECTS_PATH = /data/gitea/lfs
[database]
DB_TYPE = postgres
HOST = pg-postgresql.data.svc.cluster.local:5432
NAME = forgejo
USER = nxtgauge
PASSWD = chandan2026@1
SSL_MODE = disable
[security]
INSTALL_LOCK = true
SECRET_KEY = eF4nC8wQ3rT2yU9iO5pA1sD6fG7hJ8kL0zXcVbNmMqWeRtY
[service]
DISABLE_REGISTRATION = false
[log]
MODE = console
LEVEL = info
[packages]
ENABLED = true
[packages.container]
ENABLED = true
REGISTRY_TYPE = docker-registry
REGISTRY_URL = https://registry.nxtgauge.com
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: forgejo-data
namespace: forgejo
spec:
accessModes:
- ReadWriteOnce
storageClassName: longhorn
resources:
requests:
storage: 10Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: forgejo
namespace: forgejo
labels:
app: forgejo
spec:
replicas: 1
selector:
matchLabels:
app: forgejo
strategy:
type: Recreate
template:
metadata:
labels:
app: forgejo
spec:
containers:
- name: forgejo
image: codeberg.org/forgejo/forgejo:10
imagePullPolicy: IfNotPresent
ports:
- containerPort: 3000
name: http
env:
- name: FORGEJO__SERVER__ROOT_URL
value: "https://ci.nxtgauge.com/"
- name: FORGEJO__DATABASE__HOST
value: "pg-postgresql.data.svc.cluster.local"
- name: FORGEJO__DATABASE__PORT
value: "5432"
- name: FORGEJO__DATABASE__NAME
value: "forgejo"
- name: FORGEJO__DATABASE__USER
value: "nxtgauge"
- name: FORGEJO__DATABASE__PASSWD
value: "chandan2026@1"
- name: FORGEJO__PACKAGES__ENABLED
value: "true"
- name: FORGEJO__PACKAGES__CONTAINER__ENABLED
value: "true"
- name: FORGEJO__PACKAGES__CONTAINER__REGISTRY_TYPE
value: "docker-registry"
- name: FORGEJO__PACKAGES__CONTAINER__REGISTRY_URL
value: "https://registry.nxtgauge.com"
volumeMounts:
- mountPath: /data
name: data
resources:
limits:
cpu: "1"
memory: 512Mi
requests:
cpu: 100m
memory: 256Mi
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 30
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 60
periodSeconds: 30
volumes:
- name: data
persistentVolumeClaim:
claimName: forgejo-data
---
apiVersion: v1
kind: Service
metadata:
name: forgejo-http
namespace: forgejo
spec:
selector:
app: forgejo
ports:
- port: 3000
targetPort: 3000
name: http
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: forgejo
namespace: forgejo
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
spec:
ingressClassName: traefik
tls:
- hosts:
- ci.nxtgauge.com
secretName: forgejo-tls
rules:
- host: ci.nxtgauge.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: forgejo-http
port:
number: 3000