Files
ai-disclosure-standard/deploy/kubernetes.yaml
jbergner 6e152a5121
Some checks failed
release-tag / release-image (push) Failing after 1m38s
2.0.2 Update und Anpassungen
2026-07-24 10:08:19 +02:00

189 lines
4.7 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: ai-disclosure
labels:
app.kubernetes.io/name: ai-disclosure
app.kubernetes.io/version: "2.0.2"
spec:
replicas: 3
strategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
selector:
matchLabels:
app.kubernetes.io/name: ai-disclosure
template:
metadata:
labels:
app.kubernetes.io/name: ai-disclosure
app.kubernetes.io/version: "2.0.2"
annotations:
prometheus.io/scrape: "true"
prometheus.io/port: "8080"
prometheus.io/path: /metrics
spec:
automountServiceAccountToken: false
securityContext:
runAsNonRoot: true
seccompProfile:
type: RuntimeDefault
containers:
- name: app
image: ghcr.io/REPLACE_ME/ai-disclosure-standard:2.0.2
imagePullPolicy: IfNotPresent
ports:
- name: http
containerPort: 8080
env:
- name: BASE_URL
value: https://ai.example.org
- name: PUBLIC_NAME
value: AI Usage Disclosure
- name: CONTACT_URL
value: https://b1tsblog.org/page/ai
- name: DEFAULT_LANGUAGE
value: de
- name: TRUST_PROXY
value: "true"
- name: SERVICE_MODE
value: full
- name: API_ALLOWED_ORIGIN
value: "*"
- name: LICENSE_TOKEN_FILE
value: /run/secrets/license/token
- name: LICENSE_MODE
value: hybrid
- name: LICENSE_SERVER_URL
value: ""
- name: LICENSE_INSTANCE_ID
valueFrom:
fieldRef:
fieldPath: metadata.uid
- name: LICENSE_CACHE_FILE
value: /data/license-lease.json
- name: WHITE_LABEL
value: "false"
volumeMounts:
- name: license-cache
mountPath: /data
- name: license-token
mountPath: /run/secrets/license
readOnly: true
resources:
requests:
cpu: 25m
memory: 32Mi
limits:
cpu: 500m
memory: 128Mi
readinessProbe:
httpGet:
path: /readyz
port: http
initialDelaySeconds: 2
periodSeconds: 5
timeoutSeconds: 2
failureThreshold: 3
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 5
periodSeconds: 10
timeoutSeconds: 2
failureThreshold: 3
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
drop: ["ALL"]
volumes:
- name: license-cache
emptyDir: {}
- name: license-token
secret:
secretName: ai-disclosure-license
optional: true
items:
- key: token
path: token
topologySpreadConstraints:
- maxSkew: 1
topologyKey: kubernetes.io/hostname
whenUnsatisfiable: ScheduleAnyway
labelSelector:
matchLabels:
app.kubernetes.io/name: ai-disclosure
---
apiVersion: v1
kind: Service
metadata:
name: ai-disclosure
spec:
selector:
app.kubernetes.io/name: ai-disclosure
ports:
- name: http
port: 80
targetPort: http
---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: ai-disclosure
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: ai-disclosure
---
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: ai-disclosure
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: ai-disclosure
minReplicas: 3
maxReplicas: 12
behavior:
scaleDown:
stabilizationWindowSeconds: 300
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 65
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: ai-disclosure
annotations:
nginx.ingress.kubernetes.io/proxy-read-timeout: "15"
nginx.ingress.kubernetes.io/proxy-send-timeout: "15"
nginx.ingress.kubernetes.io/limit-rps: "50"
spec:
ingressClassName: nginx
tls:
- hosts: [ai.example.org]
secretName: ai-disclosure-tls
rules:
- host: ai.example.org
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: ai-disclosure
port:
name: http