Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ spec:
labels:
{{- include "stac-auth-proxy.selectorLabels" . | nindent 8 }}
spec:
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
serviceAccountName: {{ include "stac-auth-proxy.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.securityContext | nindent 8 }}
Expand All @@ -31,6 +32,24 @@ spec:
- name: http
containerPort: 8000
protocol: TCP
{{- with .Values.startupProbe }}
startupProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.livenessProbe }}
livenessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.readinessProbe }}
readinessProbe:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.preStopSleepSeconds }}
lifecycle:
preStop:
exec:
command: ["sleep", "{{ .Values.preStopSleepSeconds }}"]
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
env:
Expand Down
27 changes: 27 additions & 0 deletions helm/values.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,33 @@ properties:
description: "List of capabilities to drop"
description: "Container-level security context"

terminationGracePeriodSeconds:
type: integer
minimum: 1
description: "Duration in seconds the pod needs to terminate gracefully. Must be greater than preStopSleepSeconds."
default: 30

preStopSleepSeconds:
type: integer
minimum: 0
description: "Seconds to sleep in preStop hook before SIGTERM, allowing Kubernetes endpoint propagation. Set to 0 to disable."
default: 5

startupProbe:
type: object
additionalProperties: true
description: "Startup probe configuration. Disables liveness/readiness probes until startup succeeds."

livenessProbe:
type: object
additionalProperties: true
description: "Liveness probe configuration. Determines if the container should be restarted."

readinessProbe:
type: object
additionalProperties: true
description: "Readiness probe configuration. Determines if the container should receive traffic."

nodeSelector:
type: object
additionalProperties:
Expand Down
31 changes: 31 additions & 0 deletions helm/values.yaml
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to enable the health endpoint?

Currently, when running this inside a stac-auth-proxy pod container, it returns a 404:

>>> import httpx
>>> httpx.get("http://localhost:8000/healthz")
<Response [404 Not Found]>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The healthz path DOES include the root_path, are you using that? ie does http://localhost:8000/stac/healthz work?

Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,37 @@ containerSecurityContext:
drop:
- ALL

# Graceful shutdown: delays SIGTERM to allow Kubernetes endpoint propagation.
# The preStop hook runs BEFORE SIGTERM is sent, giving kube-proxy time to
# remove the pod from service endpoints so no new traffic arrives during shutdown.
# terminationGracePeriodSeconds must be > preStopSleepSeconds + app shutdown time.
terminationGracePeriodSeconds: 30
preStopSleepSeconds: 5

# Probes
# startupProbe disables liveness/readiness checks until startup succeeds,
# giving the app time to wait for upstream services (e.g. during node scaling).
startupProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 2
failureThreshold: 30 # 60s total for startup

livenessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 10
failureThreshold: 3

readinessProbe:
httpGet:
path: /healthz
port: http
periodSeconds: 5
failureThreshold: 1

nodeSelector: {}
tolerations: []
affinity: {}
Expand Down
Loading