gardenctl-v2 icon indicating copy to clipboard operation
gardenctl-v2 copied to clipboard

Add CLI option to select which machine type to use for the bastion

Open etiennnr opened this issue 3 months ago • 2 comments

What would you like to be added: When running gardenctl ssh, make the instance type created for the bastion be configurable.

Why is this needed: This is a problem since some regions only has specific instance type.

I had this problem while trying to ssh in a GCP node, but I guess this can also happen in other hyperscaller.

etiennnr avatar Oct 03 '25 15:10 etiennnr

Going quickly into the code, I realized that the bastion VM is actually a resource out of the operation.gardener.cloud group, aka a resource in the garden. And looks like the instance type is not part of the API. So this issue is likely bigger than just adding the flag in the CLI...

I dug down further the code and found out that the machineType is actually part of g/g (see here). If it's not present in the cloudProfile (which is the case here), It defaults to finding the smallest possible Machine Type (even though it might not be available in some regions).

etiennnr avatar Oct 03 '25 18:10 etiennnr

Created an issue in g/g (https://github.com/gardener/gardener/issues/13093) in order to see if we can make that configurable in the bastion API. After a subsequent PR, gardenctl would still need to support it.

etiennnr avatar Oct 03 '25 19:10 etiennnr