Compare commits
4 Commits
c48ab60392
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| dd714e1484 | |||
| 296537720d | |||
| 00c7ec292f | |||
| 0baab66010 |
@@ -56,6 +56,7 @@
|
|||||||
| docs.expertfab.de | paperless | ✓ |
|
| docs.expertfab.de | paperless | ✓ |
|
||||||
| auth.expertfab.de | zitadel | ✓ |
|
| auth.expertfab.de | zitadel | ✓ |
|
||||||
| api.expertfab.de | rabbitmq | ✓ |
|
| api.expertfab.de | rabbitmq | ✓ |
|
||||||
|
| gongme.expertfab.de | gongme | ✓ |
|
||||||
| coworkbase.de | coworkbase | ✓ |
|
| coworkbase.de | coworkbase | ✓ |
|
||||||
| www.coworkbase.de | coworkbase | ✓ |
|
| www.coworkbase.de | coworkbase | ✓ |
|
||||||
| qubicticker.qchief.io | qubicticker | ✓ |
|
| qubicticker.qchief.io | qubicticker | ✓ |
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ data:
|
|||||||
10.42.71.60 api.expertfab.de
|
10.42.71.60 api.expertfab.de
|
||||||
10.42.71.60 signing.expertfab.de
|
10.42.71.60 signing.expertfab.de
|
||||||
10.42.71.60 note.expertfab.de
|
10.42.71.60 note.expertfab.de
|
||||||
|
10.42.71.60 gongme.expertfab.de
|
||||||
fallthrough
|
fallthrough
|
||||||
}
|
}
|
||||||
forward . 10.42.71.1
|
forward . 10.42.71.1
|
||||||
|
|||||||
65
k8s/gongme/api.yaml
Normal file
65
k8s/gongme/api.yaml
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: gongme-api
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 1
|
||||||
|
maxUnavailable: 0
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: gongme-api
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: gongme-api
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: gitea-registry
|
||||||
|
containers:
|
||||||
|
- name: api
|
||||||
|
image: git.expertfab.de/expertfab/ef-gongme-api:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 3001
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: gongme-env
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /api/v1/health
|
||||||
|
port: 3001
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 6
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /api/v1/health
|
||||||
|
port: 3001
|
||||||
|
initialDelaySeconds: 60
|
||||||
|
periodSeconds: 30
|
||||||
|
failureThreshold: 5
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 256Mi
|
||||||
|
limits:
|
||||||
|
cpu: 1000m
|
||||||
|
memory: 768Mi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: gongme-api
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: gongme-api
|
||||||
|
ports:
|
||||||
|
- port: 3001
|
||||||
|
targetPort: 3001
|
||||||
48
k8s/gongme/ingress.yaml
Normal file
48
k8s/gongme/ingress.yaml
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
---
|
||||||
|
apiVersion: traefik.io/v1alpha1
|
||||||
|
kind: Middleware
|
||||||
|
metadata:
|
||||||
|
name: redirect-https
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
redirectScheme:
|
||||||
|
scheme: https
|
||||||
|
permanent: true
|
||||||
|
---
|
||||||
|
apiVersion: networking.k8s.io/v1
|
||||||
|
kind: Ingress
|
||||||
|
metadata:
|
||||||
|
name: gongme
|
||||||
|
namespace: gongme
|
||||||
|
annotations:
|
||||||
|
cert-manager.io/cluster-issuer: letsencrypt
|
||||||
|
traefik.ingress.kubernetes.io/router.entrypoints: web,websecure
|
||||||
|
traefik.ingress.kubernetes.io/router.middlewares: gongme-redirect-https@kubernetescrd
|
||||||
|
spec:
|
||||||
|
ingressClassName: traefik
|
||||||
|
rules:
|
||||||
|
- host: gongme.expertfab.de
|
||||||
|
http:
|
||||||
|
paths:
|
||||||
|
# /api/* geht direkt an NestJS — kein Buffering durch oauth2-proxy
|
||||||
|
# oder Next.js-Rewrite. Kritisch fuer SSE (EventSource).
|
||||||
|
# API-Endpoints sind durch Admin-Token und Session-Slug geschuetzt.
|
||||||
|
- path: /api
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: gongme-api
|
||||||
|
port:
|
||||||
|
number: 3001
|
||||||
|
# Alles andere (App + OAuth-Flow) geht durch oauth2-proxy.
|
||||||
|
- path: /
|
||||||
|
pathType: Prefix
|
||||||
|
backend:
|
||||||
|
service:
|
||||||
|
name: oauth2-proxy
|
||||||
|
port:
|
||||||
|
number: 4180
|
||||||
|
tls:
|
||||||
|
- hosts:
|
||||||
|
- gongme.expertfab.de
|
||||||
|
secretName: gongme-tls
|
||||||
19
k8s/gongme/namespace.yaml
Normal file
19
k8s/gongme/namespace.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Namespace
|
||||||
|
metadata:
|
||||||
|
name: gongme
|
||||||
|
---
|
||||||
|
apiVersion: storage.k8s.io/v1
|
||||||
|
kind: StorageClass
|
||||||
|
metadata:
|
||||||
|
name: longhorn-gongme
|
||||||
|
provisioner: driver.longhorn.io
|
||||||
|
reclaimPolicy: Retain
|
||||||
|
allowVolumeExpansion: true
|
||||||
|
volumeBindingMode: Immediate
|
||||||
|
parameters:
|
||||||
|
numberOfReplicas: "2"
|
||||||
|
staleReplicaTimeout: "30"
|
||||||
|
fromBackup: ""
|
||||||
|
fsType: "ext4"
|
||||||
70
k8s/gongme/oauth2-proxy.yaml
Normal file
70
k8s/gongme/oauth2-proxy.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: oauth2-proxy
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: oauth2-proxy
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: oauth2-proxy
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: oauth2-proxy
|
||||||
|
image: quay.io/oauth2-proxy/oauth2-proxy:v7.7.1
|
||||||
|
args:
|
||||||
|
- --provider=oidc
|
||||||
|
- --oidc-issuer-url=https://auth.expertfab.de
|
||||||
|
- --redirect-url=https://gongme.expertfab.de/oauth2/callback
|
||||||
|
- --upstream=http://gongme-web:3000
|
||||||
|
- --http-address=0.0.0.0:4180
|
||||||
|
- --email-domain=expertfab.de
|
||||||
|
- --scope=openid profile email
|
||||||
|
- --skip-provider-button=true
|
||||||
|
- --cookie-secure=true
|
||||||
|
- --cookie-samesite=lax
|
||||||
|
- --reverse-proxy=true
|
||||||
|
- --pass-access-token=true
|
||||||
|
- --set-xauthrequest=true
|
||||||
|
env:
|
||||||
|
- name: OAUTH2_PROXY_CLIENT_ID
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: oauth2-proxy-secrets
|
||||||
|
key: OAUTH2_PROXY_CLIENT_ID
|
||||||
|
- name: OAUTH2_PROXY_CLIENT_SECRET
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: oauth2-proxy-secrets
|
||||||
|
key: OAUTH2_PROXY_CLIENT_SECRET
|
||||||
|
- name: OAUTH2_PROXY_COOKIE_SECRET
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: oauth2-proxy-secrets
|
||||||
|
key: OAUTH2_PROXY_COOKIE_SECRET
|
||||||
|
ports:
|
||||||
|
- containerPort: 4180
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 64Mi
|
||||||
|
limits:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: oauth2-proxy
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: oauth2-proxy
|
||||||
|
ports:
|
||||||
|
- port: 4180
|
||||||
|
targetPort: 4180
|
||||||
93
k8s/gongme/postgres.yaml
Normal file
93
k8s/gongme/postgres.yaml
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gongme-postgres
|
||||||
|
namespace: gongme
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
POSTGRES_DB: gongme
|
||||||
|
POSTGRES_USER: gongme
|
||||||
|
POSTGRES_PASSWORD: "gongme-prod-pw-change-me"
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: PersistentVolumeClaim
|
||||||
|
metadata:
|
||||||
|
name: gongme-postgres-data
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
accessModes: ["ReadWriteOnce"]
|
||||||
|
storageClassName: longhorn-gongme
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
storage: 5Gi
|
||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: gongme-postgres
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: Recreate
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: gongme-postgres
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: gongme-postgres
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: postgres
|
||||||
|
image: postgres:16-alpine
|
||||||
|
ports:
|
||||||
|
- containerPort: 5432
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: gongme-postgres
|
||||||
|
env:
|
||||||
|
- name: PGDATA
|
||||||
|
value: /var/lib/postgresql/data/pgdata
|
||||||
|
volumeMounts:
|
||||||
|
- name: data
|
||||||
|
mountPath: /var/lib/postgresql/data
|
||||||
|
startupProbe:
|
||||||
|
exec:
|
||||||
|
command: ["pg_isready", "-U", "gongme", "-d", "gongme"]
|
||||||
|
initialDelaySeconds: 10
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 30
|
||||||
|
readinessProbe:
|
||||||
|
exec:
|
||||||
|
command: ["pg_isready", "-U", "gongme", "-d", "gongme"]
|
||||||
|
periodSeconds: 10
|
||||||
|
livenessProbe:
|
||||||
|
exec:
|
||||||
|
command: ["pg_isready", "-U", "gongme", "-d", "gongme"]
|
||||||
|
periodSeconds: 30
|
||||||
|
failureThreshold: 5
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 100m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
volumes:
|
||||||
|
- name: data
|
||||||
|
persistentVolumeClaim:
|
||||||
|
claimName: gongme-postgres-data
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: gongme-postgres
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: gongme-postgres
|
||||||
|
ports:
|
||||||
|
- port: 5432
|
||||||
|
targetPort: 5432
|
||||||
11
k8s/gongme/secret-oauth2.yaml
Normal file
11
k8s/gongme/secret-oauth2.yaml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: oauth2-proxy-secrets
|
||||||
|
namespace: gongme
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
OAUTH2_PROXY_CLIENT_ID: "376372512671400477"
|
||||||
|
OAUTH2_PROXY_CLIENT_SECRET: "GNt6kzfSL1aTTZyjdeCyuMNjfklrWQFg6xpcvpTCodfY5CYjBsLmFrSs4rqEPGCs"
|
||||||
|
OAUTH2_PROXY_COOKIE_SECRET: "9KPXNOowiA1bZvfAmBevByHJI6wHX3+N"
|
||||||
19
k8s/gongme/secret-registry.yaml
Normal file
19
k8s/gongme/secret-registry.yaml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
# ImagePullSecret für die Gitea Container Registry.
|
||||||
|
# Analog zum gitea-registry-Secret im erpnext-Namespace.
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gitea-registry
|
||||||
|
namespace: gongme
|
||||||
|
type: kubernetes.io/dockerconfigjson
|
||||||
|
stringData:
|
||||||
|
.dockerconfigjson: |
|
||||||
|
{
|
||||||
|
"auths": {
|
||||||
|
"git.expertfab.de": {
|
||||||
|
"username": "sascha.dodenhoeft",
|
||||||
|
"password": "3f7b20874ec2f8a1ff3c3669b0483dcae3cfd76c"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
k8s/gongme/secret.yaml
Normal file
32
k8s/gongme/secret.yaml
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
---
|
||||||
|
# Application Secret — wird von api-Pod und web-Pod per envFrom geladen.
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Secret
|
||||||
|
metadata:
|
||||||
|
name: gongme-env
|
||||||
|
namespace: gongme
|
||||||
|
type: Opaque
|
||||||
|
stringData:
|
||||||
|
# --- Postgres ---
|
||||||
|
DATABASE_URL: "postgresql://gongme:gongme-prod-pw-change-me@gongme-postgres:5432/gongme?schema=public"
|
||||||
|
|
||||||
|
# --- NestJS ---
|
||||||
|
NODE_ENV: "production"
|
||||||
|
PORT: "3001"
|
||||||
|
JWT_SECRET: "change-me-random-32-chars-minimum"
|
||||||
|
PUBLIC_BASE_URL: "https://gongme.expertfab.de"
|
||||||
|
|
||||||
|
# --- SMTP (bestehendes Relay) ---
|
||||||
|
SMTP_HOST: "smtprelay.expertfab.de"
|
||||||
|
SMTP_PORT: "587"
|
||||||
|
SMTP_USER: "it-admin@expertfab.de"
|
||||||
|
SMTP_PASS: "Relay22$$"
|
||||||
|
SMTP_FROM: "gongme@expertfab.de"
|
||||||
|
|
||||||
|
# --- Web Push (VAPID) ---
|
||||||
|
VAPID_PUBLIC_KEY: "BMFgG85di4U9X-YtbvGxvuwpIS2nNjZCyPzfwMewYs9N38NTQvvDixCHzj2JGe-rCW4jyaO2ZW0DgggB5lH8NI8"
|
||||||
|
VAPID_PRIVATE_KEY: "LNd_q9vqUbH5RQUf_tgO_hJWbI3--zuaNaGyjUqfTy8"
|
||||||
|
VAPID_SUBJECT: "mailto:it-admin@expertfab.de"
|
||||||
|
|
||||||
|
# --- Next.js (web-Pod) ---
|
||||||
|
API_INTERNAL_URL: "http://gongme-api:3001"
|
||||||
70
k8s/gongme/web.yaml
Normal file
70
k8s/gongme/web.yaml
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
---
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: gongme-web
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
replicas: 1
|
||||||
|
strategy:
|
||||||
|
type: RollingUpdate
|
||||||
|
rollingUpdate:
|
||||||
|
maxSurge: 1
|
||||||
|
maxUnavailable: 0
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: gongme-web
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: gongme-web
|
||||||
|
spec:
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: gitea-registry
|
||||||
|
containers:
|
||||||
|
- name: web
|
||||||
|
image: git.expertfab.de/expertfab/ef-gongme-web:latest
|
||||||
|
imagePullPolicy: Always
|
||||||
|
ports:
|
||||||
|
- containerPort: 3000
|
||||||
|
envFrom:
|
||||||
|
- secretRef:
|
||||||
|
name: gongme-env
|
||||||
|
env:
|
||||||
|
- name: PORT
|
||||||
|
value: "3000"
|
||||||
|
- name: HOSTNAME
|
||||||
|
value: "0.0.0.0"
|
||||||
|
readinessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 3000
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 10
|
||||||
|
failureThreshold: 6
|
||||||
|
livenessProbe:
|
||||||
|
httpGet:
|
||||||
|
path: /
|
||||||
|
port: 3000
|
||||||
|
initialDelaySeconds: 30
|
||||||
|
periodSeconds: 30
|
||||||
|
failureThreshold: 5
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: 50m
|
||||||
|
memory: 128Mi
|
||||||
|
limits:
|
||||||
|
cpu: 500m
|
||||||
|
memory: 512Mi
|
||||||
|
---
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: gongme-web
|
||||||
|
namespace: gongme
|
||||||
|
spec:
|
||||||
|
selector:
|
||||||
|
app: gongme-web
|
||||||
|
ports:
|
||||||
|
- port: 3000
|
||||||
|
targetPort: 3000
|
||||||
Reference in New Issue
Block a user