bottlerocket-os / bottlerocket

An operating system designed for hosting containers
https://bottlerocket.dev
Other
8.65k stars 511 forks source link

Zero Config EKS Launches #2510

Open webern opened 1 year ago

webern commented 1 year ago

Currently, we need to provide the EKS cluster's api-server and cluster-certificate in Bottlerocket's settings.kubernetes or else a Bottlerocket instance will not know how to join the EKS cluster.

However, this information is discoverable. In https://github.com/bottlerocket-os/bottlerocket/pull/1547 we gave pluto the ability to call the EKS API to get the cluster's DNS setting.

https://github.com/bottlerocket-os/bottlerocket/blob/5e931725bd00311edcb7cddd9a97ea3f30f1a4bc/sources/api/pluto/src/main.rs#L312..L322

Why not also get it's api-server and cluster-certificate settings?

Challenge

With the current design, multiple calls to pluto would be required, we should consider a design that can set multiple settings with a single call to pluto.

Extensions of the idea:

For extra-credit we could even get its settings.kubernetes.cluster-name from the instance tags (for example if it was launched from an EKS console or launch template), though this might not be desirable.

Another possible extension would be to start in standalone mode when the cluster-name cannot be determined from tags. This would give users a quickl/easy way to launch and try Bottlerocket without any config or cluster.

etungsten commented 1 year ago

The other approach is described in https://github.com/bottlerocket-os/bottlerocket/issues/1845. We should decide if we want to pursue that in which case would completely deprecate pluto