-
Notifications
You must be signed in to change notification settings - Fork 3
/
setup-simple15.sh
executable file
·60 lines (43 loc) · 1.99 KB
/
setup-simple15.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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
if [[ "x${ENV}" != "x" ]]; then
source ./env-${ENV}.sh
else
source ./env-default.sh
fi
kubectl create ns istio-operator
kubectl apply -f operator/1.5.10/operator.yaml
sleep 10
kubectl wait -n istio-operator deployment --all --for=condition=available --timeout=180s
# Create control plane
kubectl create ns istio-system
kubectl ns istio-system
CLUSTER_DNS_DOMAIN=${CLUSTER_DNS_DOMAIN} envsubst < operator/1.5.10/crd.yaml | kubectl apply -f -
sleep 30
kubectl wait -n istio-system deployment --all --for=condition=available --timeout=180s
sleep 5
kubectl wait -n istio-system deployment --all --for=condition=available --timeout=180s || exit 1
# Demo App
kubectl create ns istio-demo
kubectl label namespace istio-demo istio-injection=enabled
kubectl ns istio-demo
kubectl apply -f bookinfo/bookinfo-kube/bookinfo.yaml
kubectl wait -n istio-demo deployment --all --for=condition=available --timeout=180s
kubectl apply -f bookinfo/bookinfo-networking/bookinfo-gateway.yaml
kubectl apply -f bookinfo/bookinfo-networking/destination-rule-all-mtls.yaml
# Observability Stack
kubectl ns istio-system
kubectl apply -f istio-addons
sleep 2
kubectl apply -f istio-addons
kubectl rollout status deployment/kiali -n istio-system
kubectl apply -f istio-addons/extras/prometheus-configmap.yml
#kubectl apply -f istio/samples/addons/extras/zipkin.yaml
#kubectl rollout status deployment/zipkin -n istio-system
# Get and print the ingress info
INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="http2")].nodePort}')
SECURE_INGRESS_PORT=$(kubectl -n istio-system get service istio-ingressgateway -o jsonpath='{.spec.ports[?(@.name=="https")].nodePort}')
INGRESS_HOST=$(kubectl get node istio-control-plane -o jsonpath='{.status.addresses[?(@.type=="InternalIP")].address}')
GATEWAY_URL="$INGRESS_HOST:$INGRESS_PORT"
GATEWAY_SECURE_URL="$INGRESS_HOST:$SECURE_INGRESS_PORT"
echo "HTTP Gatway url: $GATEWAY_URL"
echo "HTTP Gatway secure url: $GATEWAY_SECURE_URL"