From 0d3b8a6e341a1f100e5fc76245e0c545418e25d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charles-Edouard=20Br=C3=A9t=C3=A9ch=C3=A9?= Date: Thu, 14 Mar 2024 10:20:19 +0100 Subject: [PATCH] chore: add kind image loading in makefile MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Charles-Edouard Brétéché --- Makefile | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index f9a35e18..811d75fb 100644 --- a/Makefile +++ b/Makefile @@ -24,11 +24,13 @@ KO_TAGS := $(GIT_SHA) ######### TOOLS_DIR := $(PWD)/.tools +HELM ?= $(TOOLS_DIR)/helm +HELM_VERSION ?= v3.12.3 KIND := $(TOOLS_DIR)/kind KIND_VERSION := v0.22.0 KO ?= $(TOOLS_DIR)/ko KO_VERSION ?= v0.15.1 -TOOLS := $(KIND) $(KO) +TOOLS := $(HELM) $(KIND) $(KO) PIP ?= "pip" ifeq ($(GOOS), darwin) SED := gsed @@ -37,6 +39,10 @@ SED := sed endif COMMA := , +$(HELM): + @echo Install helm... >&2 + @GOBIN=$(TOOLS_DIR) go install helm.sh/helm/v3/cmd/helm@$(HELM_VERSION) + $(KIND): @echo Install kind... >&2 @GOBIN=$(TOOLS_DIR) go install sigs.k8s.io/kind@$(KIND_VERSION) @@ -137,6 +143,34 @@ mkdocs-serve: ## Generate and serve mkdocs website @$(PIP) install -U mkdocs-material mkdocs-redirects mkdocs-minify-plugin mkdocs-include-markdown-plugin lunr mkdocs-rss-plugin mike @mkdocs serve -f ./website/mkdocs.yaml +######## +# KIND # +######## + +.PHONY: kind-create-cluster +kind-create-cluster: ## Create kind cluster +kind-create-cluster: $(KIND) + @echo Create kind cluster... >&2 + @$(KIND) create cluster --image $(KIND_IMAGE) --wait 1m + +.PHONY: kind-load-image +kind-load-image: ## Build image and load it in kind cluster +kind-load-image: $(KIND) +kind-load-image: build-ko + @echo Load image in kind... >&2 + @$(KIND) load docker-image $(KO_REGISTRY)/$(PACKAGE):$(GIT_SHA) + +######### +# ISTIO # +######### + +.PHONY: install-istio +install-istio: ## Install ISTIO +install-istio: $(HELM) + @echo Install istio... >&2 + @$(HELM) upgrade --install istio-base --namespace istio-system --create-namespace --wait --repo https://istio-release.storage.googleapis.com/charts base + @$(HELM) upgrade --install istiod --namespace istio-system --create-namespace --wait --repo https://istio-release.storage.googleapis.com/charts istiod + ######## # HELP # ########