Skip to content
Open
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
3 changes: 3 additions & 0 deletions charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,9 @@ helm install hyperfleet-api oci://REGISTRY/hyperfleet-api \
| service | object | `{"type":"ClusterIP"}` | Kubernetes Service configuration |
| service.type | string | `"ClusterIP"` | Service type (`ClusterIP`, `LoadBalancer`, `NodePort`) |
| resources | object | `{"limits":{"cpu":"500m","memory":"512Mi"},"requests":{"cpu":"100m","memory":"128Mi"}}` | CPU and memory resource requests and limits |
| lifecycle | object | `{"preStop":{"exec":{"command":["/bin/sh","-c","sleep 5"]}}}` | Container lifecycle hooks. Use `preStop` to delay SIGTERM during rolling updates, giving the LoadBalancer time to drain the old pod. See HYPERFLEET-1306. |
| strategy | object | Kubernetes default (25% maxUnavailable, 25% maxSurge) | Deployment rollout strategy. `maxUnavailable: 0` ensures zero-downtime during rolling updates — the old pod stays until the new one is Ready. |
| terminationGracePeriodSeconds | int | `30` | Seconds Kubernetes waits after SIGTERM before SIGKILL. Must be > preStop sleep (5s) + API server shutdown (10s) + buffer. The health server uses a separate 20s timeout for OTel cleanup. |
| nodeSelector | object | `{}` | Node selector constraints for pod scheduling |
| tolerations | list | `[]` | Tolerations for pod scheduling |
| affinity | object | `{}` | Affinity rules for pod scheduling |
Expand Down
11 changes: 11 additions & 0 deletions charts/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
{{- with .Values.strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
selector:
matchLabels:
{{- include "hyperfleet-api.selectorLabels" . | nindent 6 }}
Expand Down Expand Up @@ -44,6 +48,9 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "hyperfleet-api.serviceAccountName" . }}
{{- if .Values.terminationGracePeriodSeconds }}
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
{{- if and .Values.nativeSidecars (not (semverCompare ">=1.28.0-0" .Capabilities.KubeVersion.Version)) }}
Expand Down Expand Up @@ -151,6 +158,10 @@ spec:
failureThreshold: 3
resources:
{{- toYaml .Values.resources | nindent 10 }}
{{- with .Values.lifecycle }}
lifecycle:
{{- toYaml . | nindent 10 }}
{{- end }}
volumeMounts:
# ConfigMap mount - generated from values or existingConfigMap
- name: config
Expand Down
25 changes: 25 additions & 0 deletions charts/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,31 @@ resources:
cpu: 100m
memory: 128Mi

# -- Container lifecycle hooks. Use `preStop` to delay SIGTERM during
# rolling updates, giving the LoadBalancer time to drain the old pod.
# See HYPERFLEET-1306.
lifecycle:
preStop:
exec:
command:
- /bin/sh
- -c
- sleep 5

# -- Deployment rollout strategy. `maxUnavailable: 0` ensures zero-downtime
# during rolling updates — the old pod stays until the new one is Ready.
# @default -- Kubernetes default (25% maxUnavailable, 25% maxSurge)
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
Comment on lines +281 to +288

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

@default annotation misdocuments the actual shipped default.

Line 283's @default -- Kubernetes default (25% maxUnavailable, 25% maxSurge) will render into the README values table via helm-docs, but the actual committed default (lines 285-288) is maxSurge: 1, maxUnavailable: 0 — the opposite of the annotation's claim. Anyone reading the README will believe strategy defaults to k8s's built-in 25/25 behavior when it doesn't.

As per path instructions, "values.yaml has sensible defaults" and helm-chart-conventions.md requires the # --/@default comment to accurately describe the value so verify-helm-docs/make test-helm output stays trustworthy.

📝 Proposed fix
 # -- Deployment rollout strategy. `maxUnavailable: 0` ensures zero-downtime
 # during rolling updates — the old pod stays until the new one is Ready.
-# `@default` -- Kubernetes default (25% maxUnavailable, 25% maxSurge)
 strategy:
   rollingUpdate:
     maxSurge: 1
     maxUnavailable: 0
   type: RollingUpdate
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# -- Deployment rollout strategy. `maxUnavailable: 0` ensures zero-downtime
# during rolling updates — the old pod stays until the new one is Ready.
# @default -- Kubernetes default (25% maxUnavailable, 25% maxSurge)
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
# -- Deployment rollout strategy. `maxUnavailable: 0` ensures zero-downtime
# during rolling updates — the old pod stays until the new one is Ready.
strategy:
rollingUpdate:
maxSurge: 1
maxUnavailable: 0
type: RollingUpdate
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@charts/values.yaml` around lines 281 - 288, The `strategy` values block is
documented with an incorrect `@default` comment that contradicts the committed
`rollingUpdate` settings. Update the `# --`/`@default` annotation near
`strategy` in values.yaml so it matches the actual default shipped by the chart
(`rollingUpdate.maxSurge` and `rollingUpdate.maxUnavailable`), ensuring
helm-docs and `verify-helm-docs` render the README accurately.

Source: Path instructions


# -- Seconds Kubernetes waits after SIGTERM before SIGKILL.
# Must be > preStop sleep (5s) + API server shutdown (10s) + buffer.
# The health server uses a separate 20s timeout for OTel cleanup.
terminationGracePeriodSeconds: 30

# -- Node selector constraints for pod scheduling
nodeSelector: {}

Expand Down