gardener / ops-toolbelt

Useful tools and operations guide for gardener landscapes
Apache License 2.0
15 stars 26 forks source link

After introduction of "matrix images", launch script not adapted #77

Open vlerenc opened 2 years ago

vlerenc commented 2 years ago

What would you like to be added: Can we please update the launch script https://github.com/gardener/ops-toolbelt/blob/master/hacks/ops-pod or how are you picking the right image for the job, that respects the cloud provider and Kubernetes version?

E.g. (see #76 for why there is this ugly Kubernetes version defaulting as we don't have ops-toolbelt images for all Gardener-supported Kubernetes versions):

# determine cloud provider and kubernetes version to select the right (specific) image
provider=$(kubectl -n kube-system get cm shoot-info -o jsonpath={.data.provider} | sed -r "s/^azure$/az/"  | sed -r "s/^alicloud$/aliyun/" | sed -r -n "s/^(aliyun|aws|az|gcp|openstack)$/-\1/p")
version=$(kubectl -n kube-system get cm shoot-info -o jsonpath={.data.kubernetesVersion} | sed -r -n "s/^1\.(17|18|19|20|21|22)\.[0-9]+$/-k1.\1/p")

...and then:

image: eu.gcr.io/gardener-project/gardener/ops-toolbelt${provider}${version}

Why is this needed:

cc @petersutter cc @neo-liang-sap @plkokanov @jfortin-sap cc @dguendisch @hendrikKahl @BeckerMax