Skip to content

jsonnetlib: Make the deployment strategy configurable - #103

Merged
hcsu merged 1 commit into
masterfrom
deployment-strategy
Oct 19, 2026
Merged

hcsu merged 1 commit into
masterfrom
deployment-strategy

Conversation

@hcsu

@hcsu hcsu commented Oct 19, 2026

Copy link
Copy Markdown
Contributor

Why

The default RollingUpdate starts the new pod before it stops the old one.

Since we added initialDelaySeconds, the two pods overlap for longer time. Some replicas=1 workers must not run two copies, so they need Recreate.

What

Add a strategy parameter to deployment() / image_to_url() in k8s.jsonnet and k8s-new.jsonnet:

  • Not set: no change.
  • Set: replaces spec.strategy as a whole.
k8s.deployment(name='some-worker', image='...', strategy={ type: 'Recreate' })

Testing

./test.sh passes. Output is unchanged when strategy is not set.

@hcsu
hcsu requested a review from a team October 19, 2026 09:39
@hcsu
hcsu merged commit c21d3fe into master Oct 19, 2026
2 checks passed
@hcsu
hcsu deleted the deployment-strategy branch October 19, 2026 09:51
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.

2 participants