-
Notifications
You must be signed in to change notification settings - Fork 2
/
00-installer-kind.sh
executable file
·40 lines (33 loc) · 1.08 KB
/
00-installer-kind.sh
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
#!/usr/bin/env bash
set -e
# Turn colors in this script off by setting the NO_COLOR variable in your
# environment to any value:
#
# $ NO_COLOR=1 test.sh
NO_COLOR=${NO_COLOR:-""}
if [ -z "$NO_COLOR" ]; then
header=$'\e[1;33m'
reset=$'\e[0m'
else
header=''
reset=''
fi
function header_text {
echo "$header$*$reset"
}
header_text "Starting Knative on kind!"
#export K8S_IMAGE="${K8S_IMAGE:-kindest/node:v1.26.0}"
if [ $(uname) != "Darwin" ]; then
export KIND_EXPERIMENTAL_PROVIDER=podman
fi
kind create cluster --image=${K8S_IMAGE}
header_text "Waiting for core k8s services to initialize"
kubectl cluster-info --context kind-kind
sleep 5; while echo && kubectl get pods -n kube-system | grep -v -E "(Running|Completed|STATUS)"; do sleep 5; done
kubectl -n kube-system get configmap coredns -o yaml | sed 's/\/etc\/resolv.conf/8.8.8.8/gi' | kubectl apply -f -
PODNAMES=(`kubectl -n kube-system get pods -o jsonpath='{.items[*].metadata.name}'`)
for name in ${PODNAMES[@]}; do
if echo "$name" | grep -q 'coredns-'; then
kubectl -n kube-system delete pods "$name"
fi
done