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

Implement GCPMachinePool using MIGs

Open CecileRobertMichon opened this issue 5 years ago • 20 comments
trafficstars

/kind feature

Describe the solution you'd like [A clear and concise description of what you want to happen.]

Implement GCPMachinePool using Managed Instance Groups. The GCPMachinePool implementation should follow the same package / group structure as CAPI and be added to the exp package, the experimental feature package. The feature should be gated using the MachinePool flag used in CAPI.

See also: kubernetes-sigs/cluster-api-provider-azure#483 and CAPI Machine Pool Proposal

Anything else you would like to add: [Miscellaneous information that will assist in solving the issue.]

Note: As noted below in comments, the https://github.com/kubernetes-sigs/cluster-api/pull/7107 also be supported/implemented as part of this

CecileRobertMichon avatar May 13 '20 20:05 CecileRobertMichon

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Aug 11 '20 20:08 fejta-bot

/remove-lifecycle stale

CecileRobertMichon avatar Aug 11 '20 20:08 CecileRobertMichon

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta. /lifecycle stale

fejta-bot avatar Nov 09 '20 20:11 fejta-bot

/lifecycle frozen /help

detiber avatar Dec 01 '20 20:12 detiber

@detiber: This request has been marked as needing help from a contributor.

Please ensure the request meets the requirements listed here.

If this request no longer meets these requirements, the label can be removed by commenting with the /remove-help command.

In response to this:

/lifecycle frozen /help

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 Dec 01 '20 20:12 k8s-ci-robot

Hey, would like to work on this. Can I assign it myself?

jayesh-srivastava avatar Oct 02 '21 07:10 jayesh-srivastava

/assign

jayesh-srivastava avatar Oct 03 '21 04:10 jayesh-srivastava

@jayesh-srivastava just curious if you are still working on this? Myself or another colleague of mine might have some cycles to pick this up if you need any help.

evanfreed avatar Aug 15 '22 19:08 evanfreed

@CecileRobertMichon could we also add as a requirement to this ticket that (if actually merged) the externally-managed autoscaller annotation is also supported / implemented as part of this?

AverageMarcus avatar Aug 28 '22 07:08 AverageMarcus

@AverageMarcus added a note in description

CecileRobertMichon avatar Aug 29 '22 16:08 CecileRobertMichon

Perfect! Thank you!

AverageMarcus avatar Aug 29 '22 16:08 AverageMarcus

I have pinged @jayesh-srivastava via Slack and he told me that he is not able to work on this issue due to personal commitments. @evanfreed and myself are going to work on it unless there is any objection.

nsilve avatar Sep 08 '22 08:09 nsilve

Pending blockers:

  • https://github.com/kubernetes-sigs/cluster-api-provider-gcp/issues/643
  • https://github.com/GoogleCloudPlatform/k8s-cloud-provider/pull/71
  • https://github.com/kubernetes-sigs/cluster-api/pull/7107

nsilve avatar Sep 08 '22 08:09 nsilve

/assign @nsilve

evanfreed avatar Sep 09 '22 14:09 evanfreed

/unassign @jayesh-srivastava

evanfreed avatar Sep 09 '22 14:09 evanfreed

Azure does not support any kind of templating for instance creation, so all the configuration should be included into VMSS (so into AzureMachinePool). But both AWS and GCP have discrete template resources for ASG (launch template)/MIG (instance template) so we are having the following options:

  1. manage GCP instance templates internally to GCP Machine Pool controller (like CAPA)
  2. manage GCP instance templates via a separate GCP Instance Template controller
  3. something else

Right now they are not managed at all since ControlPlane machines are not created via MIG, so GCPMachineTemplate configuration is passed directly to GCPMachine. Since no actual GCP Instance Template is created right now, we will need to find a solution for it if we proceed with solution 2 because we will need to create only the instance templates which are going to be used for workers created via MIG (although creating another instance template for Control Plane won't hurt anyone but it is going to be a unused resource).

Moreover, based on GCP documentation, instance templates can be used to create both virtual machine (VM) instances and managed instance groups (MIGs). That means that we could probably define GCPMachineTemplate and use them directly into GCPMachinePool (not tested)

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPMachineTemplate
metadata:
  name: workload
spec:
  template:
    spec:
      image: projects/elastic-esp-dev/global/images/capi-ubuntu-2004-k8s-v1-24-1
      instanceType: n2-standard-2

apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
kind: GCPMachinePool
metadata:
  name: workload
spec:
  machineTemplate:
    infrastructureRef:
      apiVersion: infrastructure.cluster.x-k8s.io/v1beta1
      kind: GCPMachineTemplate
      name: workload

Any ideas/comments/objections?

nsilve avatar Sep 12 '22 19:09 nsilve

/remove-lifecycle frozen

nsilve avatar Sep 22 '22 21:09 nsilve

Plans changed so I am afraid that I cannot proceed with that.

nsilve avatar Dec 02 '22 14:12 nsilve

/unassign @nsilve

nsilve avatar Dec 02 '22 14:12 nsilve

/assign

BrennenMM7 avatar Mar 09 '23 05:03 BrennenMM7