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

Add additional fields to GCPManagedMachinePool #944

Conversation

akshay196-rafay
Copy link
Contributor

What type of PR is this?

/kind api-change

What this PR does / why we need it:

Support additional fields to GCPManagedMachinePool kind.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Part of #906

Special notes for your reviewer:

Please confirm that if this PR changes any image versions, then that's the sole change this PR makes.

TODOs:

  • squashed commits
  • includes documentation

Release note:

Support additional fields to GCPManagedMachinePool type.

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API labels Jun 6, 2023
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 6, 2023

CLA Signed

The committers listed above are authorized under a signed CLA.

  • ✅ login: akshay196-rafay / name: Akshay Gaikwad (a3bbeb3)

@k8s-ci-robot k8s-ci-robot requested a review from cpanato June 6, 2023 18:13
@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Jun 6, 2023
@k8s-ci-robot k8s-ci-robot requested a review from dims June 6, 2023 18:13
@k8s-ci-robot
Copy link
Contributor

Welcome @akshay196-rafay!

It looks like this is your first PR to kubernetes-sigs/cluster-api-provider-gcp 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes-sigs/cluster-api-provider-gcp has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 6, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @akshay196-rafay. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jun 6, 2023
@richardcase
Copy link
Member

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 20, 2023
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. and removed cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. labels Aug 16, 2023
@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch from 9228eed to acef7b1 Compare August 16, 2023 17:36
@akshay196-rafay akshay196-rafay marked this pull request as ready for review August 16, 2023 17:36
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 16, 2023
@akshay196-rafay akshay196-rafay changed the title Add multiple new fields to GCPManagedMachinePool Add additional fields to GCPManagedMachinePool Aug 16, 2023
@akshay196-rafay
Copy link
Contributor Author

@richardcase This PR is now ready for review.

@richardcase
Copy link
Member

@akshay196-rafay - i think we should perhaps re-think the approach going forward. So that we split the aditions up into smaller PRs where each contains:

  • A small number of API additions
  • Reconciliation changes for the new API fields
  • Updates to the e2e

I appreciate this is following the original approach for the GKE implementation but i think it may be better for to do this incrementally.

wdyt?

@akshay196-rafay
Copy link
Contributor Author

i think we should perhaps re-think the approach going forward. So that we split the aditions up into smaller PRs where each contains:

A small number of API additions
Reconciliation changes for the new API fields
Updates to the e2e

I appreciate this is following the original approach for the GKE implementation but i think it may be better for to do this incrementally.

I understand where you're coming from. Since GCPManagedMachinePool's new fields are comparatively less I can continue working on this same PR to add reconciliation changes, validation webhooks and e2e of GCPManagedMachinePool.

For the GCPManagedControlPlane PR raised by @aniruddha2000 we can take the incremental approach something like this -

Steps 1
Add new API fields - Description, ClusterNetwork, DefaultNodeLocation, DefaultMaxPodsPerNode
Add reconciliation and webhook for same
Update e2e for these fields

Steps 2
Add new API fields - ClusterSecurity, AddonsConfig, LoggingConfig, MonitoringConfig
Add reconciliation and webhook for same
Update e2e for these fields

@richardcase
Copy link
Member

richardcase commented Aug 22, 2023

@akshay196-rafay - sounds good to me 👍 Ping me when the reconciliation for the new fields has been added. Thank you for taking this work on.

@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch from acef7b1 to 11b6d09 Compare August 25, 2023 11:57
@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch from 11b6d09 to cd97dfa Compare September 1, 2023 14:57
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Sep 1, 2023
@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch from cd97dfa to b92aa31 Compare September 7, 2023 09:44
@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch 4 times, most recently from ff9b4f3 to d3425ba Compare October 4, 2023 11:15
@akshay196-rafay
Copy link
Contributor Author

@richardcase @gzcharleszhang Addressed your review comments.

Copy link
Contributor

@gzcharleszhang gzcharleszhang left a comment

Choose a reason for hiding this comment

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

1 nit comment otherwise LGTM. I'll wait for @richardcase and @cpanato to take a look/approve.

err = s.updateNodePoolVersionOrImage(ctx, nodePoolUpdateVersionOrImage)
needUpdateNodePool, nodePoolUpdateNodePool := s.checkDiffAndPrepareUpdateNodePool(nodePool)
if needUpdateNodePool {
log.Info("Node pool version/labels/taints/locations/image type/network tags update required")
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this can just be something like Node pool config update required, we may update other fields here as well.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@akshay196-rafay akshay196-rafay force-pushed the gcpmanagedmachinepool-additional-fields branch from d3425ba to 86f466b Compare October 5, 2023 10:21
Copy link
Member

@richardcase richardcase left a comment

Choose a reason for hiding this comment

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

Thanks @akshay196-rafay , this looks good to me. Just one small nit.

@@ -354,6 +354,27 @@ func (s *Service) checkDiffAndPrepareUpdateVersionOrImage(existingNodePool *cont
Taints: desiredKubernetesTaints,
}
}
// Locations
desiredLocations := s.scope.GCPManagedMachinePool.Spec.NodeLocations
if !reflect.DeepEqual(desiredLocations, existingNodePool.Locations) {
Copy link
Member

Choose a reason for hiding this comment

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

Can we change this to use cmp.Equals?

(and also the other instances below)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated.

@richardcase
Copy link
Member

Thanks @akshay196-rafay. From my side:

/approve

What do you think @gzcharleszhang or @richardchen331 ?

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 27, 2023
@richardcase
Copy link
Member

@cpanato - in case you have some spare cycles to have a look and lgtm if you think its ok.

Copy link
Contributor

@gzcharleszhang gzcharleszhang left a comment

Choose a reason for hiding this comment

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

LGTM

@k8s-ci-robot
Copy link
Contributor

@gzcharleszhang: changing LGTM is restricted to collaborators

In response to this:

LGTM

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@richardchen331
Copy link
Contributor

Thanks @akshay196-rafay. From my side:

/approve

What do you think @gzcharleszhang or @richardchen331 ?

LGTM. Thanks for the contribution @akshay196-rafay!

@k8s-ci-robot
Copy link
Contributor

@richardchen331: changing LGTM is restricted to collaborators

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Member

@cpanato cpanato left a comment

Choose a reason for hiding this comment

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

thanks so much and sorry for the delay

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 5, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akshay196-rafay, cpanato, gzcharleszhang, richardcase, richardchen331

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [cpanato,richardcase]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit d4689a3 into kubernetes-sigs:main Nov 5, 2023
13 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v1.1.0 milestone Nov 5, 2023
@akshay196-rafay akshay196-rafay deleted the gcpmanagedmachinepool-additional-fields branch November 5, 2023 13:07
@akshay196-rafay
Copy link
Contributor Author

Thank you @richardcase, @gzcharleszhang, @richardchen331 and @cpanato for reviewing and merging this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants