feat(k8s/gitea): add Gitea with PostgreSQL, backups, and Authelia OIDC

This commit is contained in:
2026-04-29 22:45:42 +03:00
parent db633544c6
commit 191da01138
12 changed files with 617 additions and 5 deletions

View File

@@ -0,0 +1,111 @@
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: default-deny-ingress
namespace: gitea
spec:
podSelector: {}
policyTypes:
- Ingress
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ingress-controller
namespace: gitea
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: gitea
policyTypes:
- Ingress
ingress:
- from:
- namespaceSelector:
matchLabels:
kubernetes.io/metadata.name: traefik
---
# NodePort 32022 routes to pod port 2222 (rootless SSH listen port)
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-ssh-from-outside
namespace: gitea
spec:
podSelector:
matchLabels:
app.kubernetes.io/name: gitea
policyTypes:
- Ingress
ingress:
- ports:
- port: 2222
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-app-to-db
namespace: gitea
spec:
podSelector:
matchLabels:
app: gitea-db
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app.kubernetes.io/name: gitea
ports:
- port: 5432
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-backup-to-db
namespace: gitea
spec:
podSelector:
matchLabels:
app: gitea-db
policyTypes:
- Ingress
ingress:
- from:
- podSelector:
matchLabels:
app: gitea-backup
ports:
- port: 5432
---
apiVersion: networking.k8s.io/v1
kind: NetworkPolicy
metadata:
name: allow-backup-egress
namespace: gitea
spec:
podSelector:
matchLabels:
app: gitea-backup
policyTypes:
- Egress
egress:
- ports:
- port: 53
protocol: UDP
- port: 53
protocol: TCP
- ports:
- port: 8888
protocol: TCP
- ports:
- port: 443
protocol: TCP
- ports:
- port: 5432
protocol: TCP
to:
- podSelector:
matchLabels:
app: gitea-db