194 lines
5.0 KiB
YAML
194 lines
5.0 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: ai-disclosure
|
|
labels:
|
|
app.kubernetes.io/name: ai-disclosure
|
|
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
|
|
spec:
|
|
securityContext:
|
|
runAsNonRoot: true
|
|
seccompProfile:
|
|
type: RuntimeDefault
|
|
containers:
|
|
- name: app
|
|
image: ghcr.io/REPLACE_ME/ai-disclosure-standard:1.6.3
|
|
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: SALES_URL
|
|
value: https://b1tsblog.org/page/ai
|
|
- name: DEFAULT_LANGUAGE
|
|
value: de
|
|
- name: TRUST_PROXY
|
|
value: "false"
|
|
- name: LOG_CLIENT_IP
|
|
value: "false"
|
|
- name: ENABLE_HSTS
|
|
value: "true"
|
|
- name: METRICS_ENABLED
|
|
value: "false"
|
|
# Replace the following values before deployment. LEGAL_STRICT
|
|
# deliberately prevents accidental public startup with placeholders.
|
|
- name: LEGAL_STRICT
|
|
value: "true"
|
|
- name: LEGAL_NAME
|
|
value: REPLACE_ME
|
|
- name: LEGAL_ADDRESS
|
|
value: REPLACE_ME
|
|
- name: LEGAL_EMAIL
|
|
value: REPLACE_ME
|
|
- name: HOSTING_PROVIDER
|
|
value: REPLACE_ME
|
|
- name: LOG_RETENTION
|
|
value: REPLACE_ME
|
|
- name: CONSUMER_DISPUTE_STATUS
|
|
value: REPLACE_ME
|
|
- name: LICENSE_TOKEN
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: ai-disclosure-license
|
|
key: token
|
|
optional: true
|
|
- name: LICENSE_MODE
|
|
value: offline
|
|
- name: LICENSE_SERVER_URL
|
|
value: ""
|
|
- name: LICENSE_INSTANCE_ID
|
|
valueFrom:
|
|
fieldRef:
|
|
fieldPath: metadata.uid
|
|
- name: LICENSE_CACHE_FILE
|
|
value: /data/license-lease.json
|
|
volumeMounts:
|
|
- name: license-cache
|
|
mountPath: /data
|
|
resources:
|
|
requests:
|
|
cpu: 25m
|
|
memory: 24Mi
|
|
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: {}
|
|
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
|