-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (47 loc) · 1.97 KB
/
Makefile
File metadata and controls
70 lines (47 loc) · 1.97 KB
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
TF_CMD ?= terraform
OPERATOR_VERSION ?= latest
CLUSTER_NAME ?= ls-k8s-demo
usage: ## Show this help
@grep -Fh "##" $(MAKEFILE_LIST) | grep -Fv fgrep | sed -e 's/:.*##\s*/##/g' | awk -F'##' '{ printf "%-25s %s\n", $$1, $$2 }'
start: start-cluster
stop: stop-cluster
start-cluster:
kind create cluster --name $(CLUSTER_NAME)
stop-cluster:
kind delete cluster --name $(CLUSTER_NAME)
deploy-operator:
kubectl apply --server-side -f https://github.com/localstack/localstack-operator/releases/${OPERATOR_VERSION}/download/controller.yaml
destroy-operator:
kubectl delete -f https://github.com/localstack/localstack-operator/releases/${OPERATOR_VERSION}/download/controller.yaml
deploy-localstack-instance: deploy-secret
kubectl apply --server-side -f ./localstack-instance.yml
destroy-localstack-instance: destroy-secret
kubectl delete -f ./localstack-instance.yml
deploy-secret:
bash ./scripts/manage_secret.sh deploy
destroy-secret:
bash ./scripts/manage_secret.sh destroy
k9s:
k9s --logoless -r 1 --headless --crumbsless -A
debug-container:
kubectl run -i --tty --rm debug-$(shell uuidgen) --image ghcr.io/simonrw/docker-debug:main --restart=Never -- sh
logs: ## Show localstack logs
while ! kubectl logs -n workspace -f svc/localstack-env-1 2>/dev/null; do sleep 5; done
watchpods:
watch -n 1 kubectl get pods -A
port-forward: ## Forward the LocalStack port to the host
while ! bash ./scripts/port_forward.sh; do sleep 5; done
init: ## Set up terraform project
${TF_CMD} init
plan: ## Execute terraform plan
${TF_CMD} plan
apply: ## Deploy terraform application
${TF_CMD} apply -auto-approve
destroy-app: ## Destroy the application
${TF_CMD} apply -destroy -auto-approve
reset: ## Reset terraform state
rm -f terraform.tfstate terraform.tfstate.backup
invoke: ## Invoke the deployed lambda function
@cat scripts/lambda_message.txt
aws lambda invoke --function-name myfunction --payload '{}' /dev/stdout | jq .
.PHONY: apply plan reset invoke init