Skip to content

Add deployment strategy to vtgate#676

Merged
frouioui merged 3 commits into
mainfrom
add-depl-strat-to-vtgate
Mar 28, 2025
Merged

Add deployment strategy to vtgate#676
frouioui merged 3 commits into
mainfrom
add-depl-strat-to-vtgate

Conversation

@frouioui

@frouioui frouioui commented Mar 27, 2025

Copy link
Copy Markdown
Member

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.

Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread deploy/role.yaml
kind: Role
metadata:
name: vitess-operator-subcontroller
name: vitess-operator-backup-storage

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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>
Signed-off-by: Florent Poinsard <florent.poinsard@outlook.fr>
@deepthi deepthi self-requested a review March 28, 2025 04:32
@frouioui frouioui merged commit a68cd01 into main Mar 28, 2025
@frouioui frouioui deleted the add-depl-strat-to-vtgate branch March 28, 2025 15:04
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.

[Feature] allow configuring VTGate rolling update parameters

4 participants