-
Notifications
You must be signed in to change notification settings - Fork 35
/
Makefile
60 lines (41 loc) · 1.47 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
SHELL := /bin/bash
CONTAINER_NAME=expediagroup/kubernetes-sidecar-injector
IMAGE_TAG?=$(shell git rev-parse HEAD)
KIND_REPO?="kindest/node"
KUBE_VERSION = v1.21.12
KIND_CLUSTER?=cluster1
SRC=$(shell find . -type f -name '*.go' -not -path "./vendor/*")
lint:
staticcheck ./...
vet:
go vet ./...
test:
go test ./...
tidy:
go mod tidy
imports:
goimports -w ${SRC}
clean:
go clean
build: clean vet lint
go build -o kubernetes-sidecar-injector
release: clean vet lint
CGO_ENABLED=0 GOOS=linux go build -o kubernetes-sidecar-injector
docker:
docker build --no-cache -t ${CONTAINER_NAME}:${IMAGE_TAG} .
kind-load: docker
kind load docker-image ${CONTAINER_NAME}:${IMAGE_TAG} --name ${KIND_CLUSTER}
helm-install:
helm upgrade -i kubernetes-sidecar-injector ./charts/kubernetes-sidecar-injector/. --namespace=sidecar-injector --create-namespace --set image.tag=${IMAGE_TAG}
helm-template:
helm template kubernetes-sidecar-injector ./charts/kubernetes-sidecar-injector
kind-create:
-kind create cluster --image "${KIND_REPO}:${KUBE_VERSION}" --name ${KIND_CLUSTER}
kind-install: kind-load helm-install
kind: kind-create kind-install
follow-logs:
kubectl logs -n sidecar-injector deployment/kubernetes-sidecar-injector --follow
install-sample-container:
helm upgrade -i inject-container ./sample/chart/echo-server/. --namespace=sample --create-namespace
install-sample-init-container:
helm upgrade -i inject-init-container ./sample/chart/nginx/. --namespace=sample --create-namespace