Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: add kind image loading in makefile #48

Merged
merged 1 commit into from
Mar 14, 2024
Merged
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
36 changes: 35 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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 #
########
Expand Down