Skip to content

Commit 5edf116

Browse files
committed
chore: update kind to 0.27.0
1 parent 5fe9c4f commit 5edf116

6 files changed

Lines changed: 53 additions & 58 deletions

File tree

.github/workflows/remote-controller.yaml

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -17,20 +17,16 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
kindest_node_version: [v1.25.16]
20+
kindest_node_version: [v1.29.14@sha256:8703bd94ee24e51b778d5556ae310c6c0fa67d761fae6379c8e0bb480e6fea29]
2121
harbor: ["1.11.0"]
2222
lagoon_build_image: ["uselagoon/build-deploy-image:main"]
2323
experimental: [false]
2424
include:
25-
- kindest_node_version: v1.27.13
25+
- kindest_node_version: v1.30.10@sha256:4de75d0e82481ea846c0ed1de86328d821c1e6a6a91ac37bf804e5313670e507
2626
harbor: "1.14.3"
2727
lagoon_build_image: "uselagoon/build-deploy-image:main"
2828
experimental: false
29-
- kindest_node_version: v1.29.4
30-
harbor: "1.14.3"
31-
lagoon_build_image: "uselagoon/build-deploy-image:main"
32-
experimental: true
33-
- kindest_node_version: v1.30.2
29+
- kindest_node_version: v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f
3430
harbor: "1.17.1"
3531
lagoon_build_image: "uselagoon/build-deploy-image:main"
3632
experimental: true
@@ -66,30 +62,37 @@ jobs:
6662
curl -sSLO https://github.com/itchyny/gojq/releases/download/v0.11.1/gojq_v0.11.1_linux_amd64.tar.gz
6763
tar -xf ./gojq_v0.11.1_linux_amd64.tar.gz
6864
sudo cp /tmp/gojq_v0.11.1_linux_amd64/gojq /usr/local/bin/jq
69-
70-
- name: Configure node IP in kind-config.yaml
71-
run: |
72-
docker network create kind
73-
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
74-
KIND_NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
75-
export KIND_NODE_IP
76-
envsubst < test-resources/test-suite.kind-config.yaml.tpl > test-resources/test-suite.kind-config.yaml
7765
7866
- name: Create kind cluster
7967
uses: helm/kind-action@v1.12.0
8068
with:
81-
version: v0.24.0
69+
version: v0.27.0
8270
cluster_name: remote-controller
8371
node_image: kindest/node:${{ matrix.kindest_node_version }}
84-
kubectl_version: v1.30.4
72+
kubectl_version: v1.32.2
8573
config: test-resources/test-suite.kind-config.yaml
86-
74+
75+
- name: Configure registry for containerd
76+
run: |
77+
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '.[].Containers[].IPv4Address' | tr -d '"')
78+
KIND_NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
79+
export KIND_NODE_IP
80+
envsubst < test-resources/test-suite.registry.toml.tpl > test-resources/test-suite.registry.toml
81+
REGISTRY_DIR="/etc/containerd/certs.d/registry.${KIND_NODE_IP}.nip.io"
82+
export REGISTRY_DIR
83+
for node in $(kind get nodes --name remote-controller); do
84+
echo "fixing node $node"
85+
docker exec "$node" mkdir -p "${REGISTRY_DIR}"
86+
cat test-resources/test-suite.registry.toml
87+
docker exec -i "$node" cp /dev/stdin "${REGISTRY_DIR}/hosts.toml" < test-resources/test-suite.registry.toml
88+
done
89+
8790
- name: Check node IP matches kind configuration
8891
run: |
89-
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
92+
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '.[].Containers[].IPv4Address' | tr -d '"')
9093
NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
9194
echo Checking for NODE_IP "$NODE_IP"
92-
grep "$NODE_IP" test-resources/test-suite.kind-config.yaml
95+
grep "$NODE_IP" test-resources/test-suite.registry.toml
9396
9497
- name: Set up Docker Buildx
9598
uses: docker/setup-buildx-action@v3

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ bin
2323
*.swo
2424
*~
2525

26-
test-resources/test-suite.kind-config.yaml
26+
test-resources/test-suite.registry.toml
2727
test-resources/test-suite.metallb-pool.yaml
2828

2929
local-dev

Makefile

Lines changed: 21 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ KIND_NETWORK ?= remote-controller
2323

2424
TIMEOUT = 30m
2525

26-
KIND_VERSION = v0.25.0
27-
KUBECTL_VERSION := v1.31.0
26+
KIND_VERSION = v0.27.0
27+
KUBECTL_VERSION := v1.32.3
2828
HELM_VERSION := v3.16.1
2929
GOJQ_VERSION = v0.12.16
3030
KUSTOMIZE_VERSION := v5.4.3
@@ -42,7 +42,7 @@ ARCH := $(shell uname | tr '[:upper:]' '[:lower:]')
4242
local-dev/kind:
4343
ifeq ($(KIND_VERSION), $(shell kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
4444
$(info linking local kind version $(KIND_VERSION))
45-
ln -sf $(shell command -v kind) ./local-dev/kind
45+
$(eval KIND = $(realpath $(shell command -v kind)))
4646
else
4747
ifneq ($(KIND_VERSION), $(shell ./local-dev/kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
4848
$(info downloading kind version $(KIND_VERSION) for $(ARCH))
@@ -57,10 +57,11 @@ endif
5757
local-dev/kustomize:
5858
ifeq ($(KUSTOMIZE_VERSION), $(shell kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
5959
$(info linking local kustomize version $(KUSTOMIZE_VERSION))
60-
ln -sf $(shell command -v kind) ./local-dev/kind
60+
$(eval KUSTOMIZE = $(realpath $(shell command -v kustomize)))
6161
else
6262
ifneq ($(KUSTOMIZE_VERSION), $(shell ./local-dev/kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
6363
$(info downloading kustomize version $(KUSTOMIZE_VERSION) for $(ARCH))
64+
mkdir -p local-dev
6465
rm local-dev/kustomize || true
6566
curl -sSL https://github.com/kubernetes-sigs/kustomize/releases/download/kustomize%2F$(KUSTOMIZE_VERSION)/kustomize_$(KUSTOMIZE_VERSION)_$(ARCH)_amd64.tar.gz | tar -xzC local-dev
6667
chmod a+x local-dev/kustomize
@@ -71,10 +72,11 @@ endif
7172
local-dev/helm:
7273
ifeq ($(HELM_VERSION), $(shell helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
7374
$(info linking local helm version $(HELM_VERSION))
74-
ln -sf $(shell command -v helm) ./local-dev/helm
75+
$(eval HELM = $(realpath $(shell command -v helm)))
7576
else
7677
ifneq ($(HELM_VERSION), $(shell ./local-dev/helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
7778
$(info downloading helm version $(HELM_VERSION) for $(ARCH))
79+
mkdir -p local-dev
7880
rm local-dev/helm || true
7981
curl -sSL https://get.helm.sh/helm-$(HELM_VERSION)-$(ARCH)-amd64.tar.gz | tar -xzC local-dev --strip-components=1 $(ARCH)-amd64/helm
8082
chmod a+x local-dev/helm
@@ -86,9 +88,11 @@ local-dev/jq:
8688
ifeq ($(GOJQ_VERSION), $(shell gojq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+).*/v\1/p'))
8789
$(info linking local gojq version $(GOJQ_VERSION))
8890
ln -sf $(shell command -v gojq) ./local-dev/jq
91+
$(eval JQ = $(realpath $(shell command -v gojq)))
8992
else
9093
ifneq ($(GOJQ_VERSION), $(shell ./local-dev/jq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+).*/v\1/p'))
9194
$(info downloading gojq version $(GOJQ_VERSION) for $(ARCH))
95+
mkdir -p local-dev
9296
rm local-dev/jq || true
9397
ifeq ($(ARCH), darwin)
9498
TMPDIR=$$(mktemp -d) \
@@ -106,12 +110,13 @@ endif
106110
local-dev/kubectl:
107111
ifeq ($(KUBECTL_VERSION), $(shell kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version: (v[0-9.]+).*/\1/'))
108112
$(info linking local kubectl version $(KUBECTL_VERSION))
109-
ln -sf $(shell command -v kubectl) ./local-dev/kubectl
113+
$(eval KUBECTL = $(realpath $(shell command -v kubectl)))
110114
else
111115
ifneq ($(KUBECTL_VERSION), $(shell ./local-dev/kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version: (v[0-9.]+).*/\1/'))
112116
$(info downloading kubectl version $(KUBECTL_VERSION) for $(ARCH))
117+
mkdir -p local-dev
113118
rm local-dev/kubectl || true
114-
curl -sSLo local-dev/kubectl https://storage.googleapis.com/kubernetes-release/release/$(KUBECTL_VERSION)/bin/$(ARCH)/amd64/kubectl
119+
curl -sSLo local-dev/kubectl https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/$(ARCH)/amd64/kubectl
115120
chmod a+x local-dev/kubectl
116121
endif
117122
endif
@@ -131,24 +136,6 @@ helm/repos: local-dev/helm
131136

132137
ARCH := $(shell uname | tr '[:upper:]' '[:lower:]')
133138

134-
KIND = $(realpath ./local-dev/kind)
135-
KIND_VERSION = v0.25.0
136-
137-
.PHONY: local-dev/kind
138-
local-dev/kind:
139-
ifeq ($(KIND_VERSION), $(shell kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
140-
$(info linking local kind version $(KIND_VERSION))
141-
ln -sf $(shell command -v kind) ./local-dev/kind
142-
else
143-
ifneq ($(KIND_VERSION), $(shell ./local-dev/kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
144-
$(info downloading kind version $(KIND_VERSION) for $(ARCH))
145-
mkdir -p local-dev
146-
rm local-dev/kind || true
147-
curl -sSLo local-dev/kind https://kind.sigs.k8s.io/dl/$(KIND_VERSION)/kind-$(ARCH)-amd64
148-
chmod a+x local-dev/kind
149-
endif
150-
endif
151-
152139
# Get the currently used golang install path (in GOPATH/bin, unless GOBIN is set)
153140
ifeq (,$(shell go env GOBIN))
154141
GOBIN=$(shell go env GOPATH)/bin
@@ -265,7 +252,7 @@ endif
265252

266253
.PHONY: install-metallb
267254
install-metallb:
268-
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '. [0].IPAM.Config[0].Subnet' | tr -d '"') && \
255+
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') && \
269256
export LAGOON_KIND_NETWORK_RANGE=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.')/29 && \
270257
$(HELM) upgrade \
271258
--install \
@@ -374,11 +361,16 @@ install-lagoon-remote: install-registry
374361
.PHONY: create-kind-cluster
375362
create-kind-cluster: local-dev/tools helm/repos
376363
docker network inspect $(KIND_NETWORK) >/dev/null || docker network create $(KIND_NETWORK) \
377-
&& LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '. [0].IPAM.Config[0].Subnet' | tr -d '"') \
378-
&& export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') \
379-
&& envsubst < test-resources/test-suite.kind-config.yaml.tpl > test-resources/test-suite.kind-config.yaml \
380364
&& export KIND_EXPERIMENTAL_DOCKER_NETWORK=$(KIND_NETWORK) \
381365
&& $(KIND) create cluster --wait=60s --name=$(KIND_CLUSTER) --config=test-resources/test-suite.kind-config.yaml
366+
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') \
367+
&& export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') \
368+
&& envsubst < test-resources/test-suite.registry.toml.tpl > test-resources/test-suite.registry.toml \
369+
&& export REGISTRY_DIR="/etc/containerd/certs.d/registry.$${KIND_NODE_IP}.nip.io" && \
370+
for node in $$($(KIND) get nodes --name $(KIND_CLUSTER)); do \
371+
docker exec "$$node" mkdir -p "$${REGISTRY_DIR}"; \
372+
cat test-resources/test-suite.registry.toml | docker exec -i "$$node" cp /dev/stdin "$${REGISTRY_DIR}/hosts.toml"; \
373+
done
382374

383375
# generate-broker-certs will generate a ca, server and client certificate used for the test suite
384376
.PHONY: generate-broker-certs
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
kind: Cluster
2+
apiVersion: kind.x-k8s.io/v1alpha4
3+
containerdConfigPatches:
4+
- |-
5+
[plugins."io.containerd.grpc.v1.cri".registry]
6+
config_path = "/etc/containerd/certs.d"

test-resources/test-suite.kind-config.yaml.tpl

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[host."https://registry.${KIND_NODE_IP}.nip.io"]
2+
skip_verify = true

0 commit comments

Comments
 (0)