gardener / machine-controller-manager

Declarative way of managing machines for Kubernetes cluster
Apache License 2.0
246 stars 113 forks source link

Add an example initialization script for MCM #768

Open himanshu-kun opened 1 year ago

himanshu-kun commented 1 year ago

How to categorize this issue?

/area usability /kind enhancement /priority 3

What would you like to be added: Currently MCM doesn't provide an example script to do the bootstrapping of its nodes. This blocks potential users to try MCM out quickly as w/o this script the machine would always be in Pending state.

Why is this needed: To give a better hands-on experience to users

AhmedMozaly commented 1 year ago

As I'm blocked right now, I can give it a try writing this example I just need some hints. I think we should use https://kubernetes.io/docs/reference/setup-tools/kubeadm/kubeadm-join/ right?

If it will make any difference, I'm using https://github.com/gardener/machine-controller-manager-provider-gcp

himanshu-kun commented 1 year ago

I am discussing this internally , will update you with the next steps , once the discussion is concluded cc @unmarshall

AhmedMozaly commented 1 year ago

Thanks @himanshu-kun for this update I would appreciate if you can share the general guidelines (even if not yet final), as I'm currently trying to write a minimal initialization script

AhmedMozaly commented 1 year ago

Hi @himanshu-kun Do you know if MCM works with GKE (managed clusters on GPC) ?

himanshu-kun commented 1 year ago

@AhmedMozaly you can write a script by taking inspiration from here https://github.com/gardener/gardener/blob/master/docs/extensions/operatingsystemconfig.md

MCM can work in any kubernetes cluster , you can deploy it as an independent entity in the kube-system namespace. Also there is no dependency on gardener for MCM. But you will need to figure out how to initialize the VM, the way GKE does in its clusters and add it, not sure if they have any documentation abt it. I am not aware what they use internally to provision VMs. Could I know your use-case?

AhmedMozaly commented 1 year ago

@himanshu-kun I've number of VMs running on GCP that are IO bound I need to manage these VMs from k8s (creating/destroying/monitoring) but without running any pods on. As the the workload running on these machines is not easy to dockerize at the moment

So, using a custom k8s controller should be a saver solution here to monitor these VMs health & destroy any one that is not healthy and create new one instead

I've a GCP GKE cluster that I'm trying to run MCM at