Skip to content
This repository has been archived by the owner on Aug 20, 2024. It is now read-only.

Commit

Permalink
Adding run-k8s-istio-openstack-full-demo (demo-magic) script + README…
Browse files Browse the repository at this point in the history
… updates
  • Loading branch information
ruzickap committed Feb 5, 2019
1 parent 1e9394f commit 0a1c611
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 29 deletions.
47 changes: 18 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,14 @@ Install necessary software into the Docker container:

```bash
apt update -qq
apt install -y -qq apt-transport-https curl firefox git gnupg jq openssh-client siege unzip vim
apt-get install -y -qq apt-transport-https curl firefox git gnupg jq openssh-client siege unzip vim > /dev/null
```

Install `kubernetes-client` package - (`kubectl`):

```bash
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add -
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | tee -a /etc/apt/sources.list.d/kubernetes.list
echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list
apt-get update -qq
apt-get install -y -qq kubectl
```
Expand Down Expand Up @@ -253,7 +253,7 @@ Install [Rook](https://rook.io/) Operator ([Ceph](https://ceph.com/) storage for
```bash
helm repo add rook-stable https://charts.rook.io/stable
helm install --wait --name rook-ceph --namespace rook-ceph-system rook-stable/rook-ceph
sleep 20
sleep 110
```

See how the rook-ceph-system should look like:
Expand Down Expand Up @@ -289,7 +289,7 @@ Get the [Toolbox](https://rook.io/docs/rook/master/ceph-toolbox.html) with ceph

```bash
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/toolbox.yaml
sleep 250
sleep 300
```

Check what was created in `rook-ceph` namespace:
Expand Down Expand Up @@ -336,7 +336,6 @@ Create a storage class based on the Ceph RBD volume plugin:

```bash
kubectl create -f https://raw.githubusercontent.com/rook/rook/master/cluster/examples/kubernetes/ceph/storageclass.yaml
# Give Ceph some time to create pool...
sleep 10
```

Expand Down Expand Up @@ -633,7 +632,7 @@ helm install --wait --name=elasticsearch --namespace logging es-operator/elastic
--set cerebro.enabled=true \
--set storage.class=rook-ceph-block \
--set clientReplicas=1,masterReplicas=1,dataReplicas=1
sleep 300
sleep 350
```

Show ElasticSearch components:
Expand Down Expand Up @@ -881,16 +880,16 @@ Configure port forwarding for Istio services:
# Jaeger - http://localhost:16686
kubectl port-forward -n istio-system $(kubectl get pod -n istio-system -l app=jaeger -o jsonpath="{.items[0].metadata.name}") 16686:16686 &

# Prometheus UI - http://localhost:9090/graph
# Prometheus - http://localhost:9090/graph
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=prometheus -o jsonpath="{.items[0].metadata.name}") 9090:9090 &

# Grafana - http://localhost:3000/dashboard/db/istio-mesh-dashboard
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=grafana -o jsonpath="{.items[0].metadata.name}") 3000:3000 &

# Kiali UI - http://localhost:20001
# Kiali - http://localhost:20001
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=kiali -o jsonpath="{.items[0].metadata.name}") 20001:20001 &

# Servicegraph UI - http://localhost:8088/force/forcegraph.html
# Servicegraph - http://localhost:8088/force/forcegraph.html
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=servicegraph -o jsonpath="{.items[0].metadata.name}") 8088:8088 &
```

Expand Down Expand Up @@ -919,7 +918,7 @@ Deploy the demo of [Bookinfo](https://istio.io/docs/examples/bookinfo/) applicat

```bash
kubectl apply -f samples/bookinfo/platform/kube/bookinfo.yaml
sleep 300
sleep 350
```

Confirm all services and pods are correctly defined and running:
Expand Down Expand Up @@ -970,7 +969,7 @@ Define the [Istio gateway](https://istio.io/docs/reference/config/istio.networki
```bash
cat samples/bookinfo/networking/bookinfo-gateway.yaml
kubectl apply -f samples/bookinfo/networking/bookinfo-gateway.yaml
sleep 10
sleep 5
```

Confirm the gateway has been created:
Expand Down Expand Up @@ -1336,12 +1335,6 @@ spec:

![Injecting an HTTP abort fault Kiali Graph](images/istio_kiali_injecting_an_http_abort_fault.gif "Injecting an HTTP abort fault Kiali Graph")

* Remove the application routing rules:

```bash
kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml
```

The following example returns an **HTTP 400** error code for **10%** of the requests to the `ratings` service `v1`:

```yaml
Expand Down Expand Up @@ -1428,12 +1421,6 @@ kubectl apply -f samples/bookinfo/networking/virtual-service-reviews-v3.yaml

![Bookinfo v3](images/bookinfo_v3.jpg "Bookinfo v3")

* Remove the application routing rules:

```bash
kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml
```

### Mirroring

[https://istio.io/docs/tasks/traffic-management/mirroring/](https://istio.io/docs/tasks/traffic-management/mirroring/)
Expand Down Expand Up @@ -1491,10 +1478,12 @@ kubectl logs $(kubectl get pod -l app=reviews,version=v2 -o jsonpath="{.items[0]

![Mirroring Kiali Graph](images/istio_kiali_mirroring.gif "Mirroring Kiali Graph")

* Remove the application routing rules:
* Remove the Bookinfo application and clean it up (delete the routing rules and terminate the application pods):

```bash
kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml
killall kubectl siege
sed -i "/read NAMESPACE/d" ./samples/bookinfo/platform/kube/cleanup.sh
./samples/bookinfo/platform/kube/cleanup.sh
```

## List of GUIs
Expand All @@ -1507,7 +1496,7 @@ kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml

Link: [http://localhost:16686](http://localhost:16686)

* [Prometheus UI](https://prometheus.io/) - [https://istio.io/docs/tasks/telemetry/querying-metrics/](https://istio.io/docs/tasks/telemetry/querying-metrics/)
* [Prometheus](https://prometheus.io/) - [https://istio.io/docs/tasks/telemetry/querying-metrics/](https://istio.io/docs/tasks/telemetry/querying-metrics/)

```shell
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=prometheus -o jsonpath="{.items[0].metadata.name}") 9090:9090 &
Expand All @@ -1523,7 +1512,7 @@ kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml

Link: [http://localhost:3000/dashboard/db/istio-mesh-dashboard](http://localhost:3000/dashboard/db/istio-mesh-dashboard)

* [Kiali UI](https://www.kiali.io/) - [https://istio.io/docs/tasks/telemetry/kiali/](https://istio.io/docs/tasks/telemetry/kiali/)
* [Kiali](https://www.kiali.io/) - [https://istio.io/docs/tasks/telemetry/kiali/](https://istio.io/docs/tasks/telemetry/kiali/)

```shell
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=kiali -o jsonpath="{.items[0].metadata.name}") 20001:20001 &
Expand All @@ -1535,15 +1524,15 @@ kubectl delete -f samples/bookinfo/networking/virtual-service-all-v1.yaml

Link: [http://localhost:20001](http://localhost:20001)

* Servicegraph UI - [https://istio.io/docs/tasks/telemetry/servicegraph/](https://istio.io/docs/tasks/telemetry/servicegraph/)
* Servicegraph - [https://istio.io/docs/tasks/telemetry/servicegraph/](https://istio.io/docs/tasks/telemetry/servicegraph/)

```shell
kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=servicegraph -o jsonpath="{.items[0].metadata.name}") 8088:8088 &
```

Link: [http://localhost:8088/force/forcegraph.html](http://localhost:8088/force/forcegraph.html), [http://localhost:8088/dotviz](http://localhost:8088/dotviz)

* [Kibana UI](https://www.elastic.co/products/kibana)
* [Kibana](https://www.elastic.co/products/kibana)

```shell
kubectl -n logging port-forward $(kubectl -n logging get pod -l role=kibana -o jsonpath="{.items[0].metadata.name}") 5601:5601 &
Expand Down
57 changes: 57 additions & 0 deletions run-k8s-istio-openstack-full-demo.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/usr/bin/env bash

################################################
# include the magic
################################################
test -f ./demo-magic.sh || curl --silent https://raw.githubusercontent.com/paxtonhare/demo-magic/master/demo-magic.sh > demo-magic.sh
. ./demo-magic.sh -n

################################################
# Configure the options
################################################

#
# speed at which to simulate typing. bigger num = faster
#
TYPE_SPEED=40

# Uncomment to run non-interactively
export PROMPT_TIMEOUT=1

# No wait
export NO_WAIT=true

#
# custom prompt
#
# see http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html for escape sequences
#
#DEMO_PROMPT="${GREEN}➜ ${CYAN}\W "
DEMO_PROMPT="${GREEN}${CYAN}$ "

# hide the evidence
clear

### Please run these commands before running the script

# mkdir /tmp/test && cd /tmp/test
# OPENSTACK_PASSWORD="my_secret_password"
# docker run -it -rm -e DISPLAY=$DISPLAY -e OPENSTACK_PASSWORD=$OPENSTACK_PASSWORD -v /home/$USER/.ssh:/root/.ssh:ro -v /tmp/.X11-unix:/tmp/.X11-unix -v $PWD:/mnt ubuntu
# apt update -qq && apt install -qq -y curl git psmisc pv sudo > /dev/null
# git clone https://github.com/ruzickap/k8s-istio-demo && cd k8s-istio-demo
# ./run-k8s-istio-openstack-full-demo.sh

sed -n '/^```bash$/,/^```$/p;/^-----$/p' README.md | \
sed -n '/^apt update -qq/,$p' | sed '1s/^/```bash\n/' | \
sed -e 's/^-----$/\
p ""\
p "################################################################################################### Press <ENTER> to continue"\
wait\
/' \
-e 's/^```bash$/\
pe '"'"'/' \
-e 's/^```$/'"'"'/' \
> README.sh


source README.sh

0 comments on commit 0a1c611

Please sign in to comment.