-
Notifications
You must be signed in to change notification settings - Fork 113
/
Makefile
61 lines (50 loc) · 1.9 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
K8S_CLUSTER_NAME=kind-cluster
KIND_IMAGE_VERSION=kindest/node:v1.21.2
.PHONY: create-cluster
create-cluster:
kind create cluster --image $(KIND_IMAGE_VERSION) --name $(K8S_CLUSTER_NAME) --config=test/__tests__/data/worker-nodes-kind.yml
.PHONY: setup-kubectl
setup-kubectl:
kind export kubeconfig --name $(K8S_CLUSTER_NAME)
.PHONY: create-namespace
create-namespace:
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
# This is specific to MacBook with M1 Architecture
.PHONY: setup-docker-mac-net-connect
setup-docker-mac-net-connect:
brew install chipmk/tap/docker-mac-net-connect
sudo brew services start chipmk/tap/docker-mac-net-connect
.PHONY: pull-arm-image
pull-arm-image:
docker pull --platform linux/arm64 $(KIND_IMAGE_VERSION)
.PHONY: install-openfaas
install-openfaas:
helm repo add openfaas https://openfaas.github.io/faas-netes/
helm repo update \
&& helm upgrade openfaas --install openfaas/openfaas \
--namespace openfaas \
--set functionNamespace=openfaas-fn \
--set basic_auth=false \
--set generateBasicAuth=false \
--set ceScaling=true \
--set async=false \
--set openfaasImagePullPolicy=IfNotPresent \
--set gateway.image=rudderlabs/rudder-openfaas-gateway:0.25.2 \
--set faasnetes.image=rudderlabs/rudder-openfaas-faas-netes:0.15.4
kubectl rollout status deploy/gateway --timeout 120s -n openfaas
kubectl get events -n openfaas
kubectl get pods -n openfaas
.PHONY: setup-arm
setup-arm: setup-docker-mac-net-connect pull-arm-image create-cluster setup-kubectl create-namespace install-openfaas
.PHONY: setup
setup: create-cluster setup-kubectl create-namespace install-openfaas
.PHONY: destroy
destroy:
kind delete cluster --name $(K8S_CLUSTER_NAME)
.PHONY: uninstall
uninstall:
helm uninstall openfaas -n openfaas
.PHONY: test
test:
kubectl port-forward service/gateway-external 8080:8080 -n openfaas & \
npm run test:ut:integration:ci