cluster-api-provider-gcp icon indicating copy to clipboard operation
cluster-api-provider-gcp copied to clipboard

Adding GCPMachinePool Functionality

Open BrennenMM7 opened this issue 2 years ago • 30 comments
trafficstars

What type of PR is this? /kind feature

What this PR does / why we need it: This PR Implements GCPMachinePool using Managed Instance Groups. This is needed to support the CAPI MachinePools object. Feature will allow cluster operators to deploy GCP MIG's to their CAPG clusters to take advantage of both Google Autoscaling of Compute Instances or utilizing cluster autoscaler to dynamically provision node resources.

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

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:

  • [X] squashed commits
  • [ ] includes documentation
  • [ ] adds unit tests

Release note:

Feature: adds MachinePool/GCPMachinePool Objects to deploy Managed Instance Group services. 

BrennenMM7 avatar Apr 18 '23 20:04 BrennenMM7

Welcome @BrennenMM7!

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. :smiley:

k8s-ci-robot avatar Apr 18 '23 20:04 k8s-ci-robot

Hi @BrennenMM7. 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 avatar Apr 18 '23 20:04 k8s-ci-robot

@BrennenMM7: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/ok-to-test

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 avatar Apr 18 '23 20:04 k8s-ci-robot

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BrennenMM7 Once this PR has been reviewed and has the lgtm label, please ask for approval from cpanato. For more information see the Kubernetes Code Review Process.

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

Needs approval from an approver in each of these files:

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 avatar Aug 30 '23 18:08 k8s-ci-robot

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jan 21 '24 08:01 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle rotten
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Feb 20 '24 08:02 k8s-triage-robot

Deploy Preview for kubernetes-sigs-cluster-api-gcp ready!

Name Link
Latest commit 3f4e888dcf9748820c0c2b5c0ac27069248f4691
Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-cluster-api-gcp/deploys/664b768b53ff470008c520a0
Deploy Preview https://deploy-preview-901--kubernetes-sigs-cluster-api-gcp.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

netlify[bot] avatar Mar 06 '24 04:03 netlify[bot]

I've had a chat during the CAPG meeting with @BrennenMM7.

@BrennenMM7 and team would like some thoughts on the overall design of the API, mainly from maintainers. Once that is agreed on they can write E2Es to prove this works and ensure regression checks on future changes.

/cc. @cpanato @richardcase @dims

damdo avatar Apr 04 '24 16:04 damdo

PR needs rebase.

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-sigs/prow repository.

k8s-ci-robot avatar May 10 '24 16:05 k8s-ci-robot

@BrennenMM7 this will need a rebase :)

damdo avatar May 15 '24 11:05 damdo

need rebase

cpanato avatar May 20 '24 13:05 cpanato

@damdo @cpanato PR has been rebased thanks 💯

BrennenMM7 avatar May 20 '24 16:05 BrennenMM7

@BrennenMM7: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-cluster-api-provider-gcp-verify 3f4e888dcf9748820c0c2b5c0ac27069248f4691 link true /test pull-cluster-api-provider-gcp-verify
pull-cluster-api-provider-gcp-test 3f4e888dcf9748820c0c2b5c0ac27069248f4691 link true /test pull-cluster-api-provider-gcp-test

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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-sigs/prow repository. I understand the commands that are listed here.

k8s-ci-robot avatar May 20 '24 16:05 k8s-ci-robot

PR needs rebase.

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-sigs/prow repository.

k8s-ci-robot avatar May 30 '24 23:05 k8s-ci-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

k8s-triage-robot avatar Jun 30 '24 00:06 k8s-triage-robot

@k8s-triage-robot: Closed this PR.

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Reopen this PR with /reopen
  • Mark this PR as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close

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-sigs/prow repository.

k8s-ci-robot avatar Jun 30 '24 00:06 k8s-ci-robot

/reopen

damdo avatar Jun 30 '24 09:06 damdo

@damdo: Reopened this PR.

In response to this:

/reopen

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-sigs/prow repository.

k8s-ci-robot avatar Jun 30 '24 09:06 k8s-ci-robot

/remove-lifecycle rotten

damdo avatar Jun 30 '24 09:06 damdo

Hey @BrennenMM7. We discussed previously the fact that we do not want to create a Kubeadm dependency, which was an issue with other providers too. I think we can do something similar to what CAPZ did here which decouples the MachinePool reconciler from Kubeadm. What do you think?

salasberryfin avatar Jul 02 '24 06:07 salasberryfin

@salasberryfin 👋 Yeah this looks good, I can easily port my changes to support this, I'll update and rebase this PR this week.

BrennenMM7 avatar Jul 08 '24 16:07 BrennenMM7

Hey @BrennenMM7, would you be able to update this PR?

salasberryfin avatar Sep 24 '24 15:09 salasberryfin

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Dec 23 '24 16:12 k8s-triage-robot

/remove-lifecycle stale

aslafy-z avatar Dec 24 '24 01:12 aslafy-z

Thanks @aslafy-z. I think this is a relevant feature that should be supported by the provider but I see there's not much activity in this PR. @BrennenMM7, could you take a look at this?

salasberryfin avatar Jan 02 '25 09:01 salasberryfin

@salasberryfin 👋 Hey sorry for the inactive PR, I no longer have access to the same resources for CAPG development. I can pull forward my PR and try to add the previous items about agnostic bootstrap providers. However testing E2E would be under my own dime so best I can do is a test suite.

BrennenMM7 avatar Jan 03 '25 23:01 BrennenMM7

For reference, this is a PR to abstract the same mechanism in CAPV: https://github.com/kubernetes-sigs/cluster-api-provider-azure/pull/5416

anmazzotti avatar Feb 06 '25 14:02 anmazzotti

Thanks for doing this @BrennenMM7 . I rebased and made a few very small tweaks and was able to get this working at head: https://github.com/kubernetes-sigs/cluster-api-provider-gcp/compare/main...justinsb:cluster-api-provider-gcp:tweak_gcp_machine_pool

I did have three suggestions/questions above (do we want to drain / should we use GCPMachine / do we need to block on kubeadm abstraction). But I propose that as this feature is experimental, we should merge and iterate. Maybe the GCPMachine vs GCPMachinePoolMachine is more blocking because it's a schema change...

In terms of landing this, I'm happy to create a PR with these commits as the start (keeping the author on them and more clearly marking things I had to change), or I can rebase and just make myself a Co-Author so that @BrennenMM7 gets the main credit (having done the bulk of the work here). I'll have to rebase anyway I believe so even in the first approach these commits will be changed a bit (I think).

justinsb avatar Mar 17 '25 23:03 justinsb

@justinsb 👋 Super awesome to see a Google dev in the CAPG project. Thanks for picking up where I left this PR, I have had zero time/resources to pull this thing forward to head. Your branch looks solid to me, thanks for leaving me as a co-author.

I agree with you iteration is how I normally approach my projects, so the dropping of support for N number of bootstrap providers for someone to add the logic in later seems like the best approach to finally get this thing merged as a feature. However I more or less was just following the thread of maintainers in the project.

BrennenMM7 avatar Mar 27 '25 17:03 BrennenMM7

The Kubernetes project currently lacks enough contributors to adequately respond to all PRs.

This bot triages PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the PR is closed

You can:

  • Mark this PR as fresh with /remove-lifecycle stale
  • Close this PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Jun 25 '25 18:06 k8s-triage-robot