How to execute cloud-init script on managed Kubernetes worker nodes during startup?
... / How to execute cloud-init...
BMPCreated with Sketch.BMPZIPCreated with Sketch.ZIPXLSCreated with Sketch.XLSTXTCreated with Sketch.TXTPPTCreated with Sketch.PPTPNGCreated with Sketch.PNGPDFCreated with Sketch.PDFJPGCreated with Sketch.JPGGIFCreated with Sketch.GIFDOCCreated with Sketch.DOC Error Created with Sketch.
Question

How to execute cloud-init script on managed Kubernetes worker nodes during startup?

by
ECBE
Created on 2024-10-24 14:16:29 (edited on 2024-11-18 11:20:14) in Kubernetes-old

We need to adjust some changes on the worker nodes and a cloud-init script would be the best for it because if we use auto scaling features we have to automate these changes somehow.
I have found this which is useful when a single instance is created:
https://help.ovhcloud.com/csm/en-public-cloud-compute-launch-script-at-instance-creation?id=kb_article_view&sysparm_article=KB0050912

How should we adjust it on our nodepool settings to reach that goal?
I am also aware that you can customize a nodepool from Terraform or Kubernetes CRD (they give no chance to add scripts at launch time to nodes):
https://help.ovhcloud.com/csm/en-public-cloud-kubernetes-node-pools-crd?id=kb_article_view&sysparm_article=KB0049916
https://registry.terraform.io/providers/ovh/ovh/latest/docs/resources/cloud_project_kube_nodepool