ForgejoKubernetes/deployment.yaml

90 lines
2.1 KiB
YAML
Raw Permalink Normal View History

2024-10-09 20:59:24 +05:00
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: forgejo-deployment
labels:
app: forgejo
spec:
replicas: 1
selector:
matchLabels:
app: forgejo-web
template:
metadata:
labels:
app: forgejo-web
spec:
containers:
- name: forgejo-web
image: codeberg.org/forgejo/forgejo:8
env:
- name: USER_UID
value: "1000"
- name: USER_GID
value: "1000"
- name: FORGEJO__database__DB_TYPE
value: postgres
- name: FORGEJO__database__HOST
value: forgejo-db-service:5432
- name: FORGEJO__database__NAME
value: forgejo
- name: FORGEJO__database__USER
value: forgejo
- name: FORGEJO__database__PASSWD
valueFrom:
secretKeyRef:
name: postgresdb-password
key: POSTGRES_PASSWORD
ports:
- containerPort: 3000
- containerPort: 22
volumeMounts:
- name: forgejo-data
mountPath: /data
volumes:
- name: forgejo-data
hostPath:
path: /opt/forgejo/forgejo
type: Directory
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: forgejo-deployment-db
labels:
app: forgejo-db
spec:
replicas: 1
selector:
matchLabels:
app: forgejo-db
template:
metadata:
labels:
app: forgejo-db
spec:
containers:
- name: forgejo-db
image: postgres:16-alpine
env:
- name: POSTGRES_USER
value: "forgejo"
- name: POSTGRES_DB
value: "forgejo"
- name: POSTGRES_PASSWORD
valueFrom:
secretKeyRef:
name: postgresdb-password
key: POSTGRES_PASSWORD
ports:
- containerPort: 5432
volumeMounts:
- name: forgejo-db-data
mountPath: /var/lib/postgresql/data
volumes:
- name: forgejo-db-data
hostPath:
path: /opt/forgejo/postgres
type: Directory