Add deployment strategy to vtgate#676
Merged
Merged
Conversation
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
There was a problem hiding this comment.
Pull Request Overview
This PR introduces a deployment strategy field to the vtgate CRD so that users can customize the vtgate deployment in Kubernetes similarly to standard Deployment objects. Key changes include:
- Adding a new "strategy" field in the vtgate CRD and updating related deep copy functions.
- Modifying the operator code to propagate the new deployment strategy field.
- Adjusting the CRDs, YAML test files, and documentation to reflect the new deployment strategy support.
Reviewed Changes
Copilot reviewed 11 out of 14 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/endtoend/operator/operator-latest.yaml | Adds the deployment strategy field to the vtgate operator spec. |
| test/endtoend/operator/cluster_upgrade.yaml | Configures the deployment strategy in the upgrade test workload. |
| pkg/operator/vtgate/deployment.go | Sets the new Strategy field when updating the deployment. |
| pkg/controller/vitesscell/reconcile_vtgate.go | Propagates the new Strategy field from the CRD to the deployment. |
| pkg/apis/planetscale/v2/zz_generated.deepcopy.go | Adds deep copy handling for the new Strategy field. |
| pkg/apis/planetscale/v2/vitesscell_types.go | Updates the CRD spec to include the Strategy field. |
| docs/api.md | Documents the new strategy field in the API reference. |
| deploy/role_binding.yaml | Renames a role binding from vitess-operator-subcontroller to vitess-operator-backup-storage. |
| deploy/role.yaml | Renames a role from vitess-operator-subcontroller to vitess-operator-backup-storage. |
| deploy/crds/planetscale.com_vitessclusters.yaml | Adds the deployment strategy schema to the CRD. |
| deploy/crds/planetscale.com_vitesscells.yaml | Adds the deployment strategy schema to the CRD. |
Files not reviewed (3)
- docs/api/index.html: Language not supported
- go.mod: Language not supported
- test/endtoend/upgrade_test.sh: Language not supported
Comments suppressed due to low confidence (2)
deploy/role_binding.yaml:4
- [nitpick] The role binding name change to 'vitess-operator-backup-storage' may be unexpected since the PR title focuses on adding deployment strategy to vtgate. Please confirm that this renaming aligns with the intended responsibilities and update documentation if necessary.
name: vitess-operator-backup-storage
deploy/role.yaml:4
- [nitpick] The role name change to 'vitess-operator-backup-storage' deviates from the expected naming convention for vtgate. Verify that this change is intentional and update related references or documentation accordingly.
name: vitess-operator-backup-storage
frouioui
commented
Mar 27, 2025
| kind: Role | ||
| metadata: | ||
| name: vitess-operator-subcontroller | ||
| name: vitess-operator-backup-storage |
Member
Author
There was a problem hiding this comment.
This is from a previous bad commit, we had inconsistencies, sometimes it was -subcontroller and sometimes -backup-storage.
Modifying everything back to -backup-storage.
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
maxenglander
approved these changes
Mar 27, 2025
72 tasks
deepthi
approved these changes
Mar 28, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR fixes #533 by allowing end-users to define a rolling update strategy (https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy) for their vtgate deployments.
The upgrade test has been modified to ensure the strategy is correctly applied to the vtgate deployment.
This Pull Request must be merged/reviewed alongside with vitessio/vitess#18063.