Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support customize deployment strategy type #50

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

hcsu
Copy link
Contributor

@hcsu hcsu commented Feb 16, 2023

Support disable rolling update (.spec.strategy.type can be Recreate)

  • Default: .spec.strategy.type = RollingUpdate
  • Disable rolling update: set withoutRollingUpdate = true

Ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy

@hcsu hcsu requested a review from a team February 16, 2023 05:29
@hcsu hcsu changed the title Support custom deployment strategy type Support customize deployment strategy type Feb 16, 2023
@hcsu hcsu marked this pull request as draft February 16, 2023 05:34
@hcsu
Copy link
Contributor Author

hcsu commented Feb 16, 2023

Test

Testing ./plantbuild show ./example/k8s/tests/test_set_images.jsonnet -v 1.2.3
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
test.sh: line 29: printf: -n: invalid option
printf: usage: printf [-v var] format [arguments]
test.sh: line 30: printf: -n: invalid option
printf: usage: printf [-v var] format [arguments]
.

Testing ./plantbuild show ./example/build.jsonnet -v 1.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/dep.jsonnet -v 1.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/test_customized_deps.jsonnet -v 1.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/test.jsonnet -v 1.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/app1.jsonnet -v 1.0.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/all.jsonnet -v 2.1.0
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
..

Testing ./plantbuild show ./example/k8s/tests/test_probe_cm.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/tests/test_multi_hosts.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/tests/test_configmap_envmap_pullsecrets.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
......

Testing ./plantbuild show ./example/k8s/tests/test_change_default_namespace.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.......

Testing ./plantbuild show ./example/k8s/tests/test_volumes.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
..

Testing ./plantbuild show ./example/k8s/tests/test_image_without_tag_default_to_githash.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/tests/test_image2url_with_hpa.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
...

Testing ./plantbuild show ./example/k8s/tests/test_deployment_with_hpa.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
...

Testing ./plantbuild show ./example/k8s/tests/test_job.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
.

Testing ./plantbuild show ./example/k8s/tests/test_pod_spec.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
...

Testing ./plantbuild show ./example/k8s/tests/test_container_lifecycle.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
..

Testing ./plantbuild show ./example/k8s/cronjob.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
...

Testing ./plantbuild show ./example/k8s/tests/test_image2url_without_rolling_update.jsonnet
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
..

@hcsu hcsu marked this pull request as ready for review February 16, 2023 07:25
Copy link
Member

@geckofu geckofu left a comment

Choose a reason for hiding this comment

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

I think the withoutRollingUpdate param is too specific (i.e: what if there are new strategy in the future?)
I suggest that we use a plain string param stategy with acceptable values: ['RollingUpdate', 'Recreate'].
Also we need to add validations to make sure strategy = 'Recreate' is not used along with the maxSurge param.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants