-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathinstall.sh
executable file
·30 lines (25 loc) · 1.45 KB
/
install.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
#!/usr/bin/env bash
set -eo pipefail
KNATIVE_NET=${KNATIVE_NET:-kourier}
KONK_BRANCH=${KONK_BRANCH:-master}
echo -e "✅ Checking dependencies... \033[0m"
STARTTIME=$(date +%s)
# The command below executes 01-kind.sh in the same bash shell so that exit commands are not swallowed
source /dev/stdin <<< "$(curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/${KONK_BRANCH}/01-kind.sh)"
echo -e "🍿 Installing Knative Serving... \033[0m"
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/${KONK_BRANCH}/02-serving.sh | bash
echo -e "🔌 Installing Knative Serving Networking Layer ${KNATIVE_NET}... \033[0m"
if [[ "$KNATIVE_NET" == "kourier" ]]; then
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/${KONK_BRANCH}/02-kourier.sh | bash
else
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/${KONK_BRANCH}/02-contour.sh | bash
fi
# Setup Knative DOMAIN DNS
INGRESS_HOST="127.0.0.1"
KNATIVE_DOMAIN=$INGRESS_HOST.sslip.io
kubectl patch configmap -n knative-serving config-domain -p "{\"data\": {\"$KNATIVE_DOMAIN\": \"\"}}"
echo -e "🔥 Installing Knative Eventing... \033[0m"
curl -sL https://raw.githubusercontent.com/csantanapr/knative-kind/${KONK_BRANCH}/04-eventing.sh | bash
DURATION=$(($(date +%s) - $STARTTIME))
echo -e "\033[0;92m 🚀 Knative install took: $(($DURATION / 60))m$(($DURATION % 60))s \033[0m"
echo -e "\033[0;92m 🎉 Now have some fun with Serverless and Event Driven Apps \033[0m"