Fixes DEV-350. During pod startup, Dozzle takes ~11 seconds to start accepting connections, but oauth2-proxy can receive and proxy requests immediately. This causes "connection refused" errors when users access the UI right after a pod restart. Solution: - Add startupProbe with 30s timeout (15 failures × 2s) to give Dozzle time to start without failing readiness - Add readinessProbe to prevent traffic routing until Dozzle is ready - Add livenessProbe to restart container if Dozzle becomes unhealthy All probes use the /healthcheck endpoint on port 8080. Co-Authored-By: Paperclip <noreply@paperclip.ing>
127 lines
3.3 KiB
YAML
127 lines
3.3 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: dozzle
|
|
namespace: dozzle
|
|
spec:
|
|
replicas: 1
|
|
strategy:
|
|
type: Recreate
|
|
selector:
|
|
matchLabels:
|
|
app: dozzle
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: dozzle
|
|
spec:
|
|
serviceAccountName: dozzle
|
|
containers:
|
|
- name: dozzle
|
|
image: amir20/dozzle:latest
|
|
ports:
|
|
- containerPort: 8080
|
|
name: dozzle-http
|
|
protocol: TCP
|
|
env:
|
|
- name: DOZZLE_MODE
|
|
value: "k8s"
|
|
- name: DOZZLE_LEVEL
|
|
value: "info"
|
|
- name: DOZZLE_AUTH_PROVIDER
|
|
value: "forward-proxy"
|
|
- name: DOZZLE_AUTH_HEADER_USER
|
|
value: "X-Forwarded-User"
|
|
- name: DOZZLE_AUTH_HEADER_EMAIL
|
|
value: "X-Forwarded-Email"
|
|
- name: DOZZLE_AUTH_HEADER_NAME
|
|
value: "X-Forwarded-Preferred-Username"
|
|
- name: DOZZLE_NO_ANALYTICS
|
|
value: "true"
|
|
startupProbe:
|
|
httpGet:
|
|
path: /healthcheck
|
|
port: 8080
|
|
initialDelaySeconds: 5
|
|
periodSeconds: 2
|
|
timeoutSeconds: 1
|
|
successThreshold: 1
|
|
failureThreshold: 15
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /healthcheck
|
|
port: 8080
|
|
periodSeconds: 5
|
|
timeoutSeconds: 1
|
|
successThreshold: 1
|
|
failureThreshold: 2
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /healthcheck
|
|
port: 8080
|
|
periodSeconds: 10
|
|
timeoutSeconds: 1
|
|
successThreshold: 1
|
|
failureThreshold: 3
|
|
volumeMounts:
|
|
- name: dozzle-data
|
|
mountPath: /data
|
|
resources:
|
|
limits:
|
|
cpu: 500m
|
|
memory: 512Mi
|
|
requests:
|
|
cpu: 100m
|
|
memory: 128Mi
|
|
- name: oauth2-proxy
|
|
image: quay.io/oauth2-proxy/oauth2-proxy:latest
|
|
ports:
|
|
- containerPort: 4180
|
|
name: http
|
|
protocol: TCP
|
|
args:
|
|
- --http-address=0.0.0.0:4180
|
|
- --upstream=http://127.0.0.1:8080
|
|
- --provider=oidc
|
|
- --oidc-issuer-url=https://auth.basicstack.de
|
|
- --redirect-url=https://dozzle.basicstack.de/oauth2/callback
|
|
- --email-domain=*
|
|
- --pass-user-headers=true
|
|
- --set-xauthrequest=true
|
|
- --pass-access-token=false
|
|
- --cookie-secure=true
|
|
- --cookie-httponly=true
|
|
- --cookie-name=__Host-oauth2-proxy
|
|
- --cookie-expire=12h
|
|
- --code-challenge-method=S256
|
|
- --proxy-websockets=true
|
|
- --pass-host-header=true
|
|
- --flush-interval=1s
|
|
- --upstream-timeout=30s
|
|
env:
|
|
- name: OAUTH2_PROXY_CLIENT_ID
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: dozzle-oidc
|
|
key: client-id
|
|
- name: OAUTH2_PROXY_CLIENT_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: dozzle-oidc
|
|
key: client-secret
|
|
- name: OAUTH2_PROXY_COOKIE_SECRET
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: dozzle-oidc
|
|
key: cookie-secret
|
|
resources:
|
|
limits:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
requests:
|
|
cpu: 50m
|
|
memory: 64Mi
|
|
volumes:
|
|
- name: dozzle-data
|
|
persistentVolumeClaim:
|
|
claimName: dozzle-data
|