From d8ac44d1c1a96b6a0c4768a5fbc884f841bfb15d Mon Sep 17 00:00:00 2001 From: Maksim Paskal Date: Thu, 3 Oct 2024 14:28:25 +0100 Subject: [PATCH] kubernetes 1.30 Signed-off-by: Maksim Paskal --- .github/workflows/e2e.yml | 16 +- Makefile | 6 +- README.md | 186 ++++++++++++++++--- e2e/configs/full.yaml | 114 +++++++++--- e2e/configs/v1.28-amd64-ubuntu-22.04-us.yaml | 6 +- e2e/configs/v1.28-arm64-ubuntu-20.04-eu.yaml | 4 +- e2e/configs/v1.28-arm64-ubuntu-22.04-eu.yaml | 6 +- e2e/configs/v1.29-amd64-ubuntu-22.04-us.yaml | 6 +- e2e/configs/v1.29-arm64-ubuntu-20.04-eu.yaml | 4 +- e2e/configs/v1.29-arm64-ubuntu-22.04-eu.yaml | 6 +- e2e/configs/v1.30-amd64-ubuntu-20.04-eu.yaml | 13 ++ e2e/configs/v1.30-amd64-ubuntu-20.04-us.yaml | 25 +++ e2e/configs/v1.30-amd64-ubuntu-22.04-eu.yaml | 13 ++ e2e/configs/v1.30-arm64-ubuntu-20.04-eu.yaml | 22 +++ e2e/configs/v1.30-arm64-ubuntu-22.04-eu.yaml | 22 +++ e2e/e2e_test.go | 13 +- pkg/config/config.go | 42 ++--- scripts/chart/Chart.lock | 14 +- scripts/chart/Chart.yaml | 10 +- scripts/common-install.sh | 3 + scripts/ubuntu-versions.sh | 3 + 21 files changed, 425 insertions(+), 109 deletions(-) create mode 100644 e2e/configs/v1.30-amd64-ubuntu-20.04-eu.yaml create mode 100644 e2e/configs/v1.30-amd64-ubuntu-20.04-us.yaml create mode 100644 e2e/configs/v1.30-amd64-ubuntu-22.04-eu.yaml create mode 100644 e2e/configs/v1.30-arm64-ubuntu-20.04-eu.yaml create mode 100644 e2e/configs/v1.30-arm64-ubuntu-22.04-eu.yaml diff --git a/.github/workflows/e2e.yml b/.github/workflows/e2e.yml index e742426..84f8532 100644 --- a/.github/workflows/e2e.yml +++ b/.github/workflows/e2e.yml @@ -1,9 +1,19 @@ on: workflow_dispatch: inputs: - token: + hcloud_token: description: 'Hetzner Cloud API token' required: true + e2e_file_name: + description: 'Name of the e2e tests' + required: false + default: 'v1.30*' + debug: + type: choice + description: 'Debug mode' + required: false + options: ['true', 'false'] + default: 'false' jobs: e2e: @@ -17,4 +27,6 @@ jobs: - run: ssh-keygen -t rsa -q -f "$HOME/.ssh/id_rsa" -N "" - run: make e2e branch=${{ github.base_ref || github.ref_name }} env: - HCLOUD_TOKEN: ${{ github.event.inputs.token }} \ No newline at end of file + HCLOUD_TOKEN: ${{ github.event.inputs.hcloud_token }} + E2E_FILE_NAME: ${{ github.event.inputs.e2e_file_name }} + DEBUG: ${{ github.event.inputs.debug }} \ No newline at end of file diff --git a/Makefile b/Makefile index 849a7d7..e6fba0d 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ test: CONFIG=config_test.yaml go test -race -coverprofile coverage.out ./cmd/... ./pkg/... .PHONY: e2e e2e: - GIT_BRANCH=$(branch) go test -v -count=1 -timeout=4h ./e2e/e2e_test.go + HCLOUD_CTL_BRANCH=$(branch) go test -v -count=1 -timeout=4h ./e2e/e2e_test.go update-readme: go run ./utils/main.go coverage: @@ -21,11 +21,11 @@ coverage: create-cluster: make test make delete-cluster - go run -race ./cmd -config=$(config) -action=create -log.level=DEBUG + HCLOUD_CTL_BRANCH=$(branch) go run -race ./cmd -config=$(config) -action=create -log.level=DEBUG delete-cluster: go run -race ./cmd -config=$(config) -action=delete -log.level=DEBUG patch-cluster: - make run action=patch-cluster + HCLOUD_CTL_BRANCH=$(branch) make run action=patch-cluster list-configurations: make run action=list-configurations upgrade-controlplane: diff --git a/README.md b/README.md index 7cf9307..e315d37 100644 --- a/README.md +++ b/README.md @@ -24,7 +24,7 @@ for other OS download binnary from [release pages](https://github.com/maksim-pas This will create kubernetes cluster in Hetzner Cloud Europe region with 3 instances, 1 load balancer for the kubernetes control plane and 1 kubernetes worker node, after successful installation the cluster will have: -- [Kubernetes v1.29](https://github.com/kubernetes/kubernetes) +- [Kubernetes v1.30](https://github.com/kubernetes/kubernetes) - [Kubernetes Autoscaler](https://github.com/kubernetes/autoscaler) - [Flannel](https://github.com/flannel-io/flannel) - [Kubernetes Cloud Controller Manager for Hetzner Cloud](https://github.com/hetznercloud/hcloud-cloud-controller-manager) @@ -39,55 +39,55 @@ for HA needs odd number of master nodes (minimum 3) /etc/containerd/certs.d/some-registry.io/hosts.toml <
Kubernetes: v1.28, Arch: arm64, Ubuntu: 20.04, Region: eu @@ -176,9 +178,11 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 ```
@@ -200,9 +204,11 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 ```
Kubernetes: v1.29, Arch: amd64, Ubuntu: 20.04, Region: eu @@ -260,9 +266,11 @@ serverComponents: version: 1.6.24-1 cluster-autoscaler: autoscalingGroups: - - name: CPX51:ASH:cpx51-ash + - name: cpx51-ash minSize: 1 maxSize: 20 + instanceType: cpx51 + region: ash ```
Kubernetes: v1.29, Arch: arm64, Ubuntu: 20.04, Region: eu @@ -283,9 +291,11 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 ```
@@ -307,9 +317,129 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 + minSize: 1 + maxSize: 20 + instanceType: cax41 + region: fsn1 +``` + +
Kubernetes: v1.30, Arch: amd64, Ubuntu: 20.04, Region: eu + +```yaml +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 + +``` +
+
Kubernetes: v1.30, Arch: amd64, Ubuntu: 20.04, Region: us + +```yaml +ipRange: "10.0.0.0/16" +masterCount: 3 +networkZone: us-east +location: ash +datacenter: ash-dc1 +masterServers: + servertype: cpx21 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +cluster-autoscaler: + autoscalingGroups: + - name: cpx51-ash + minSize: 1 + maxSize: 20 + instanceType: cpx51 + region: ash +``` +
+
Kubernetes: v1.30, Arch: amd64, Ubuntu: 22.04, Region: eu + +```yaml +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-22.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 + +``` +
+
Kubernetes: v1.30, Arch: arm64, Ubuntu: 20.04, Region: eu + +```yaml +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: arm + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +masterServers: + servertype: cax11 +cluster-autoscaler: + autoscalingGroups: + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 +``` +
+
Kubernetes: v1.30, Arch: arm64, Ubuntu: 22.04, Region: eu + +```yaml +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-22.04 + architecture: arm + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +masterServers: + servertype: cax11 +cluster-autoscaler: + autoscalingGroups: + - name: cax-fsn1 + minSize: 1 + maxSize: 20 + instanceType: cax41 + region: fsn1 + ```
diff --git a/e2e/configs/full.yaml b/e2e/configs/full.yaml index a193b82..3a40565 100644 --- a/e2e/configs/full.yaml +++ b/e2e/configs/full.yaml @@ -5,11 +5,11 @@ serverComponents: username: hcloud-user architecture: x86 kubernetes: - version: 1.29.3-1.1 + version: 1.30.5-1.1 docker: - version: 5:24.0.6-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) containerd: - version: 1.6.24-1 + version: 1.7.22-1 pausecontainer: registry.k8s.io/pause:3.2 ipRange: 10.0.0.0/16 ipRangeSubnet: 10.0.0.0/16 @@ -50,84 +50,138 @@ preStartScript: "" postStartScript: "" cluster-autoscaler: autoscalingGroups: - - name: CPX11:FSN1:cpx11-fsn1 + - name: cpx11-fsn1 minSize: 0 maxSize: 20 - - name: CPX21:FSN1:cpx21-fsn1 + instanceType: cpx11 + region: fsn1 + - name: cpx21-fsn1 minSize: 0 maxSize: 20 - - name: CX22:FSN1:cx22-fsn1 + instanceType: cpx21 + region: fsn1 + - name: cx22-fsn1 minSize: 0 maxSize: 20 - - name: CPX31:FSN1:cpx31-fsn1 + instanceType: cx22 + region: fsn1 + - name: cpx31-fsn1 minSize: 0 maxSize: 20 - - name: CX32:FSN1:cx32-fsn1 + instanceType: cpx31 + region: fsn1 + - name: cx32-fsn1 minSize: 0 maxSize: 20 - - name: CPX41:FSN1:cpx41-fsn1 + instanceType: cx32 + region: fsn1 + - name: cpx41-fsn1 minSize: 0 maxSize: 20 - - name: CX42:FSN1:cx42-fsn1 + instanceType: cpx41 + region: fsn1 + - name: cx42-fsn1 minSize: 0 maxSize: 20 - - name: CX52:FSN1:cx52-fsn1 + instanceType: cx42 + region: fsn1 + - name: cx52-fsn1 minSize: 0 maxSize: 20 - - name: CPX51:FSN1:cpx51-fsn1 + instanceType: cx52 + region: fsn1 + - name: cpx51-fsn1 minSize: 0 maxSize: 20 - - name: CPX11:NBG1:cpx11-nbg1 + instanceType: cpx51 + region: fsn1 + - name: cpx11-nbg1 minSize: 0 maxSize: 20 - - name: CPX21:NBG1:cpx21-nbg1 + instanceType: cpx11 + region: nbg1 + - name: cpx21-nbg1 minSize: 0 maxSize: 20 - - name: CX22:NBG1:cx22-nbg1 + instanceType: cpx21 + region: nbg1 + - name: cx22-nbg1 minSize: 0 maxSize: 20 - - name: CPX31:NBG1:cpx31-nbg1 + instanceType: cx22 + region: nbg1 + - name: cpx31-nbg1 minSize: 0 maxSize: 20 - - name: CX32:NBG1:cx32-nbg1 + instanceType: cpx31 + region: nbg1 + - name: cx32-nbg1 minSize: 0 maxSize: 20 - - name: CPX41:NBG1:cpx41-nbg1 + instanceType: cx32 + region: nbg1 + - name: cpx41-nbg1 minSize: 0 maxSize: 20 - - name: CX42:NBG1:cx42-nbg1 + instanceType: cpx41 + region: nbg1 + - name: cx42-nbg1 minSize: 0 maxSize: 20 - - name: CX52:NBG1:cx52-nbg1 + instanceType: cx42 + region: nbg1 + - name: cx52-nbg1 minSize: 0 maxSize: 20 - - name: CPX51:NBG1:cpx51-nbg1 + instanceType: cx52 + region: nbg1 + - name: cpx51-nbg1 minSize: 0 maxSize: 20 - - name: CPX11:HEL1:cpx11-hel1 + instanceType: cpx51 + region: nbg1 + - name: cpx11-hel1 minSize: 0 maxSize: 20 - - name: CPX21:HEL1:cpx21-hel1 + instanceType: cpx11 + region: hel1 + - name: cpx21-hel1 minSize: 0 maxSize: 20 - - name: CX22:HEL1:cx22-hel1 + instanceType: cpx21 + region: hel1 + - name: cx22-hel1 minSize: 0 maxSize: 20 - - name: CPX31:HEL1:cpx31-hel1 + instanceType: cx22 + region: hel1 + - name: cpx31-hel1 minSize: 0 maxSize: 20 - - name: CX32:HEL1:cx32-hel1 + instanceType: cpx31 + region: hel1 + - name: cx32-hel1 minSize: 0 maxSize: 20 - - name: CPX41:HEL1:cpx41-hel1 + instanceType: cx32 + region: hel1 + - name: cpx41-hel1 minSize: 0 maxSize: 20 - - name: CX42:HEL1:cx42-hel1 + instanceType: cpx41 + region: hel1 + - name: cx42-hel1 minSize: 0 maxSize: 20 - - name: CX52:HEL1:cx52-hel1 + instanceType: cx42 + region: hel1 + - name: cx52-hel1 minSize: 0 maxSize: 20 - - name: CPX51:HEL1:cpx51-hel1 + instanceType: cx52 + region: hel1 + - name: cpx51-hel1 minSize: 0 maxSize: 20 + instanceType: cpx51 + region: hel1 diff --git a/e2e/configs/v1.28-amd64-ubuntu-22.04-us.yaml b/e2e/configs/v1.28-amd64-ubuntu-22.04-us.yaml index 39071a8..8e35d1d 100644 --- a/e2e/configs/v1.28-amd64-ubuntu-22.04-us.yaml +++ b/e2e/configs/v1.28-amd64-ubuntu-22.04-us.yaml @@ -17,6 +17,8 @@ serverComponents: version: 1.6.24-1 cluster-autoscaler: autoscalingGroups: - - name: CPX51:ASH:cpx51-ash + - name: cpx51-ash minSize: 1 - maxSize: 20 \ No newline at end of file + maxSize: 20 + instanceType: cpx51 + region: ash \ No newline at end of file diff --git a/e2e/configs/v1.28-arm64-ubuntu-20.04-eu.yaml b/e2e/configs/v1.28-arm64-ubuntu-20.04-eu.yaml index 9fef029..0224799 100644 --- a/e2e/configs/v1.28-arm64-ubuntu-20.04-eu.yaml +++ b/e2e/configs/v1.28-arm64-ubuntu-20.04-eu.yaml @@ -14,6 +14,8 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 diff --git a/e2e/configs/v1.28-arm64-ubuntu-22.04-eu.yaml b/e2e/configs/v1.28-arm64-ubuntu-22.04-eu.yaml index 40959c8..4b81d04 100644 --- a/e2e/configs/v1.28-arm64-ubuntu-22.04-eu.yaml +++ b/e2e/configs/v1.28-arm64-ubuntu-22.04-eu.yaml @@ -14,6 +14,8 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 - maxSize: 20 \ No newline at end of file + maxSize: 20 + instanceType: cax41 + region: fsn1 \ No newline at end of file diff --git a/e2e/configs/v1.29-amd64-ubuntu-22.04-us.yaml b/e2e/configs/v1.29-amd64-ubuntu-22.04-us.yaml index 9f3fe9c..7bbdb0a 100644 --- a/e2e/configs/v1.29-amd64-ubuntu-22.04-us.yaml +++ b/e2e/configs/v1.29-amd64-ubuntu-22.04-us.yaml @@ -17,6 +17,8 @@ serverComponents: version: 1.6.24-1 cluster-autoscaler: autoscalingGroups: - - name: CPX51:ASH:cpx51-ash + - name: cpx51-ash minSize: 1 - maxSize: 20 \ No newline at end of file + maxSize: 20 + instanceType: cpx51 + region: ash \ No newline at end of file diff --git a/e2e/configs/v1.29-arm64-ubuntu-20.04-eu.yaml b/e2e/configs/v1.29-arm64-ubuntu-20.04-eu.yaml index 5d061fc..2e4e15f 100644 --- a/e2e/configs/v1.29-arm64-ubuntu-20.04-eu.yaml +++ b/e2e/configs/v1.29-arm64-ubuntu-20.04-eu.yaml @@ -14,6 +14,8 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 maxSize: 20 + instanceType: cax41 + region: fsn1 diff --git a/e2e/configs/v1.29-arm64-ubuntu-22.04-eu.yaml b/e2e/configs/v1.29-arm64-ubuntu-22.04-eu.yaml index dcf508e..fe67af5 100644 --- a/e2e/configs/v1.29-arm64-ubuntu-22.04-eu.yaml +++ b/e2e/configs/v1.29-arm64-ubuntu-22.04-eu.yaml @@ -14,6 +14,8 @@ masterServers: servertype: cax11 cluster-autoscaler: autoscalingGroups: - - name: CAX41:FSN1:cax-fsn1 + - name: cax-fsn1 minSize: 1 - maxSize: 20 \ No newline at end of file + maxSize: 20 + instanceType: cax41 + region: fsn1 \ No newline at end of file diff --git a/e2e/configs/v1.30-amd64-ubuntu-20.04-eu.yaml b/e2e/configs/v1.30-amd64-ubuntu-20.04-eu.yaml new file mode 100644 index 0000000..fb6770a --- /dev/null +++ b/e2e/configs/v1.30-amd64-ubuntu-20.04-eu.yaml @@ -0,0 +1,13 @@ +# Kubernetes v1.30 in Europe +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 diff --git a/e2e/configs/v1.30-amd64-ubuntu-20.04-us.yaml b/e2e/configs/v1.30-amd64-ubuntu-20.04-us.yaml new file mode 100644 index 0000000..0144d38 --- /dev/null +++ b/e2e/configs/v1.30-amd64-ubuntu-20.04-us.yaml @@ -0,0 +1,25 @@ +# Kubernetes v1.30 in US East +ipRange: "10.0.0.0/16" +masterCount: 3 +networkZone: us-east +location: ash +datacenter: ash-dc1 +masterServers: + servertype: cpx21 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +cluster-autoscaler: + autoscalingGroups: + - name: cpx51-ash + minSize: 1 + maxSize: 20 + instanceType: cpx51 + region: ash \ No newline at end of file diff --git a/e2e/configs/v1.30-amd64-ubuntu-22.04-eu.yaml b/e2e/configs/v1.30-amd64-ubuntu-22.04-eu.yaml new file mode 100644 index 0000000..e933b79 --- /dev/null +++ b/e2e/configs/v1.30-amd64-ubuntu-22.04-eu.yaml @@ -0,0 +1,13 @@ +# Kubernetes v1.30 in Europe (ARM64 architecture) +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-22.04 + architecture: x86 + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 diff --git a/e2e/configs/v1.30-arm64-ubuntu-20.04-eu.yaml b/e2e/configs/v1.30-arm64-ubuntu-20.04-eu.yaml new file mode 100644 index 0000000..9bbec9f --- /dev/null +++ b/e2e/configs/v1.30-arm64-ubuntu-20.04-eu.yaml @@ -0,0 +1,22 @@ +# Kubernetes v1.30 in Europe (ARM64 architecture) +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-20.04 + architecture: arm + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +masterServers: + servertype: cax11 +cluster-autoscaler: + autoscalingGroups: + - name: cax-fsn1 + minSize: 1 + maxSize: 20 + instanceType: cax41 + region: fsn1 \ No newline at end of file diff --git a/e2e/configs/v1.30-arm64-ubuntu-22.04-eu.yaml b/e2e/configs/v1.30-arm64-ubuntu-22.04-eu.yaml new file mode 100644 index 0000000..71c8e33 --- /dev/null +++ b/e2e/configs/v1.30-arm64-ubuntu-22.04-eu.yaml @@ -0,0 +1,22 @@ +# Kubernetes v1.30 in Europe (ARM64 architecture) +ipRange: "10.0.0.0/16" +masterCount: 3 +serverComponents: + ubuntu: + version: ubuntu-22.04 + architecture: arm + kubernetes: + version: 1.30.5-1.1 + docker: + version: 5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs) + containerd: + version: 1.7.22-1 +masterServers: + servertype: cax11 +cluster-autoscaler: + autoscalingGroups: + - name: cax-fsn1 + minSize: 1 + maxSize: 20 + instanceType: cax41 + region: fsn1 diff --git a/e2e/e2e_test.go b/e2e/e2e_test.go index 09a6d42..2269789 100644 --- a/e2e/e2e_test.go +++ b/e2e/e2e_test.go @@ -40,7 +40,16 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop log.SetLevel(log.WarnLevel) - tests, err := filepath.Glob("./configs/*.yaml") + if os.Getenv("DEBUG") == "true" { + log.SetLevel(log.DebugLevel) + } + + nameGlob := os.Getenv("E2E_FILE_NAME") + if nameGlob == "" { + nameGlob = "*" + } + + tests, err := filepath.Glob("./configs/" + nameGlob + ".yaml") if err != nil { t.Fatal(err) } @@ -97,8 +106,6 @@ func Test(t *testing.T) { //nolint:funlen,paralleltest,cyclop }, } - config.SetBranch(os.Getenv("GIT_BRANCH")) - config.Get().Deployments = extraDeployments config.Get().KubeConfigPath = tmpFile.Name() diff --git a/pkg/config/config.go b/pkg/config/config.go index ca0301f..3436d8c 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -92,12 +92,20 @@ type serverComponents struct { } type clusterAutoscalingGroup struct { - Name string `yaml:"name"` - MinSize int `yaml:"minSize"` - MaxSize int `yaml:"maxSize"` + Name string `yaml:"name"` + MinSize int `yaml:"minSize"` + MaxSize int `yaml:"maxSize"` + InstanceType string `yaml:"instanceType"` + Region string `yaml:"region"` } -func getDefaultMasterServersInitParams(branch string) masterServersInitParams { +func getDefaultMasterServersInitParams() masterServersInitParams { + branch := "main" + + if b := os.Getenv("HCLOUD_CTL_BRANCH"); len(b) > 0 { + branch = b + } + return masterServersInitParams{ TarGz: fmt.Sprintf("https://github.com/maksim-paskal/hcloud-k8s-ctl/archive/refs/heads/%s.tar.gz", branch), Folder: "hcloud-k8s-ctl-" + branch, @@ -121,15 +129,11 @@ func getDefaultClusterAutoscaler() map[interface{}]interface{} { for _, location := range defaultLocations { for _, server := range defaultServers { result = append(result, &clusterAutoscalingGroup{ - Name: fmt.Sprintf( - "%s:%s:%s-%s", - strings.ToUpper(server), - strings.ToUpper(location), - server, - location, - ), - MinSize: 0, - MaxSize: workersCount, + Name: fmt.Sprintf("%s-%s", server, location), + MinSize: 0, + MaxSize: workersCount, + InstanceType: server, + Region: location, }) } } @@ -188,10 +192,6 @@ var cliArguments = cliArgs{ CreateFirewallWorkers: flag.Bool("create-firewall.workers", false, "create firewall for workers"), } -func SetBranch(branch string) { - config.MasterServers.ServersInitParams = getDefaultMasterServersInitParams(branch) -} - func defaultConfig() Type { privateKey := "~/.ssh/id_rsa" kubeConfigPath := "~/.kube/hcloud" @@ -208,13 +208,13 @@ func defaultConfig() Type { Architecture: hcloud.ArchitectureX86, // x86 or arm }, Kubernetes: serverComponentKubernetes{ - Version: "1.29.3-1.1", + Version: "1.30.5-1.1", }, Docker: serverComponentDocker{ - Version: "5:24.0.6-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs)", + Version: "5:27.3.1-1~ubuntu.$(lsb_release -rs)~$(lsb_release -cs)", }, Containerd: serverComponentContainerd{ - Version: "1.6.24-1", + Version: "1.7.22-1", PauseContainer: "registry.k8s.io/pause:3.2", }, }, @@ -236,7 +236,7 @@ func defaultConfig() Type { Labels: serverLabels, WaitTimeInRetry: waitTimeInRetry, RetryTimeLimit: retryTimeLimit, - ServersInitParams: getDefaultMasterServersInitParams("main"), + ServersInitParams: getDefaultMasterServersInitParams(), }, MasterLoadBalancer: masterLoadBalancer{ LoadBalancerType: "lb11", diff --git a/scripts/chart/Chart.lock b/scripts/chart/Chart.lock index 371ee0b..05848a3 100644 --- a/scripts/chart/Chart.lock +++ b/scripts/chart/Chart.lock @@ -7,18 +7,18 @@ dependencies: version: 0.2.3 - name: hcloud-csi repository: https://charts.hetzner.cloud - version: 2.5.1 + version: 2.9.0 - name: hcloud-cloud-controller-manager repository: https://charts.hetzner.cloud - version: v1.18.0 + version: 1.20.0 - name: cluster-autoscaler repository: https://kubernetes.github.io/autoscaler - version: 9.29.4 + version: 9.43.0 - name: metrics-server repository: https://kubernetes-sigs.github.io/metrics-server - version: 3.11.0 + version: 3.12.1 - name: flannel repository: https://flannel-io.github.io/flannel - version: v0.22.3 -digest: sha256:22d3a2e924881aeba8f75be376e266aff23ed20f5c57a0bbf1e4e9829c741bb0 -generated: "2023-11-02T15:18:05.426271Z" + version: v0.25.6 +digest: sha256:80b841973c680cbb2e629209388a2231962d04fb2c727440798f4e14d13cd42d +generated: "2024-10-03T10:30:13.174016+01:00" diff --git a/scripts/chart/Chart.yaml b/scripts/chart/Chart.yaml index 8c1aeaa..25b22da 100644 --- a/scripts/chart/Chart.yaml +++ b/scripts/chart/Chart.yaml @@ -10,17 +10,17 @@ dependencies: version: "0.2.3" repository: https://postfinance.github.io/kubelet-csr-approver - name: hcloud-csi - version: "2.5.1" + version: "2.9.0" repository: https://charts.hetzner.cloud - name: hcloud-cloud-controller-manager - version: "v1.18.0" + version: "1.20.0" repository: https://charts.hetzner.cloud - name: cluster-autoscaler - version: "9.29.4" + version: "9.43.0" repository: https://kubernetes.github.io/autoscaler - name: metrics-server - version: "3.11.0" + version: "3.12.1" repository: https://kubernetes-sigs.github.io/metrics-server - name: flannel - version: "v0.22.3" + version: "v0.25.6" repository: https://flannel-io.github.io/flannel \ No newline at end of file diff --git a/scripts/common-install.sh b/scripts/common-install.sh index 89f54d2..55a05b5 100755 --- a/scripts/common-install.sh +++ b/scripts/common-install.sh @@ -117,6 +117,9 @@ EOF cat </etc/apt/sources.list.d/kubernetes-v1.29.list deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ / EOF +cat </etc/apt/sources.list.d/kubernetes-v1.30.list +deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ / +EOF cat </etc/apt/sources.list.d/docker.list deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable EOF diff --git a/scripts/ubuntu-versions.sh b/scripts/ubuntu-versions.sh index d392c08..c87ccfb 100755 --- a/scripts/ubuntu-versions.sh +++ b/scripts/ubuntu-versions.sh @@ -37,6 +37,9 @@ EOF cat </etc/apt/sources.list.d/kubernetes-v1.29.list deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.29/deb/ / EOF +cat </etc/apt/sources.list.d/kubernetes-v1.30.list +deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.30/deb/ / +EOF cat </etc/apt/sources.list.d/docker.list deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable EOF