From 67151888d895099e308f668127d020e409920b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Mon, 21 Aug 2023 15:56:57 +0200 Subject: [PATCH] chore: add support for different kind config (#8079) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- Makefile | 3 +- .../config/{kind.yaml => kind/default.yaml} | 0 scripts/config/kind/vap.yaml | 40 +++++++++++++++++++ 3 files changed, 42 insertions(+), 1 deletion(-) rename scripts/config/{kind.yaml => kind/default.yaml} (100%) create mode 100644 scripts/config/kind/vap.yaml diff --git a/Makefile b/Makefile index 70c24acb09..d7414fc404 100644 --- a/Makefile +++ b/Makefile @@ -9,6 +9,7 @@ REGISTRY ?= ghcr.io REPO ?= kyverno KIND_IMAGE ?= kindest/node:v1.27.3 KIND_NAME ?= kind +KIND_CONFIG ?= default GOOS ?= $(shell go env GOOS) GOARCH ?= $(shell go env GOARCH) KOCACHE ?= /tmp/ko-cache @@ -794,7 +795,7 @@ docker-save-image-all: $(KIND) image-build-all ## Save docker images in archive .PHONY: kind-create-cluster kind-create-cluster: $(KIND) ## Create kind cluster @echo Create kind cluster... >&2 - @$(KIND) create cluster --name $(KIND_NAME) --image $(KIND_IMAGE) --config ./scripts/config/kind.yaml + @$(KIND) create cluster --name $(KIND_NAME) --image $(KIND_IMAGE) --config ./scripts/config/kind/$(KIND_CONFIG).yaml .PHONY: kind-delete-cluster kind-delete-cluster: $(KIND) ## Delete kind cluster diff --git a/scripts/config/kind.yaml b/scripts/config/kind/default.yaml similarity index 100% rename from scripts/config/kind.yaml rename to scripts/config/kind/default.yaml diff --git a/scripts/config/kind/vap.yaml b/scripts/config/kind/vap.yaml new file mode 100644 index 0000000000..b6d1c2a070 --- /dev/null +++ b/scripts/config/kind/vap.yaml @@ -0,0 +1,40 @@ +kind: Cluster +apiVersion: kind.x-k8s.io/v1alpha4 +featureGates: + ValidatingAdmissionPolicy: true +runtimeConfig: + admissionregistration.k8s.io/v1alpha1: true +kubeadmConfigPatches: + - |- + kind: ClusterConfiguration + controllerManager: + extraArgs: + bind-address: 0.0.0.0 + etcd: + local: + extraArgs: + listen-metrics-urls: http://0.0.0.0:2382 + scheduler: + extraArgs: + bind-address: 0.0.0.0 + - |- + kind: KubeProxyConfiguration + metricsBindAddress: 0.0.0.0 +nodes: + - role: control-plane + kubeadmConfigPatches: + - |- + kind: InitConfiguration + nodeRegistration: + kubeletExtraArgs: + node-labels: "ingress-ready=true" + extraPortMappings: + - containerPort: 80 + hostPort: 80 + protocol: TCP + - containerPort: 443 + hostPort: 443 + protocol: TCP + - role: worker + - role: worker + - role: worker