Skip to content

Commit

Permalink
[ISSUE-1195] Calico in kind tests (#1218)
Browse files Browse the repository at this point in the history
  • Loading branch information
makowalcz authored Jul 24, 2024
1 parent 01c2e6f commit a6443ee
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 10 deletions.
17 changes: 16 additions & 1 deletion Makefile.validation
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,22 @@ kind-install: kind-build
kind version

kind-create-cluster:
$(KIND) create cluster --config $(KIND_CONFIG_DIR)/$(KIND_CONFIG) --image kindest/node:$(KIND_IMAGE_VERSION) --wait $(KIND_WAIT)
KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER=native $(KIND) create cluster --config $(KIND_CONFIG_DIR)/$(KIND_CONFIG) --image kindest/node:$(KIND_IMAGE_VERSION) --wait $(KIND_WAIT)

kind-install-calico:
docker pull ${REGISTRY}/calico/cni:$(CALICO_VERSION)
docker pull ${REGISTRY}/calico/node:$(CALICO_VERSION)
docker pull ${REGISTRY}/calico/kube-controllers:$(CALICO_VERSION)

docker tag ${REGISTRY}/calico/cni:$(CALICO_VERSION) docker.io/calico/cni:$(CALICO_VERSION)
docker tag ${REGISTRY}/calico/node:$(CALICO_VERSION) docker.io/calico/node:$(CALICO_VERSION)
docker tag ${REGISTRY}/calico/kube-controllers:$(CALICO_VERSION) docker.io/calico/kube-controllers:$(CALICO_VERSION)

$(KIND) load docker-image docker.io/calico/cni:$(CALICO_VERSION)
$(KIND) load docker-image docker.io/calico/node:$(CALICO_VERSION)
$(KIND) load docker-image docker.io/calico/kube-controllers:$(CALICO_VERSION)

kubectl apply -f https://raw.githubusercontent.com/projectcalico/calico/$(CALICO_VERSION)/manifests/calico.yaml

kind-delete-cluster:
$(KIND) delete cluster
Expand Down
4 changes: 2 additions & 2 deletions devkit/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@ REPO ?= csi-baremetal-devkit
TAG ?= $(major).$(minor).$(patch)-$(git_rev)
IMAGE_REPO_TAG := $(REPO):$(TAG)

DOCKER_VERSION ?= 20.10.14_ce
DOCKER_VERSION ?= 24.0.7_ce
GO_VERSION ?= 1.21.5
GOLANGCI_VERSION ?= 1.55.2
PROTOBUF_VERSION ?= 3.11.0
PROTOC_GEN_GO_VER ?= v1.3.2
KUBECTL_VERSION ?= 1.25.3
KUBECTL_VERSION ?= 1.29.4
HELM_VERSION ?= 3.8.1
KIND_BUILDER ?= golang:1.21
PYTHON_VERSION ?= 3.6.15
Expand Down
24 changes: 24 additions & 0 deletions devkit/kind/kind-0.23.0.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff -Naur kind-0.23.0/pkg/cluster/internal/providers/docker/provision.go kind-0.23.0-patched/pkg/cluster/internal/providers/docker/provision.go
--- kind-0.23.0/pkg/cluster/internal/providers/docker/provision.go 2024-05-14 03:51:45.000000000 +0200
+++ kind-0.23.0-patched/pkg/cluster/internal/providers/docker/provision.go 2024-07-18 11:28:51.094894819 +0200
@@ -236,6 +236,8 @@
"--volume", "/var",
// some k8s things want to read /lib/modules
"--volume", "/lib/modules:/lib/modules:ro",
+ // ipc host
+ "--ipc", "host",
// propagate KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER to the entrypoint script
"-e", "KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER",
},
diff -Naur kind-0.23.0/pkg/cmd/kind/version/version.go kind-0.23.0-patched/pkg/cmd/kind/version/version.go
--- kind-0.23.0/pkg/cmd/kind/version/version.go 2024-05-14 03:51:45.000000000 +0200
+++ kind-0.23.0-patched/pkg/cmd/kind/version/version.go 2024-07-18 11:29:23.614811195 +0200
@@ -54,7 +54,7 @@
}

// versionCore is the core portion of the kind CLI version per Semantic Versioning 2.0.0
-const versionCore = "0.23.0"
+const versionCore = "0.23.0-patched"

// versionPreRelease is the base pre-release portion of the kind CLI version per
// Semantic Versioning 2.0.0
2 changes: 1 addition & 1 deletion devkit/kind/kind-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Env
KIND_DIR=$1
KIND=$KIND_DIR/kind
KIND_VER=0.17.0
KIND_VER=0.23.0

# Get kind sources
wget -O $KIND_DIR/kind-src https://codeload.github.com/kubernetes-sigs/kind/tar.gz/refs/tags/v$KIND_VER
Expand Down
5 changes: 0 additions & 5 deletions tests/kind/small-kind.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
featureGates:
# any feature gate can be enabled here with "Name": true
# or disabled here with "Name": false
# not all feature gates are tested, however
"EphemeralContainers": true
# 1 control plane node and 2 workers
nodes:
# the control plane node config
Expand Down
3 changes: 2 additions & 1 deletion variables.mk
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,9 @@ KIND_BUILD_DIR := ${PWD}/devkit/kind
KIND_CONFIG_DIR := tests/kind
KIND := ${KIND_BUILD_DIR}/kind
KIND_CONFIG := small-kind.yaml
KIND_IMAGE_VERSION := v1.25.3
KIND_IMAGE_VERSION := v1.29.4
KIND_WAIT := 30s
CALICO_VERSION := v3.27.0

### ci vars
# timeout for short test suite, must be parsable as Go time.Duration (60m, 2h)
Expand Down

0 comments on commit a6443ee

Please sign in to comment.