Skip to content

Commit

Permalink
Update virtual cluster to 1.24 and Gardener to 1.81
Browse files Browse the repository at this point in the history
  • Loading branch information
schrodit committed Jan 5, 2024
1 parent 1bd59d8 commit 2c708c2
Show file tree
Hide file tree
Showing 9 changed files with 177 additions and 7 deletions.
2 changes: 1 addition & 1 deletion default.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

version: v1.80.7
version: v1.81.7

landscapeName: gardener-installation

Expand Down
8 changes: 8 additions & 0 deletions src/charts/host/virtual-cluster/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,11 @@ users:
client-certificate-data: {{ .Values.tls.admin.crt | b64enc }}
client-key-data: {{ .Values.tls.admin.key | b64enc }}
{{- end -}}

{{- define "garden.registry" -}}
{{- if semverCompare ">=1.24" .Values.images.tag -}}
registry.k8s.io
{{- else -}}
k8s.gcr.io
{{- end -}}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ spec:
operator: Exists
containers:
- name: kube-apiserver
image: {{ .Values.images.repositories.apiserver }}:{{ .Values.images.tag }}
image: "{{ include "garden.registry" . }}/{{ .Values.images.repositories.apiserver }}:{{ .Values.images.tag }}"
imagePullPolicy: IfNotPresent
command:
- /usr/local/bin/kube-apiserver
Expand All @@ -96,7 +96,6 @@ spec:
{{ end }}
- --external-hostname={{ .Values.apiServer.hostname }}
- --kubelet-preferred-address-types=InternalIP,Hostname,ExternalIP
- --insecure-port=0
{{ if .Values.apiServer.oidcIssuerURL }}
- --oidc-issuer-url={{ .Values.apiServer.oidcIssuerURL }}
- --oidc-client-id=kube-kubectl
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ spec:
operator: Exists
containers:
- name: kube-controller-manager
image: {{ index .Values.images.repositories "controller-manager" }}:{{ .Values.images.tag }}
image: "{{ include "garden.registry" . }}/{{ index .Values.images.repositories "controller-manager" }}:{{ .Values.images.tag }}"
imagePullPolicy: IfNotPresent
command:
- /usr/local/bin/kube-controller-manager
Expand Down
4 changes: 2 additions & 2 deletions src/charts/host/virtual-cluster/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ namespace: xxx
serviceName: garden-kube-apiserver
images:
repositories:
apiserver: 'k8s.gcr.io/kube-apiserver'
controller-manager: 'k8s.gcr.io/kube-controller-manager'
apiserver: kube-apiserver
controller-manager: kube-controller-manager
tag: v1.18.3


Expand Down
5 changes: 4 additions & 1 deletion src/ts/versions/installations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {Installation as Installation_1_50} from './v1.50/installation';
import {Installation as Installation_1_51} from './v1.51/installation';
import {Installation as Installation_1_62} from './v1.62/installation';
import {Installation as Installation_1_74} from './v1.74/installation';
import {Installation as Installation_1_80} from './v1.80/installation';
import {Installation as Installation_1_81} from './v1.81/installation';

export type InstallationConfig = {
genDir: string,
Expand Down Expand Up @@ -71,7 +73,8 @@ const versions: Record<string, InstallationConstructor> = {
'v1.77.x': Installation_1_74,
'v1.78.x': Installation_1_74,
'v1.79.x': Installation_1_74,
'v1.80.x': Installation_1_74,
'v1.80.x': Installation_1_80,
'v1.81.x': Installation_1_81,
};

export class VersionNotFound extends Exception {
Expand Down
29 changes: 29 additions & 0 deletions src/ts/versions/v1.80/installation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {Flow, VersionedValues} from '../../flow/Flow';
import {VersionedState} from '../../Landscape';
import {Installation as Installation_1_74} from '../v1.74/installation';
import {emptyState, isStateValues, validateState} from '../v1.46/Values';
import { SemVer } from 'semver';

export const VERSION = '1.80';

const targetVirtualClusterVersion = new SemVer('v1.23.16');

export class Installation extends Installation_1_74 {


public async install(flow: Flow, stateValues: null | VersionedState, inputValues: VersionedValues): Promise<void> {
if (stateValues === null) {
stateValues = emptyState(inputValues.version);
} else {
if (!isStateValues(stateValues)) {
throw validateState(stateValues);
}
}
// with gardener version 1.74 host and virtual cluster running at least 1.22 is required.
if (new SemVer(stateValues.apiserver.version).compareMain(targetVirtualClusterVersion) === -1) {
stateValues.apiserver.version = targetVirtualClusterVersion.raw;
}
await super.install(flow, stateValues, inputValues);
}

}
101 changes: 101 additions & 0 deletions src/ts/versions/v1.81/extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@

gardener:
extensions:
os-coreos:
enabled: true
version: v1.16.0
controllerRegistration:
repositoryName: gardener-extension-os-coreos

os-ubuntu:
enabled: true
version: v1.23.0
controllerRegistration:
repositoryName: gardener-extension-os-ubuntu

provider-gcp:
enabled: true
version: v1.33.1
controllerRegistration:
repositoryName: gardener-extension-provider-gcp

provider-openstack:
enabled: true
version: v1.37.1
controllerRegistration:
repositoryName: gardener-extension-provider-openstack

provider-dns-cloudflare:
enabled: true
version: v0.0.6
controllerRegistration:
org: schrodit
repositoryName: gardener-extension-provider-dns-cloudflare

provider-equinix:
enabled: true
version: v2.10.0
controllerRegistration:
repositoryName: gardener-extension-provider-equinix-metal

networking-cilium:
enabled: true
version: v1.30.2
controllerRegistration:
repositoryName: gardener-extension-networking-cilium

networking-calico:
enabled: true
version: v1.37.0
controllerRegistration:
repositoryName: gardener-extension-networking-calico

shoot-dns-service:
enabled: true
global: true

version: v1.38.3
controllerRegistration:
repositoryName: gardener-extension-shoot-dns-service

values:
dnsProviderReplication:
enabled: true
dnsProviderManagement:
enabled: true
dnsControllerManager:
image:
repository: eu.gcr.io/gardener-project/dns-controller-manager
tag: v0.13.3
configuration:
cacheTtl: 300
controllers: dnscontrollers,dnssources
dnsPoolResyncPeriod: 30m
#poolSize: 20
#providersPoolResyncPeriod: 24h
serverPortHttp: 8080
createCRDs: false
deploy: true
replicaCount: 1
#resources:
# limits:
# memory: 1Gi
# requests:
# cpu: 50m
# memory: 500Mi

shoot-cert-service:
enabled: true
global: true

version: v1.38.0
controllerRegistration:
repositoryName: gardener-extension-shoot-cert-service

values:
certificateConfig:
defaultIssuer:
acme:
email: [email protected]
server: https://acme-v02.api.letsencrypt.org/directory
name: default-issuer
30 changes: 30 additions & 0 deletions src/ts/versions/v1.81/installation.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import {Flow, VersionedValues} from '../../flow/Flow';
import {VersionedState} from '../../Landscape';
import {Installation as Installation_1_80} from '../v1.80/installation';
import {emptyState, isStateValues, validateState} from '../v1.46/Values';
import { SemVer } from 'semver';

export const VERSION = '1.81';

const targetVirtualClusterVersion = new SemVer('v1.24.17');

export class Installation extends Installation_1_80 {


public async install(flow: Flow, stateValues: null | VersionedState, inputValues: VersionedValues): Promise<void> {
if (stateValues === null) {
stateValues = emptyState(inputValues.version);
} else {
if (!isStateValues(stateValues)) {
throw validateState(stateValues);
}
}
// with gardener version 1.81 host and virtual cluster running at least 1.24 is required.
if (new SemVer(stateValues.apiserver.version).compareMain(targetVirtualClusterVersion) === -1) {
stateValues.apiserver.version = targetVirtualClusterVersion.raw;
}
await super.install(flow, stateValues, inputValues);
stateValues.version = inputValues.version;
}

}

0 comments on commit 2c708c2

Please sign in to comment.