135 lines
No EOL
2.9 KiB
YAML
135 lines
No EOL
2.9 KiB
YAML
# Complete Forgejo deployment with all services
|
|
---
|
|
# Namespace
|
|
apiVersion: v1
|
|
kind: Namespace
|
|
metadata:
|
|
name: forgejo
|
|
---
|
|
# PVC for Forgejo data using Ceph RBD
|
|
apiVersion: v1
|
|
kind: PersistentVolumeClaim
|
|
metadata:
|
|
name: forgejo-data-rbd
|
|
namespace: forgejo
|
|
annotations:
|
|
volume.beta.kubernetes.io/mount-options: "discard"
|
|
spec:
|
|
accessModes:
|
|
- ReadWriteOnce
|
|
storageClassName: ceph-rbd
|
|
resources:
|
|
requests:
|
|
storage: 50Gi
|
|
---
|
|
# Main Forgejo Deployment
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: forgejo
|
|
namespace: forgejo
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: forgejo
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: forgejo
|
|
spec:
|
|
securityContext:
|
|
runAsUser: 1000
|
|
runAsGroup: 1000
|
|
fsGroup: 1000
|
|
containers:
|
|
- name: forgejo
|
|
image: codeberg.org/forgejo/forgejo:1.21-rootless
|
|
ports:
|
|
- containerPort: 3000
|
|
name: http
|
|
- containerPort: 2222
|
|
name: ssh
|
|
env:
|
|
- name: USER_UID
|
|
value: "1000"
|
|
- name: USER_GID
|
|
value: "1000"
|
|
- name: FORGEJO__database__DB_TYPE
|
|
value: postgres
|
|
- name: FORGEJO__database__HOST
|
|
value: 10.0.19.5:5432
|
|
- name: FORGEJO__database__NAME
|
|
value: forgejo
|
|
- name: FORGEJO__database__USER
|
|
value: forgejo
|
|
- name: FORGEJO__database__PASSWD
|
|
value: fj8K3n2Qp9Lx5mW7
|
|
- name: FORGEJO__server__ROOT_URL
|
|
value: https://git.tail683b6.ts.net/
|
|
- name: FORGEJO__server__DOMAIN
|
|
value: git.tail683b6.ts.net
|
|
- name: FORGEJO__server__SSH_DOMAIN
|
|
value: git.tail683b6.ts.net
|
|
- name: FORGEJO__DEFAULT__APP_NAME
|
|
value: "w5isp's code"
|
|
volumeMounts:
|
|
- name: data
|
|
mountPath: /data
|
|
resources:
|
|
requests:
|
|
memory: "256Mi"
|
|
cpu: "100m"
|
|
limits:
|
|
memory: "1Gi"
|
|
cpu: "1000m"
|
|
volumes:
|
|
- name: data
|
|
persistentVolumeClaim:
|
|
claimName: forgejo-data-rbd
|
|
---
|
|
# Service for MetalLB LoadBalancer
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: forgejo
|
|
namespace: forgejo
|
|
spec:
|
|
type: LoadBalancer
|
|
selector:
|
|
app: forgejo
|
|
ports:
|
|
- port: 80
|
|
targetPort: 3000
|
|
protocol: TCP
|
|
name: http
|
|
- port: 22
|
|
targetPort: 2222
|
|
protocol: TCP
|
|
name: ssh
|
|
---
|
|
# Service for Tailscale exposure
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: forgejo-tailscale
|
|
namespace: forgejo
|
|
annotations:
|
|
tailscale.com/expose: "true"
|
|
tailscale.com/hostname: "git"
|
|
tailscale.com/tags: "tag:k8s"
|
|
tailscale.com/funnel: "true"
|
|
spec:
|
|
type: LoadBalancer
|
|
loadBalancerClass: tailscale
|
|
selector:
|
|
app: forgejo
|
|
ports:
|
|
- port: 80
|
|
targetPort: 3000
|
|
protocol: TCP
|
|
name: http
|
|
- port: 22
|
|
targetPort: 2222
|
|
protocol: TCP
|
|
name: ssh |