diff --git a/components/cert-manager/controller/component.yaml b/components/cert-manager/controller/component.yaml index 3dbbfd15..41ff999e 100644 --- a/components/cert-manager/controller/component.yaml +++ b/components/cert-manager/controller/component.yaml @@ -4,6 +4,7 @@ component: imports: - dns-controller - namespace + - k8sversion stubs: - lib/templates/utilities.yaml diff --git a/components/cert-manager/controller/deployment.yaml b/components/cert-manager/controller/deployment.yaml index 5d948cf6..8b4f2124 100644 --- a/components/cert-manager/controller/deployment.yaml +++ b/components/cert-manager/controller/deployment.yaml @@ -126,6 +126,8 @@ helm: source: "chart-checkout/charts/cert-manager" name: cert-manager namespace: (( .namespace.name )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: image: repository: (( .landscape.versions.cert-manager.controller.image_repo || ~~ )) diff --git a/components/cert-manager/solver/component.yaml b/components/cert-manager/solver/component.yaml index 120e5cc2..bed6a008 100644 --- a/components/cert-manager/solver/component.yaml +++ b/components/cert-manager/solver/component.yaml @@ -4,6 +4,7 @@ component: imports: - dns-controller - cert-controller: cert-manager/controller + - k8sversion stubs: [] diff --git a/components/cert-manager/solver/deployment.yaml b/components/cert-manager/solver/deployment.yaml index ff437f67..e2a5a088 100644 --- a/components/cert-manager/solver/deployment.yaml +++ b/components/cert-manager/solver/deployment.yaml @@ -21,6 +21,8 @@ helm: source: "git/repo/charts/certificate-dns-bridge" name: certificate-dns-bridge namespace: (( imports.cert-controller.export.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: groupName: (( imports.cert-controller.export.groupName )) solverName: (( imports.cert-controller.export.solverName )) diff --git a/components/dashboard/component.yaml b/components/dashboard/component.yaml index e40cd4a7..2565c0bb 100644 --- a/components/dashboard/component.yaml +++ b/components/dashboard/component.yaml @@ -24,6 +24,7 @@ component: - cert: cert-manager/cert - cert-controller: cert-manager/controller - dns-controller + - k8sversion - (( ( .landscape.gardener.network-policies.active || false ) ? "network-policies" :~~ )) - (( ( .landscape.dashboard.terminals.active || false ) ? "terminals" :~~ )) diff --git a/components/dashboard/deployment.yaml b/components/dashboard/deployment.yaml index 2288d055..adf5234c 100644 --- a/components/dashboard/deployment.yaml +++ b/components/dashboard/deployment.yaml @@ -41,6 +41,8 @@ dashboard: source: "git/repo/charts/gardener-dashboard" name: "dashboard" namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: global: apiServerUrl: (( imports.kube_apiserver.export.apiserver_url )) diff --git a/components/dns-controller/component.yaml b/components/dns-controller/component.yaml index 10248d88..f13ad0de 100644 --- a/components/dns-controller/component.yaml +++ b/components/dns-controller/component.yaml @@ -15,6 +15,9 @@ --- landscape: (( &temporary )) component: + imports: + - k8sversion + stubs: - plugins/kubectl/utilities.yaml diff --git a/components/dns-controller/deployment.yaml b/components/dns-controller/deployment.yaml index bd719800..32090a97 100644 --- a/components/dns-controller/deployment.yaml +++ b/components/dns-controller/deployment.yaml @@ -42,6 +42,8 @@ helm: source: "git/repo/charts/external-dns-management" name: (( settings.fullname )) namespace: (( .spec.common.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: (( .spec.helm )) kubectl: diff --git a/components/etcd/cluster/component.yaml b/components/etcd/cluster/component.yaml index a2053b17..258a5ccb 100644 --- a/components/etcd/cluster/component.yaml +++ b/components/etcd/cluster/component.yaml @@ -19,6 +19,7 @@ component: imports: - (( landscape.etcd.backup.active ? { "backupinfra" = "etcd/backupinfra" } :~~ )) - namespace + - k8sversion stubs: - lib/templates/utilities.yaml diff --git a/components/etcd/cluster/deployment.yaml b/components/etcd/cluster/deployment.yaml index 528e67f1..e4f3a93d 100644 --- a/components/etcd/cluster/deployment.yaml +++ b/components/etcd/cluster/deployment.yaml @@ -81,6 +81,8 @@ etcd: source: chart name: garden-etcd-main namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: name: (( main.name )) replicas: 1 @@ -121,6 +123,8 @@ etcd: source: chart name: garden-etcd-events namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: name: (( events.name )) replicas: 1 diff --git a/components/gardencontent/seeds/manifests/seed_manifests.yaml b/components/gardencontent/seeds/manifests/seed_manifests.yaml index 5382b25d..541b3ff1 100644 --- a/components/gardencontent/seeds/manifests/seed_manifests.yaml +++ b/components/gardencontent/seeds/manifests/seed_manifests.yaml @@ -268,6 +268,8 @@ pluginSpecs: source: "git/repo/charts/gardener/gardenlet" name: gardenlet namespace: garden + flags: + deploy: (( "--kube-version=" configValues.k8sVersion )) values: (( gardenletSpec )) seedReady: kubeconfig: (( configValues.kubeconfigs.virtual )) diff --git a/components/gardencontent/seeds/seeds/deployment.yaml b/components/gardencontent/seeds/seeds/deployment.yaml index 05f7ca58..21a07147 100644 --- a/components/gardencontent/seeds/seeds/deployment.yaml +++ b/components/gardencontent/seeds/seeds/deployment.yaml @@ -64,3 +64,6 @@ providerconfig: shootDefaultNetworks: (( v.shootDefaultNetworks || ~~ )) settings: (( v.seedSettings || ~~ )) secretname: (( name "-" v.mode )) + cloudprofile: (( v.cloudprofile || v.name )) + k8sVersion: (( .imports.shoots.export.shoots[v.name].k8sVersion )) + diff --git a/components/gardencontent/seeds/shoots/deployment.yaml b/components/gardencontent/seeds/shoots/deployment.yaml index 1db90077..0ec3b09b 100644 --- a/components/gardencontent/seeds/shoots/deployment.yaml +++ b/components/gardencontent/seeds/shoots/deployment.yaml @@ -65,5 +65,6 @@ shoot_template: <<: (( &template &temporary )) name: (( e.metadata.name )) namespace: (( e.metadata.namespace )) + k8sVersion: (( e.spec.kubernetes.version )) shoots: (( sum[.kubectl.[*].manifests[0]|[]|s,e|-> s *.shoot_template] )) diff --git a/components/gardencontent/seeds/soils/component.yaml b/components/gardencontent/seeds/soils/component.yaml index 1272938d..6327207b 100644 --- a/components/gardencontent/seeds/soils/component.yaml +++ b/components/gardencontent/seeds/soils/component.yaml @@ -22,6 +22,7 @@ component: - gardener_runtime: gardener/extensions - ingress_dns: ingress-controller - kube_apiserver: kube-apiserver + - k8sversion stubs: - plugins/kubectl/utilities.yaml diff --git a/components/gardencontent/seeds/soils/deployment.yaml b/components/gardencontent/seeds/soils/deployment.yaml index 2f019314..92c5b0d1 100644 --- a/components/gardencontent/seeds/soils/deployment.yaml +++ b/components/gardencontent/seeds/soils/deployment.yaml @@ -76,5 +76,6 @@ providerconfig: settings: (( v.seedSettings || ~~ )) secretname: (( name "-" v.mode )) monitoring: (( landscape.monitoring )) + k8sVersion: (( .imports.k8sversion.export.k8sVersions.soils[v.name] )) renderedPluginSpecs: (( sum[.iaasSeedsSoils|[]|s,id,v|-> s [ ( "configValues" = *providerconfig ) read( __ctx.DIR "/../manifests/seed_manifests.yaml", "yaml" ).pluginSpecs ]] )) diff --git a/components/gardener/extensions/deployment.yaml b/components/gardener/extensions/deployment.yaml index 6d4d5507..5136a03b 100644 --- a/components/gardener/extensions/deployment.yaml +++ b/components/gardener/extensions/deployment.yaml @@ -97,6 +97,8 @@ admission: source: (( "extensions." n "/repo/charts/" name "/charts/application" )) name: (( admission.fullName(n) )) namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.kube_apiserver.export.k8sVersion )) values: (( *admission.values_template )) helm_template_runtime: <<: (( &template )) diff --git a/components/gardener/runtime/component.yaml b/components/gardener/runtime/component.yaml index 9a05035f..62f9603d 100644 --- a/components/gardener/runtime/component.yaml +++ b/components/gardener/runtime/component.yaml @@ -19,6 +19,7 @@ component: - gardener_virtual: gardener/virtual - kube_apiserver: "kube-apiserver" - namespace + - k8sversion stubs: - plugins/kubectl/utilities.yaml diff --git a/components/gardener/runtime/deployment.yaml b/components/gardener/runtime/deployment.yaml index b3e2275f..1e65802f 100644 --- a/components/gardener/runtime/deployment.yaml +++ b/components/gardener/runtime/deployment.yaml @@ -82,6 +82,8 @@ gardener: values: (( merge(.imports.gardener_virtual.export.gardener.values, spec) )) name: gardener namespace: (( landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) spec: global: apiserver: diff --git a/components/gardener/virtual/deployment.yaml b/components/gardener/virtual/deployment.yaml index 42f97577..39eb8f0d 100644 --- a/components/gardener/virtual/deployment.yaml +++ b/components/gardener/virtual/deployment.yaml @@ -128,6 +128,8 @@ gardener: source: "git/repo/charts/gardener/controlplane/charts/application" name: "gardener" namespace: "garden" + flags: + deploy: (( "--kube-version=" .imports.kube_apiserver.export.k8sVersion )) values: global: apiserver: diff --git a/components/identity/component.yaml b/components/identity/component.yaml index b3dfe1c6..a4172bcd 100644 --- a/components/identity/component.yaml +++ b/components/identity/component.yaml @@ -19,6 +19,7 @@ component: - ingress-controller - namespace - cert: cert-manager/cert + - k8sversion stubs: - lib/templates/utilities.yaml diff --git a/components/identity/deployment.yaml b/components/identity/deployment.yaml index 694927f8..c13dc97e 100644 --- a/components/identity/deployment.yaml +++ b/components/identity/deployment.yaml @@ -64,6 +64,8 @@ identity: source: "git/repo/charts/identity" name: "identity" namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: image: repository: (( .identity_version.image_repo || ~~ )) diff --git a/components/ingress-controller/component.yaml b/components/ingress-controller/component.yaml index b7ec64ca..e34e7476 100644 --- a/components/ingress-controller/component.yaml +++ b/components/ingress-controller/component.yaml @@ -17,6 +17,7 @@ landscape: (( &temporary )) component: imports: - dns-controller + - k8sversion plugins: - git diff --git a/components/ingress-controller/deployment.yaml b/components/ingress-controller/deployment.yaml index 8d69a1f5..79337c8a 100644 --- a/components/ingress-controller/deployment.yaml +++ b/components/ingress-controller/deployment.yaml @@ -34,7 +34,7 @@ ingresscontroller: name: "nginx-ingress" namespace: "kube-system" flags: - deploy: "--kube-version=1.20.0" + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: fullnameOverride: (( .ingresscontroller.name )) controller: diff --git a/components/kube-apiserver/component.yaml b/components/kube-apiserver/component.yaml index e15974cb..be1bb110 100644 --- a/components/kube-apiserver/component.yaml +++ b/components/kube-apiserver/component.yaml @@ -22,6 +22,7 @@ component: - namespace - (( ( .landscape.gardener.network-policies.active || false ) ? "network-policies" :~~ )) - cert-controller: cert-manager/controller + - k8sversion stubs: - lib/templates/utilities.yaml diff --git a/components/kube-apiserver/deployment.yaml b/components/kube-apiserver/deployment.yaml index c3de79f9..ff1e333f 100644 --- a/components/kube-apiserver/deployment.yaml +++ b/components/kube-apiserver/deployment.yaml @@ -104,6 +104,8 @@ kubeapiserver: name: "garden-kube-apiserver" namespace: (( .landscape.namespace )) serviceName: (( name )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: images: apiserver: (( .landscape.versions.kube-apiserver.image_repo ":" .landscape.versions.kube-apiserver.image_tag )) diff --git a/components/kube-apiserver/export.yaml b/components/kube-apiserver/export.yaml index 71250756..423a726f 100644 --- a/components/kube-apiserver/export.yaml +++ b/components/kube-apiserver/export.yaml @@ -20,7 +20,7 @@ env: (( &temporary )) temp: <<: (( &temporary )) - command: + get_kubeconfig_command: - kubectl - --kubeconfig - (( lookup_file(landscape.clusters.[0].kubeconfig, env.ROOTDIR).[0] )) @@ -31,6 +31,13 @@ temp: - garden-kubeconfig-for-admin - "-o" - "jsonpath={.data.kubeconfig}" + get_k8s_version_command: + - kubectl + - --kubeconfig + - (( tempfile(asyaml(export.kubeconfig)) )) + - version + - -o + - yaml export: gardener_dns: (( .settings.gardener_dns )) @@ -38,8 +45,9 @@ export: apiserver_url: (( "https://" apiserver_dns )) apiserver_url_internal: (( .settings.apiserver_url_internal )) kube_apiserver_ca: (( .state.kube_apiserver_ca.value )) - kubeconfig: (( parse(base64_decode(exec( temp.command ))) || "" )) + kubeconfig: (( parse(base64_decode(exec( temp.get_kubeconfig_command ))) || "" )) kubeconfig_internal_merge_snippet: (( .files.kubeconfig_internal_merge_snippet.data )) + k8sVersion: (( ( "raw_version" = exec( temp.get_k8s_version_command ) ) raw_version.serverVersion.major "." raw_version.serverVersion.minor )) files: kubeconfig: diff --git a/components/monitoring/gardener-metrics-exporter/component.yaml b/components/monitoring/gardener-metrics-exporter/component.yaml index 92223506..c15a921b 100644 --- a/components/monitoring/gardener-metrics-exporter/component.yaml +++ b/components/monitoring/gardener-metrics-exporter/component.yaml @@ -7,6 +7,7 @@ component: - grafana: monitoring/grafana - kube-apiserver - namespace + - k8sversion plugins: - git diff --git a/components/monitoring/gardener-metrics-exporter/deployment.yaml b/components/monitoring/gardener-metrics-exporter/deployment.yaml index 7a5466a2..6e6f91df 100644 --- a/components/monitoring/gardener-metrics-exporter/deployment.yaml +++ b/components/monitoring/gardener-metrics-exporter/deployment.yaml @@ -71,6 +71,8 @@ helm: source: "git/repo/charts/gardener-metrics-exporter" name: gardener-metrics-exporter namespace: (( .landscape.namespace )) + flags: + deploy: (( "--kube-version=" .imports.k8sversion.export.k8sVersions.base )) values: image: repository: (( .landscape.versions.monitoring.gardener-metrics-exporter.image_repo || ~~ ))