From 1657411b4ad9d71424ccb34e05a2e37008c5b56b Mon Sep 17 00:00:00 2001 From: Rafal Foks Date: Thu, 8 Aug 2024 14:16:27 +0200 Subject: [PATCH] Align KIM to use Config Map with converter config --- cmd/main.go | 2 +- config/default/kustomization.yaml | 2 +- .../manager_converter_config_patch.yaml | 20 +++++++++++++++++++ config/manager/converter_config.yaml | 6 +++++- 4 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 config/default/manager_converter_config_patch.yaml diff --git a/cmd/main.go b/cmd/main.go index 4167ff23..352b6c93 100644 --- a/cmd/main.go +++ b/cmd/main.go @@ -86,7 +86,7 @@ func main() { flag.DurationVar(&expirationTime, "kubeconfig-expiration-time", defaultExpirationTime, "Dynamic kubeconfig expiration time") flag.DurationVar(&gardenerRequestTimeout, "gardener-request-timeout", defaultGardenerRequestTimeout, "Timeout duration for requests to Gardener") flag.BoolVar(&enableRuntimeReconciler, "runtime-reconciler-enabled", defaultRuntimeReconcilerEnabled, "Feature flag for all runtime reconciler functionalities") - flag.StringVar(&converterConfigFilepath, "converter-config-filepath", "converter_config.json", "A file path to the gardener shoot converter configuration.") + flag.StringVar(&converterConfigFilepath, "converter-config-filepath", "/converter-config/converter_config.json", "A file path to the gardener shoot converter configuration.") flag.BoolVar(&shootSpecDumpEnabled, "shoot-spec-dump-enabled", false, "Feature flag to allow persisting specs of created shoots") opts := zap.Options{ diff --git a/config/default/kustomization.yaml b/config/default/kustomization.yaml index a777fa3c..93e8fe66 100644 --- a/config/default/kustomization.yaml +++ b/config/default/kustomization.yaml @@ -31,7 +31,7 @@ patchesStrategicMerge: # If you want your infrastructure-manager to expose the /metrics # endpoint w/o any authn/z, please comment the following line. - manager_gardener_secret_patch.yaml - +- manager_converter_config_patch.yaml # [WEBHOOK] To enable webhook, uncomment all the sections with [WEBHOOK] prefix including the one in # crd/kustomization.yaml #- manager_webhook_patch.yaml diff --git a/config/default/manager_converter_config_patch.yaml b/config/default/manager_converter_config_patch.yaml new file mode 100644 index 00000000..0f6d61ca --- /dev/null +++ b/config/default/manager_converter_config_patch.yaml @@ -0,0 +1,20 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: infrastructure-manager + namespace: system +spec: + template: + spec: + volumes: + - name: converter-config + configMap: + name: infrastructure-manager-converter-config + items: + - key: converter_config.json + path: converter_config.json + containers: + - name: manager + volumeMounts: + - name: converter-config + mountPath: /converter-config diff --git a/config/manager/converter_config.yaml b/config/manager/converter_config.yaml index e06f1e02..3a844663 100644 --- a/config/manager/converter_config.yaml +++ b/config/manager/converter_config.yaml @@ -3,7 +3,7 @@ kind: ConfigMap metadata: name: converter-config data: - converter_config_aws.json: | + converter_config.json: | { "kubernetes": { "defaultVersion": "1.29", @@ -20,5 +20,9 @@ data: }, "gardener": { "projectName": "kyma-dev" + }, + "machineImage": { + "defaultVersion": "1312.3.0" } } +