-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
71 lines (49 loc) · 3.06 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
61
62
63
64
65
66
67
68
69
70
71
.SECONDARY:
.SECONDEXPANSION:
VERSION ?= 1.0.0
.phony: help tutorials
create-kind-cluster: ##@Test create KIND cluster
kind create cluster --config hack/kind-config.yaml --image kindest/node:v1.16.9 --name kaudit-v1.16
delete-kind-cluster: ##@Test delete KIND cluster
kind delete cluster --name kaudit-v1.16
install-helm: ##@Test install using helm chart
kubectl create ns alcide-kaudit || true
kubectl label ns alcide-kaudit skip-kaudit-admission=true || true
helm upgrade -i kaudit deploy/charts/kaudit --namespace alcide-kaudit --wait \
--set clusterName=mycluster \
--set k8s.mode=auditsink \
--set runOptions.enableStateApi=true \
--set runOptions.experimental.enableEnforcement=true
delete-helm: ##@Test delete helm chart
helm delete kaudit --namespace alcide-kaudit
HELM_VERSION=v3.2.4
get-linux-deps: ##@Install Dependencies Linux
wget -q https://get.helm.sh/helm-$(HELM_VERSION)-linux-amd64.tar.gz -O - | sudo tar -xzO linux-amd64/helm > /usr/local/bin/helm3
INSTALL_OUTDIR=deploy/install
generate-eks: ##@Generate Generate EKS installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=eks > $(INSTALL_OUTDIR)/kaudit_for_eks.yaml
generate-gke: ##@Generate Generate GKE installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=gke > $(INSTALL_OUTDIR)/kaudit_for_gke.yaml
generate-aks: ##@Generate Generate AKS installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=aks > $(INSTALL_OUTDIR)/kaudit_for_aks.yaml
generate-k8s: ##@Generate Generate Audit Sink installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=k8s --set k8s.mode="auditsink" > $(INSTALL_OUTDIR)/kaudit_for_auditsink.yaml
generate-k8s-webhook: ##@Generate Generate Audit Sink installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=k8s --set k8s.mode="webhook" > $(INSTALL_OUTDIR)/kaudit_for_webhook.yaml
generate-k8s-with-ingress: ##@Generate Generate Audit Sink installation
helm3 template kaudit deploy/charts/kaudit --set tls.mode="external" --set k8sAuditEnvironment=k8s --set k8s.mode="auditsink" --set ingress.enable=true > $(INSTALL_OUTDIR)/kaudit_for_auditsink_with_ingress.yaml
generate-all: generate-k8s generate-aks generate-gke generate-eks generate-k8s-webhook generate-k8s-with-ingress ##@Generate Generate All Deployment targets
HELP_FUN = \
%help; \
while(<>) { push @{$$help{$$2 // 'options'}}, [$$1, $$3] if /^(.+)\s*:.*\#\#(?:@(\w+))?\s(.*)$$/ }; \
print "Usage: make [options] [target] ...\n\n"; \
for (sort keys %help) { \
print "$$_:\n"; \
for (sort { $$a->[0] cmp $$b->[0] } @{$$help{$$_}}) { \
$$sep = " " x (30 - length $$_->[0]); \
print " $$_->[0]$$sep$$_->[1]\n" ; \
} print "\n"; }
help: ##@Misc Show this help
@perl -e '$(HELP_FUN)' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
USERID=$(shell id -u)