-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
58 lines (46 loc) · 2.39 KB
/
Copy pathMakefile
File metadata and controls
58 lines (46 loc) · 2.39 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
CLUSTER := capsize
.PHONY: up load down reset verify balloon unballoon init identity test-hook
up: ## create the 4-node cluster
kind create cluster --config kind-cluster.yaml
kubectl wait --for=condition=Ready nodes --all --timeout=120s
@$(MAKE) --no-print-directory verify
load: ## apply the broken-on-purpose workloads
kubectl apply -f manifests/00-namespaces.yaml
kubectl apply -f manifests/10-good-workload.yaml
kubectl apply -f manifests/20-no-limits.yaml
kubectl apply -f manifests/21-unbounded.yaml
kubectl apply -f manifests/22-limits-no-requests.yaml
kubectl apply -f manifests/23-overprovisioned.yaml
kubectl apply -f manifests/24-spot-neighbors.yaml
kubectl wait --for=condition=Available deploy --all -n prod --timeout=120s
kubectl wait --for=condition=Available deploy --all -n sandbox --timeout=120s
kubectl wait --for=condition=Available deploy --all -n batch --timeout=120s
verify: ## show node labels + allocatable, the inputs to blast radius
@echo "\n=== NODES: instance type / capacity type / allocatable ==="
@kubectl get nodes -o custom-columns=\
'NAME:.metadata.name,\
TYPE:.metadata.labels.node\.kubernetes\.io/instance-type,\
POOL:.metadata.labels.capsize\.test/pool,\
CAP:.metadata.labels.karpenter\.sh/capacity-type,\
ALLOC_MEM:.status.allocatable.memory,\
ALLOC_CPU:.status.allocatable.cpu'
@echo "\n=== PODS BY NODE ==="
@kubectl get pods -A -o wide --no-headers 2>/dev/null | awk '{print $$8"\t"$$1"/"$$2}' | sort || true
balloon: ## ⚠️ run the live failure repro (evicts neighbors on the spot node)
kubectl apply -f manifests/90-balloon.yaml
unballoon:
kubectl delete -f manifests/90-balloon.yaml --ignore-not-found
down:
kind delete cluster --name $(CLUSTER)
reset: down up load
# --- the gate -----------------------------------------------------------------
init: ## Step 1 for any clone: install the pre-push gate
@git config core.hooksPath .githooks
@echo "core.hooksPath = $$(git config --get core.hooksPath)"
@command -v gitleaks >/dev/null 2>&1 \
|| { echo "gitleaks is not installed. The pre-push gate fails closed without it: brew install gitleaks"; exit 1; }
@echo "pre-push gate installed"
identity: ## Run the pre-push gate over all of this repository's history
@./.githooks/pre-push --all-history
test-hook: ## Prove the gate rejects and accepts what it claims, both directions
@./.githooks/selftest.sh