Skip to content

Commit d049268

Browse files
authored
🌱 Update Containerd, Runc, Kubernetes Version, Packages. Remove unsupported parts. (#1542)
1 parent 84284b1 commit d049268

File tree

144 files changed

+1695
-2249
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

144 files changed

+1695
-2249
lines changed

.envrc.sample

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
1-
export TTS_TOKEN=...
21
export CLUSTER_NAME=caph-${USER}
32
export KUBECONFIG=$PWD/.mgt-cluster-kubeconfig.yaml
43
export HCLOUD_TOKEN=...
54
export SSH_KEY_NAME=my-caph-ssh-key
65
export HCLOUD_REGION=fsn1
76
export CONTROL_PLANE_MACHINE_COUNT=1
87
export WORKER_MACHINE_COUNT=1
9-
export KUBERNETES_VERSION=v1.29.4
10-
export HCLOUD_IMAGE_NAME=1.29.4-ubuntu-22.04-containerd
8+
export KUBERNETES_VERSION=v1.31.6
119
export HCLOUD_CONTROL_PLANE_MACHINE_TYPE=cpx31
1210
export HCLOUD_WORKER_MACHINE_TYPE=cpx31
1311
export SSH_KEY=$HOME/.ssh/my-caph-ssh-key.pub
1412
export HETZNER_SSH_PUB_PATH=$HOME/.ssh/my-caph-ssh-key.pub
1513
export HETZNER_SSH_PRIV_PATH=$HOME/.ssh/my-caph-ssh-key
1614
export HETZNER_ROBOT_USER=
1715
export HETZNER_ROBOT_PASSWORD=
16+
17+
HETZNER_SSH_PUB=$(base64 -w0 "$HETZNER_SSH_PUB_PATH")
18+
HETZNER_SSH_PRIV=$(base64 -w0 "$HETZNER_SSH_PRIV_PATH")
19+
export HETZNER_SSH_PUB HETZNER_SSH_PRIV
20+
21+
export PATH="$PWD/hack/tools/bin:$PATH"

.github/actions/e2e/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ runs:
7676
HETZNER_SSH_PUB: ${{ inputs.e2e_ssh_pub }}
7777
HETZNER_SSH_PRIV: ${{ inputs.e2e_ssh_priv }}
7878
SKIP_IMAGE_BUILD: "1"
79-
CAPH_LATEST_VERSION: "v1.0.0"
79+
CAPH_LATEST_VERSION: "v1.0.1"
8080
run: make ${{ inputs.e2e_make_target }}
8181
- name: Upload artifact
8282
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4

.github/workflows/e2e-basic-packer.yaml

Lines changed: 0 additions & 50 deletions
This file was deleted.

.github/workflows/e2e-basic.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,5 @@ jobs:
4646
uses: ./.github/actions/e2e
4747
with:
4848
e2e_name: hcloud-basic
49-
e2e_make_target: test-e2e
49+
e2e_make_target: test-e2e-hcloud
5050
e2e_hcloud_token: ${{ secrets.HCLOUD_TOKEN }}

.github/workflows/e2e-periodic.yaml

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ jobs:
4646
uses: ./.github/actions/e2e
4747
with:
4848
e2e_name: hcloud-basic
49-
e2e_make_target: test-e2e
49+
e2e_make_target: test-e2e-hcloud
5050
e2e_hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
5151

5252
e2e-hcloud-feature:
@@ -69,28 +69,6 @@ jobs:
6969
e2e_name: hcloud-feature
7070
e2e_make_target: test-e2e-feature
7171
e2e_hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
72-
73-
e2e-hcloud-feature-packer:
74-
name: Test Hcloud Feature Packer Image
75-
concurrency: ci-${{ github.ref }}-e2e-feature-packer
76-
runs-on: ubuntu-latest
77-
permissions:
78-
# Required for hcloud TPS
79-
id-token: write
80-
needs:
81-
- manager-image
82-
- test-release
83-
steps:
84-
- name: checkout
85-
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4
86-
- name: Run e2e Test
87-
id: e2e
88-
uses: ./.github/actions/e2e
89-
with:
90-
e2e_name: hcloud-feature-packer
91-
e2e_make_target: test-e2e-feature-packer
92-
e2e_hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
93-
9472
e2e-hcloud-lifecycle:
9573
name: Test Hcloud Lifecycle
9674
concurrency: ci-${{ github.ref }}-e2e-lifecycle

.github/workflows/pr-e2e.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ jobs:
6363
uses: ./.github/actions/e2e
6464
with:
6565
e2e_name: hcloud-basic
66-
e2e_make_target: test-e2e
66+
e2e_make_target: test-e2e-hcloud
6767
e2e_hcloud_token: ${{ secrets.HCLOUD_TOKEN }}
6868

6969
e2e-hetzner-basic:

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,3 +73,9 @@ tmp_*
7373

7474
# baremetal hosts
7575
baremetalhosts*yaml
76+
77+
# https://github.com/guettli/watchall
78+
watchall-output*
79+
80+
/*.kubeconfig
81+
/*.log

.golangci-suggestions.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ linters:
1414
- errchkjson
1515
- errname
1616
- errorlint
17-
- exportloopref
1817
- forcetypeassert
1918
- gci
2019
- goconst

.golangci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ linters:
1111
- durationcheck
1212
- errcheck
1313
- errchkjson
14-
- exportloopref
14+
- copyloopvar
1515
- gci
1616
- gocritic
1717
- godot

Makefile

Lines changed: 30 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ SHELL = /usr/bin/env bash -o pipefail
2525
.DEFAULT_GOAL:=help
2626
GOTEST ?= go test
2727

28+
# https://github.com/syself/hetzner-cloud-controller-manager#networks-support
29+
PRIVATE_NETWORK ?= false
30+
2831
##@ General
2932

3033

@@ -79,8 +82,8 @@ MGT_CLUSTER_KUBECONFIG ?= ".mgt-cluster-kubeconfig.yaml"
7982

8083
# Kubebuilder.
8184
# go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
82-
# setup-envtest list
83-
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.29.3
85+
# The command `setup-envtest list` shows the available versions.
86+
export KUBEBUILDER_ENVTEST_KUBERNETES_VERSION ?= 1.31.0
8487

8588
##@ Binaries
8689
############
@@ -110,7 +113,7 @@ $(ENVSUBST): # Build envsubst from tools folder.
110113
SETUP_ENVTEST := $(abspath $(TOOLS_BIN_DIR)/setup-envtest)
111114
setup-envtest: $(SETUP_ENVTEST) ## Build a local copy of setup-envtest
112115
$(SETUP_ENVTEST): # Build setup-envtest from tools folder.
113-
go install sigs.k8s.io/controller-runtime/tools/[email protected]20240507051437-479b723944e3
116+
go install sigs.k8s.io/controller-runtime/tools/[email protected]20250310021545-f80bc5dbf8f7
114117

115118
CTLPTL := $(abspath $(TOOLS_BIN_DIR)/ctlptl)
116119
ctlptl: $(CTLPTL) ## Build a local copy of ctlptl
@@ -120,8 +123,7 @@ $(CTLPTL):
120123
CLUSTERCTL := $(abspath $(TOOLS_BIN_DIR)/clusterctl)
121124
clusterctl: $(CLUSTERCTL) ## Build a local copy of clusterctl
122125
$(CLUSTERCTL):
123-
curl -sSLf https://github.com/kubernetes-sigs/cluster-api/releases/download/v1.7.5/clusterctl-$$(go env GOOS)-$$(go env GOARCH) -o $(CLUSTERCTL)
124-
chmod a+rx $(CLUSTERCTL)
126+
go install sigs.k8s.io/cluster-api/cmd/[email protected]
125127

126128
HELM := $(abspath $(TOOLS_BIN_DIR)/helm)
127129
helm: $(HELM) ## Build a local copy of helm
@@ -143,7 +145,7 @@ $(KIND):
143145
KUBECTL := $(abspath $(TOOLS_BIN_DIR)/kubectl)
144146
kubectl: $(KUBECTL) ## Build a local copy of kubectl
145147
$(KUBECTL):
146-
curl -fsSL "https://dl.k8s.io/release/v1.29.4/bin/$$(go env GOOS)/$$(go env GOARCH)/kubectl" -o $(KUBECTL)
148+
curl -fsSL "https://dl.k8s.io/release/v1.31.6/bin/$$(go env GOOS)/$$(go env GOARCH)/kubectl" -o $(KUBECTL)
147149
chmod a+rx $(KUBECTL)
148150

149151
go-binsize-treemap := $(abspath $(TOOLS_BIN_DIR)/go-binsize-treemap)
@@ -234,17 +236,7 @@ create-workload-cluster-hcloud: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST)
234236
cat templates/cluster-templates/cluster-template-hcloud.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
235237
$(MAKE) wait-and-get-secret
236238
$(MAKE) install-cilium-in-wl-cluster
237-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=false
238-
239-
create-workload-cluster-hcloud-packer: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
240-
# Create workload Cluster.
241-
./hack/ensure-env-variables.sh HCLOUD_TOKEN
242-
$(KUBECTL) create secret generic $(INFRA_PROVIDER) --from-literal=hcloud=$(HCLOUD_TOKEN) --save-config --dry-run=client -o yaml | $(KUBECTL) apply -f -
243-
$(KUSTOMIZE) build templates/cluster-templates/hcloud-packer --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud-packer.yaml
244-
cat templates/cluster-templates/cluster-template-hcloud-packer.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
245-
$(MAKE) wait-and-get-secret
246-
$(MAKE) install-cilium-in-wl-cluster
247-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=false
239+
$(MAKE) install-ccm-in-wl-cluster
248240

249241
create-workload-cluster-hcloud-network: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
250242
# Create workload Cluster.
@@ -256,16 +248,6 @@ create-workload-cluster-hcloud-network: env-vars-for-wl-cluster $(KUSTOMIZE) $(E
256248
$(MAKE) install-cilium-in-wl-cluster
257249
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=true
258250

259-
create-workload-cluster-hcloud-network-packer: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
260-
# Create workload Cluster.
261-
./hack/ensure-env-variables.sh HCLOUD_TOKEN
262-
$(KUBECTL) create secret generic $(INFRA_PROVIDER) --from-literal=hcloud=$(HCLOUD_TOKEN) --save-config --dry-run=client -o yaml | $(KUBECTL) apply -f -
263-
$(KUSTOMIZE) build templates/cluster-templates/hcloud-network-packer --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud-network-packer.yaml
264-
cat templates/cluster-templates/cluster-template-hcloud-network-packer.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
265-
$(MAKE) wait-and-get-secret
266-
$(MAKE) install-cilium-in-wl-cluster
267-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=true
268-
269251
create-workload-cluster-hetzner-hcloud-control-plane: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
270252
# Create workload Cluster.
271253
./hack/ensure-env-variables.sh HCLOUD_TOKEN HETZNER_ROBOT_USER HETZNER_ROBOT_PASSWORD HETZNER_SSH_PRIV_PATH HETZNER_SSH_PUB_PATH SSH_KEY_NAME
@@ -275,7 +257,7 @@ create-workload-cluster-hetzner-hcloud-control-plane: env-vars-for-wl-cluster $(
275257
cat templates/cluster-templates/cluster-template-$(INFRA_PROVIDER)-hcloud-control-planes.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
276258
$(MAKE) wait-and-get-secret
277259
$(MAKE) install-cilium-in-wl-cluster
278-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=false
260+
$(MAKE) install-ccm-in-wl-cluster
279261

280262
create-workload-cluster-hetzner-baremetal-control-plane: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
281263
# Create workload Cluster.
@@ -286,7 +268,7 @@ create-workload-cluster-hetzner-baremetal-control-plane: env-vars-for-wl-cluster
286268
cat templates/cluster-templates/cluster-template-$(INFRA_PROVIDER)-baremetal-control-planes.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
287269
$(MAKE) wait-and-get-secret
288270
$(MAKE) install-cilium-in-wl-cluster
289-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=false
271+
$(MAKE) install-ccm-in-wl-cluster
290272

291273
create-workload-cluster-hetzner-baremetal-control-plane-remediation: env-vars-for-wl-cluster $(KUSTOMIZE) $(ENVSUBST) ## Creates a workload-cluster.
292274
# Create workload Cluster.
@@ -297,7 +279,7 @@ create-workload-cluster-hetzner-baremetal-control-plane-remediation: env-vars-fo
297279
cat templates/cluster-templates/cluster-template-$(INFRA_PROVIDER)-baremetal-control-planes-remediation.yaml | $(ENVSUBST) - | $(KUBECTL) apply -f -
298280
$(MAKE) wait-and-get-secret
299281
$(MAKE) install-cilium-in-wl-cluster
300-
$(MAKE) install-ccm-in-wl-cluster PRIVATE_NETWORK=false
282+
$(MAKE) install-ccm-in-wl-cluster
301283

302284
move-to-workload-cluster: $(CLUSTERCTL)
303285
$(CLUSTERCTL) init --kubeconfig=$(WORKER_CLUSTER_KUBECONFIG) --core cluster-api --bootstrap kubeadm --control-plane kubeadm --infrastructure $(INFRA_PROVIDER)
@@ -339,6 +321,10 @@ delete-mgt-cluster-registry: $(CTLPTL) ## Deletes Kind-dev Cluster and the local
339321
$(CTLPTL) delete registry $(INFRA_SHORT)-registry
340322

341323
generate-hcloud-token:
324+
@if [ -n "$${TTS_TOKEN}" ]; then \
325+
echo "Error: TTS_TOKEN is set. Please remove the deprecated variable (.envrc ?)."; \
326+
exit 1; \
327+
fi
342328
./hack/ensure-env-variables.sh TPS_TOKEN
343329
./hack/ci-e2e-get-token.sh
344330

@@ -349,6 +335,7 @@ generate-hcloud-token:
349335
.PHONY: clean
350336
clean: ## Remove all generated files
351337
$(MAKE) clean-bin
338+
rm -rf test/e2e/data/infrastructure-hetzner/*/cluster-template*.yaml
352339

353340
.PHONY: clean-bin
354341
clean-bin: ## Remove all generated helper binaries
@@ -472,16 +459,15 @@ ssh-first-control-plane: ## ssh into the first control-plane
472459
@hack/ssh-first-control-plane.sh
473460

474461

475-
KUBEBUILDER_ASSETS ?= $(shell $(SETUP_ENVTEST) use --use-env --bin-dir $(abspath $(TOOLS_BIN_DIR)) -p path $(KUBEBUILDER_ENVTEST_KUBERNETES_VERSION))
476-
477462
E2E_DIR ?= $(ROOT_DIR)/test/e2e
478463
E2E_CONF_FILE_SOURCE ?= $(E2E_DIR)/config/$(INFRA_PROVIDER).yaml
479464
E2E_CONF_FILE ?= $(E2E_DIR)/config/$(INFRA_PROVIDER).tmp.yaml
480465

466+
481467
.PHONY: test-unit
482468
test-unit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run unit and integration tests
483-
@mkdir -p $(shell pwd)/.coverage
484-
KUBEBUILDER_ASSETS="$(KUBEBUILDER_ASSETS)" $(GOTESTSUM) --junitfile=.coverage/junit.xml --format testname -- -covermode=atomic -coverprofile=.coverage/cover.out -p=4 -timeout 5m ./controllers/... ./pkg/... ./api/...
469+
echo $(SETUP_ENVTEST) $(GOTESTSUM)
470+
./hack/test-unit.sh
485471

486472
.PHONY: e2e-image
487473
e2e-image: ## Build the e2e manager image
@@ -494,18 +480,21 @@ $(E2E_CONF_FILE): $(ENVSUBST) $(E2E_CONF_FILE_SOURCE) ./hack/create-e2e-conf-fil
494480
E2E_CONF_FILE=$(E2E_CONF_FILE) ./hack/create-e2e-conf-file.sh
495481

496482
.PHONY: test-e2e
497-
test-e2e: $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
483+
test-e2e: test-e2e-hcloud
484+
485+
.PHONY: test-e2e-hcloud
486+
test-e2e-hcloud: $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
498487
rm -f $(WORKER_CLUSTER_KUBECONFIG)
499-
GINKGO_FOKUS="'\[Basic\]'" GINKGO_NODES=2 E2E_CONF_FILE=$(E2E_CONF_FILE) ./hack/ci-e2e-capi.sh
488+
HETZNER_SSH_PUB= HETZNER_SSH_PRIV= \
489+
HETZNER_SSH_PUB_PATH= HETZNER_SSH_PRIV_PATH= \
490+
HETZNER_ROBOT_PASSWORD= HETZNER_ROBOT_USER= \
491+
GINKGO_FOKUS="'\[Basic\]'" GINKGO_NODES=2 E2E_CONF_FILE=$(E2E_CONF_FILE) \
492+
./hack/ci-e2e-capi.sh
500493

501494
.PHONY: test-e2e-feature
502495
test-e2e-feature: $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
503496
GINKGO_FOKUS="'\[Feature\]'" GINKGO_NODES=3 ./hack/ci-e2e-capi.sh
504497

505-
.PHONY: test-e2e-feature-packer
506-
test-e2e-feature-packer: $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
507-
GINKGO_FOKUS="'\[Feature Packer\]'" GINKGO_NODES=1 PACKER_IMAGE_NAME=templates/node-image/1.29.4-ubuntu-22-04-containerd ./hack/ci-e2e-capi.sh
508-
509498
.PHONY: test-e2e-lifecycle
510499
test-e2e-lifecycle: $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
511500
GINKGO_FOKUS="'\[Lifecycle\]'" GINKGO_NODES=3 ./hack/ci-e2e-capi.sh
@@ -516,7 +505,7 @@ test-e2e-upgrade-$(INFRA_SHORT): $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-
516505

517506
.PHONY: test-e2e-upgrade-kubernetes
518507
test-e2e-upgrade-kubernetes: $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
519-
GINKGO_FOKUS="'\[Upgrade Kubernetes\]'" GINKGO_NODES=2 PACKER_KUBERNETES_UPGRADE_FROM=templates/node-image/1.28.9-ubuntu-22-04-containerd PACKER_KUBERNETES_UPGRADE_TO=templates/node-image/1.29.4-ubuntu-22-04-containerd ./hack/ci-e2e-capi.sh
508+
GINKGO_FOKUS="'\[Upgrade Kubernetes\]'" GINKGO_NODES=2 ./hack/ci-e2e-capi.sh
520509

521510
.PHONY: test-e2e-conformance
522511
test-e2e-conformance: $(E2E_CONF_FILE) $(if $(SKIP_IMAGE_BUILD),,e2e-image) $(ARTIFACTS)
@@ -632,9 +621,7 @@ generate-api-ci: generate-manifests generate-go-deepcopy
632621
cluster-templates: $(KUSTOMIZE)
633622
$(KUSTOMIZE) build templates/cluster-templates/hcloud --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template.yaml
634623
$(KUSTOMIZE) build templates/cluster-templates/hcloud --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud.yaml
635-
$(KUSTOMIZE) build templates/cluster-templates/hcloud-packer --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud-packer.yaml
636624
$(KUSTOMIZE) build templates/cluster-templates/hcloud-network --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud-network.yaml
637-
$(KUSTOMIZE) build templates/cluster-templates/hcloud-network-packer --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hcloud-network-packer.yaml
638625
$(KUSTOMIZE) build templates/cluster-templates/hetzner-hcloud-control-planes --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hetzner-hcloud-control-planes.yaml
639626
$(KUSTOMIZE) build templates/cluster-templates/hetzner-baremetal-control-planes --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hetzner-baremetal-control-planes.yaml
640627
$(KUSTOMIZE) build templates/cluster-templates/hetzner-baremetal-control-planes-remediation --load-restrictor LoadRestrictionsNone > templates/cluster-templates/cluster-template-hetzner-baremetal-control-planes-remediation.yaml

0 commit comments

Comments
 (0)