Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 15 additions & 13 deletions .github/workflows/aergia-controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ jobs:
strategy:
fail-fast: false
matrix:
kindest_node_version: [v1.25.16, v1.26.15, v1.27.13, v1.28.9, v1.29.4, v1.30.2]
kindest_node_version: [
"v1.29.14@sha256:8703bd94ee24e51b778d5556ae310c6c0fa67d761fae6379c8e0bb480e6fea29",
"v1.30.10@sha256:4de75d0e82481ea846c0ed1de86328d821c1e6a6a91ac37bf804e5313670e507",
"v1.32.2@sha256:f226345927d7e348497136874b6d207e0b32cc52154ad8323129352923a3142f",
]
experimental: [false]
steps:
- name: Checkout
Expand All @@ -39,24 +43,22 @@ jobs:
tar -xf ./gojq_v0.11.1_linux_amd64.tar.gz
sudo cp /tmp/gojq_v0.11.1_linux_amd64/gojq /usr/local/bin/jq

- name: Configure node IP in kind-config.yaml
run: |
docker network create kind
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
KIND_NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
export KIND_NODE_IP
envsubst < test-resources/test-suite.kind-config.yaml.tpl > test-resources/test-suite.kind-config.yaml
envsubst < test/e2e/testdata/example-nginx.yaml.tpl > test/e2e/testdata/example-nginx.yaml

- name: Create kind cluster
uses: helm/kind-action@v1.13.0
with:
version: v0.24.0
version: v0.27.0
cluster_name: aergia-controller
node_image: kindest/node:${{ matrix.kindest_node_version }}
kubectl_version: v1.30.4
kubectl_version: v1.32.2
config: test-resources/test-suite.kind-config.yaml

- name: Configure registry for containerd
run: |
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '.[].Containers[].IPv4Address' | tr -d '"')
KIND_NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
export KIND_NODE_IP
envsubst < test/e2e/testdata/example-nginx.yaml.tpl > test/e2e/testdata/example-nginx.yaml

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -69,7 +71,7 @@ jobs:

- name: Run github/test-e2e
run: |
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '. [0].IPAM.Config[0].Subnet' | tr -d '"')
LAGOON_KIND_CIDR_BLOCK=$(docker network inspect kind | jq '.[].Containers[].IPv4Address' | tr -d '"')
KIND_NODE_IP=$(echo "${LAGOON_KIND_CIDR_BLOCK%???}" | awk -F'.' '{print $1,$2,$3,240}' OFS='.')
export KIND_NODE_IP
make github/test-e2e KIND_NETWORK=kind
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bin
*.swo
*~

test-resources/test-suite.kind-config.yaml
test-resources/test-suite.registry.toml
test-resources/test-suite.metallb-pool.yaml
test/e2e/testdata/example-nginx.yaml

Expand Down
31 changes: 17 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ KIND_NETWORK ?= aergia-controller

TIMEOUT = 30m

KIND_VERSION = v0.25.0
KUBECTL_VERSION := v1.31.0
KIND_VERSION = v0.27.0
KUBECTL_VERSION := v1.32.3
HELM_VERSION := v3.16.1
GOJQ_VERSION = v0.12.16
KUSTOMIZE_VERSION := v5.4.3
Expand All @@ -35,7 +35,7 @@ ARCH := $(shell uname | tr '[:upper:]' '[:lower:]')
local-dev/kind:
ifeq ($(KIND_VERSION), $(shell kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
$(info linking local kind version $(KIND_VERSION))
ln -sf $(shell command -v kind) ./local-dev/kind
$(eval KIND = $(realpath $(shell command -v kind)))
else
ifneq ($(KIND_VERSION), $(shell ./local-dev/kind version 2>/dev/null | sed -nE 's/kind (v[0-9.]+).*/\1/p'))
$(info downloading kind version $(KIND_VERSION) for $(ARCH))
Expand All @@ -50,10 +50,11 @@ endif
local-dev/kustomize:
ifeq ($(KUSTOMIZE_VERSION), $(shell kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
$(info linking local kustomize version $(KUSTOMIZE_VERSION))
ln -sf $(shell command -v kustomize) ./local-dev/kustomize
$(eval KUSTOMIZE = $(realpath $(shell command -v kustomize)))
else
ifneq ($(KUSTOMIZE_VERSION), $(shell ./local-dev/kustomize version 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
$(info downloading kustomize version $(KUSTOMIZE_VERSION) for $(ARCH))
mkdir -p local-dev
rm local-dev/kustomize || true
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
chmod a+x local-dev/kustomize
Expand All @@ -64,10 +65,11 @@ endif
local-dev/helm:
ifeq ($(HELM_VERSION), $(shell helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
$(info linking local helm version $(HELM_VERSION))
ln -sf $(shell command -v helm) ./local-dev/helm
$(eval HELM = $(realpath $(shell command -v helm)))
else
ifneq ($(HELM_VERSION), $(shell ./local-dev/helm version --short --client 2>/dev/null | sed -nE 's/(v[0-9.]+).*/\1/p'))
$(info downloading helm version $(HELM_VERSION) for $(ARCH))
mkdir -p local-dev
rm local-dev/helm || true
curl -sSL https://get.helm.sh/helm-$(HELM_VERSION)-$(ARCH)-amd64.tar.gz | tar -xzC local-dev --strip-components=1 $(ARCH)-amd64/helm
chmod a+x local-dev/helm
Expand All @@ -78,10 +80,11 @@ endif
local-dev/jq:
ifeq ($(GOJQ_VERSION), $(shell gojq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+).*/v\1/p'))
$(info linking local gojq version $(GOJQ_VERSION))
ln -sf $(shell command -v gojq) ./local-dev/jq
$(eval JQ = $(realpath $(shell command -v gojq)))
else
ifneq ($(GOJQ_VERSION), $(shell ./local-dev/jq -v 2>/dev/null | sed -nE 's/gojq ([0-9.]+).*/v\1/p'))
$(info downloading gojq version $(GOJQ_VERSION) for $(ARCH))
mkdir -p local-dev
rm local-dev/jq || true
ifeq ($(ARCH), darwin)
TMPDIR=$$(mktemp -d) \
Expand All @@ -99,12 +102,13 @@ endif
local-dev/kubectl:
ifeq ($(KUBECTL_VERSION), $(shell kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version: (v[0-9.]+).*/\1/'))
$(info linking local kubectl version $(KUBECTL_VERSION))
ln -sf $(shell command -v kubectl) ./local-dev/kubectl
$(eval KUBECTL = $(realpath $(shell command -v kubectl)))
else
ifneq ($(KUBECTL_VERSION), $(shell ./local-dev/kubectl version --client 2>/dev/null | grep Client | sed -E 's/Client Version: (v[0-9.]+).*/\1/'))
$(info downloading kubectl version $(KUBECTL_VERSION) for $(ARCH))
mkdir -p local-dev
rm local-dev/kubectl || true
curl -sSLo local-dev/kubectl https://storage.googleapis.com/kubernetes-release/release/$(KUBECTL_VERSION)/bin/$(ARCH)/amd64/kubectl
curl -sSLo local-dev/kubectl https://dl.k8s.io/release/$(KUBECTL_VERSION)/bin/$(ARCH)/amd64/kubectl
chmod a+x local-dev/kubectl
endif
endif
Expand Down Expand Up @@ -224,12 +228,11 @@ $(ENVTEST): $(LOCALBIN)
.PHONY: create-kind-cluster
create-kind-cluster: local-dev/tools helm/repos
docker network inspect $(KIND_NETWORK) >/dev/null || docker network create $(KIND_NETWORK) \
&& LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '. [0].IPAM.Config[0].Subnet' | tr -d '"') \
&& export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') \
&& envsubst < test-resources/test-suite.kind-config.yaml.tpl > test-resources/test-suite.kind-config.yaml \
&& envsubst < test/e2e/testdata/example-nginx.yaml.tpl > test/e2e/testdata/example-nginx.yaml \
&& export KIND_EXPERIMENTAL_DOCKER_NETWORK=$(KIND_NETWORK) \
&& $(KIND) create cluster --wait=60s --name=$(KIND_CLUSTER) --config=test-resources/test-suite.kind-config.yaml
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') \
&& export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') \
&& envsubst < test/e2e/testdata/example-nginx.yaml.tpl > test/e2e/testdata/example-nginx.yaml

# Create a kind cluster locally and run the test e2e test suite against it
.PHONY: kind/test-e2e # Run the e2e tests against a Kind k8s instance that is spun up locally
Expand All @@ -240,7 +243,7 @@ kind/re-test-e2e:
export KIND_PATH=$(KIND) && \
export KUBECTL_PATH=$(KUBECTL) && \
export KIND_CLUSTER=$(KIND_CLUSTER) && \
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '. [0].IPAM.Config[0].Subnet' | tr -d '"') && \
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') && \
export KIND_NODE_IP=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.') && \
$(KIND) export kubeconfig --name=$(KIND_CLUSTER) && \
$(MAKE) test-e2e
Expand Down Expand Up @@ -272,7 +275,7 @@ kind/logs-aergia-controller:

.PHONY: install-metallb
install-metallb:
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '. [0].IPAM.Config[0].Subnet' | tr -d '"') && \
LAGOON_KIND_CIDR_BLOCK=$$(docker network inspect $(KIND_NETWORK) | $(JQ) '.[].Containers[].IPv4Address' | tr -d '"') && \
export LAGOON_KIND_NETWORK_RANGE=$$(echo $${LAGOON_KIND_CIDR_BLOCK%???} | awk -F'.' '{print $$1,$$2,$$3,240}' OFS='.')/29 && \
$(HELM) upgrade \
--install \
Expand Down
Loading