Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
11 changes: 10 additions & 1 deletion chart/templates/s3proxy/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,18 @@ spec:
runAsUser: 1000
readOnlyRootFilesystem: true
allowPrivilegeEscalation: false
# Drain on scale-in: the sleep keeps the pod accepting while it drops
# out of the headless-service DNS (HAProxy stops routing new
# connections), then SIGTERM lets uvicorn finish in-flight requests.
# Killing a pod mid-UploadPart/UploadPartCopy orphans multipart state
# and the client's CompleteMultipartUpload fails with InvalidPart.
lifecycle:
preStop:
exec:
command: ["sleep", "10"]
securityContext:
fsGroup: 1000
terminationGracePeriodSeconds: 30
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
Expand Down
7 changes: 7 additions & 0 deletions chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,13 @@ resources:
cpu: "500m"
memory: "512Mi"

# Must cover the longest single request: one large UploadPart/UploadPartCopy
# can run for minutes against a slow backend, and cutting it off mid-flight
# orphans multipart state (InvalidPart on complete). uvicorn exits as soon as
# in-flight requests finish, so a generous ceiling costs nothing in the
# common case.
terminationGracePeriodSeconds: 600

# s3proxy container probes. Overridable so deployments can tolerate a busy
# single event loop: under heavy upload load a probe can take seconds to be
# served, and a tight liveness timeout restarts a live pod (drops in-flight
Expand Down