machine-controller-manager icon indicating copy to clipboard operation
machine-controller-manager copied to clipboard

Add OS details in `machine` spec

Open etiennnr opened this issue 2 years ago • 4 comments

How to categorize this issue?

/area ops-productivity robustness /kind enhancement /priority 3

What would you like to be added: Context: I'm trying to detect shoots that are in failed state with either k8s or worker version expired. However, when a version is expired in the cloudProfile (aka later than the expiration date), the shoots yaml is automatically updated at the first maintenance period (aka max 24h after). This means that the k8s and worker version data in the shoot yaml is not "trustable" for my use case.

So I have to go get that data from either the seed or the shoot itself. It's pretty easy for the k8s version (simply get the /version of the shoot's kapi) but it's proving to be much harder than expected for the workers...

In order to compare the versions with the cloudProfile, I need both the OS name and version. So I first tried looking at the nodes directly. There's the .status.nodeInfo.osImage but that data is a string (eg. Garden Linux 934.8) so I'd have to create a regex that supports all ways of displaying the OS name + version. Also, this is quite cumbersome, and the version is not always the same as in the cloud profile depending on the OS.

So, instead, I'd like to have that data (os name and os version) as an annotation / spec in the machine (and/or machineDeployment, machineclass, machinesets, node).

Why is this needed: When running some reports, we want to be able to fetch the version of the actual nodes in the shoot vs what's in the cloud profile.

etiennnr avatar Dec 12 '23 15:12 etiennnr

I like to have a look if no objections. /assign

tedteng avatar Jan 05 '24 01:01 tedteng

Post Grooming Decision:-

Two options:-

  1. Add an annotation on the machine after creation which will reflect the OS version and name.
  2. Add immutable status fields in the machine status for OS name and version.

We will go with option 1 for ease of implementation.

rishabh-11 avatar Jan 11 '24 10:01 rishabh-11

Add an annotation on the machine after creation which will reflect the OS version and name.

Thanks. I will follow this option. /assign

tedteng avatar Jan 17 '24 02:01 tedteng

Change in Post Grooming Decision:-

It is not possible for MCM to get the OS name and version from the current information that it has. The extension providers do have the information of os name and version via the worker custom resource. The decision is made to make a change in respective gardener extension providers to add two labels in the machine class while generating it.

rishabh-11 avatar Jan 25 '24 10:01 rishabh-11

/reopen as changes are not done in all extensions

rishabh-11 avatar Mar 08 '24 04:03 rishabh-11

all extension PRs merged and closed

tedteng avatar Apr 22 '24 01:04 tedteng

Since all PRs have been merged and everything has been released (except for OpenStack, which should happen within the next 2 weeks), I think we can close this issue. Thanks y'all for your support :)

etiennnr avatar May 14 '24 12:05 etiennnr