Skip to content

Support cloud-agnostic K8s config variable names#151

Open
alexrashed wants to merge 1 commit into
mainfrom
support-cloud-agnostic-k8s-vars
Open

Support cloud-agnostic K8s config variable names#151
alexrashed wants to merge 1 commit into
mainfrom
support-cloud-agnostic-k8s-vars

Conversation

@alexrashed

@alexrashed alexrashed commented Jun 30, 2026

Copy link
Copy Markdown
Member

Motivation

An upcoming LocalStack release renames the Kubernetes runtime configuration variables to cloud-agnostic names, effective from the 2026.07 release. The old names continue to work as deprecated fallbacks on newer versions, but the new names do not exist on older versions — so the chart must choose names based on the image version.

LocalStack now uses CalVer image tags (2026.06.0, 2026.05.4, …), so "higher than 2026.06" maps directly onto the tag's YYYY.MM.

Changes

  • _helpers.tpl: new localstack.useNewK8sVars helper that parses the image tag's leading year.month and returns truthy only when it is > 2026.06. Rolling / non-CalVer tags (latest, stable, dev, bare year) are treated as newest → new names, consistent with the chart's existing convention for unknown tags.

  • deployment.yaml: the three affected env vars now switch names based on version:

    Legacy (≤ 2026.06) New (> 2026.06)
    LOCALSTACK_K8S_NAMESPACE K8S_NAMESPACE
    LAMBDA_K8S_LABELS K8S_LABELS
    LAMBDA_K8S_SECURITY_CONTEXT K8S_CONTAINER_SECURITY_CONTEXT

    The other LOCALSTACK_K8S_* vars (SERVICE_NAME, POD_IP, POD_UID, POD_NAME, DEPLOYMENT_METHOD) are not part of the rename and are left untouched.

  • Chart.yaml: version bump 0.7.00.7.1.

Testing

  • helm template verified across 13 tag scenarios:
    • new names: latest, stable, dev, 2026, 2026.07.0, 2026.7, 2026.12.0, 2027.01.0
    • legacy names: 2026.06.0, 2026.06, 2026.6.0, 2025.12.0, 0.14.0, 1.4.0
  • helm lint passes (default and 2026.07.0).

Note (pre-existing, out of scope)

The security-context env var is gated on .Values.lambda.securityContext (camelCase) while values.yaml defines lambda.security_context (snake_case). This mismatch pre-dates this PR and means the var is not emitted when configured via the documented value; left unchanged here to keep the scope limited to the variable renaming.

🤖 Generated with Claude Code

@alexrashed alexrashed marked this pull request as draft June 30, 2026 12:54
… 2026.06

An upcoming LocalStack release renames the Kubernetes runtime config
variables to cloud-agnostic names starting with the 2026.07 release:

  LOCALSTACK_K8S_NAMESPACE      -> K8S_NAMESPACE
  LAMBDA_K8S_LABELS             -> K8S_LABELS
  LAMBDA_K8S_SECURITY_CONTEXT   -> K8S_CONTAINER_SECURITY_CONTEXT

Add a localstack.useNewK8sVars helper that inspects the CalVer image tag and
emits the new names only when the version is > 2026.06, falling back to the
legacy names on older versions (where the new names do not exist). Rolling
and non-CalVer tags (latest, stable, dev, ...) are treated as newest,
consistent with the rest of the chart.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@alexrashed alexrashed force-pushed the support-cloud-agnostic-k8s-vars branch from 3facf80 to 108a9b9 Compare June 30, 2026 12:56
@alexrashed alexrashed changed the title Support cloud-agnostic Kubernetes config variable names (LocalStack > 2026.06) Support cloud-agnostic K8s config variable names Jun 30, 2026
@alexrashed alexrashed requested a review from a team June 30, 2026 13:09
@alexrashed alexrashed marked this pull request as ready for review June 30, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant