-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
30 lines (25 loc) · 888 Bytes
/
Copy pathMakefile
File metadata and controls
30 lines (25 loc) · 888 Bytes
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
CERTS_DIR=certs
NAMESPACE=test-webhook
SERVICE_DNS="admission-webhook-example-svc.${NAMESPACE}.svc"
.EXPORT_ALL_VARIABLES:
generate:
rm -rf output && mkdir output
./scripts/gen-certs.sh
./scripts/envvar-subst.sh
apply:
kubectl apply -f output/ns.yaml
kubectl -n ${NAMESPACE} apply -f output/
# not the prettiest make target
delete:
-rm -rf output certs
-kubectl delete ns ${NAMESPACE} --force --grace-period 0 &
-kubectl delete ns app1 --force --grace-period 0 &
-kubectl get namespace ${NAMESPACE} -o json > ns.json
-sed -i '' "s/\"kubernetes\"//g" ns.json
-kubectl replace --raw "/api/v1/namespaces/${NAMESPACE}/finalize" -f ns.json
-kubectl get namespace app1 -o json > ns.json
-sed -i '' "s/\"kubernetes\"//g" ns.json
-kubectl replace --raw "/api/v1/namespaces/app1/finalize" -f ns.json
test:
kubectl apply -f test-manifest/ns.yaml
kubectl apply -f test-manifest/