Skip to content

Commit

Permalink
chore(demo-app:docs) fixed the step numbering on the k8s guide readme…
Browse files Browse the repository at this point in the history
…. some slight verbiage changes. revised the steps to be headings so that they're easier to scan through.
  • Loading branch information
Daryn St. Pierre committed Oct 23, 2019
1 parent 0f9e132 commit 6904c80
Showing 1 changed file with 30 additions and 28 deletions.
58 changes: 30 additions & 28 deletions deploy/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Kubernetes Deployment Guide

## Setup Environment
## Setup Your Environment

1. Start a Kubernetes cluster with version 1.15 or higher and at least 4GB of memory
### 1. Start a Kubernetes cluster with version 1.15 or higher and at least 4GB of memory

```
$ minikube start --kubernetes-version v1.15.4
Expand All @@ -15,13 +15,13 @@ $ minikube start --kubernetes-version v1.15.4
🏄 Done! kubectl is now configured to use "minikube"
```

2. Navigate into the directory where all the kuma-demo YAML files are:
### 2. Navigate into the directory where all the kuma-demo YAML files are:

```
$ cd examples/kubernetes/kuma-demo/
```

3. Deploy Kuma's sample marketplace application
### 3. Deploy Kuma's sample marketplace application

```
$ kubectl apply -f kuma-demo-aio.yaml
Expand Down Expand Up @@ -49,7 +49,7 @@ redis-master-6d4cf995c5-nsghm 1/1 Running 0 13m

In the following steps, we will be using the pod name of the `kuma-demo-app-*************` pod. Please replace any `${KUMA_DEMO_APP_POD_NAME}` variables with your pod name.

4. Deploy the logstash service.
### 4. Deploy the logstash service.

```
$ kubectl apply -f kuma-demo-log.yaml
Expand All @@ -59,7 +59,7 @@ configmap/logstash-config created
deployment.apps/logstash created
```

5. Port-forward the sample application to access the front-end UI at http://localhost:8080
### 5. Port-forward the sample application to access the front-end UI at http://localhost:8080

<pre><code>$ kubectl port-forward <b>${KUMA_DEMO_APP_POD_NAME}</b> -n kuma-demo 8080 3001
Forwarding from 127.0.0.1:8080 -> 8080
Expand All @@ -70,10 +70,9 @@ Forwarding from [::1]:3001 -> 3001

Now you can access the marketplace application through your web browser at http://localhost:8080.

The items on the front page are pulled from the Elasticsearch service. While the reviews for each item sit within the Redis service. You can query for individual items and look at their reviews.
The items on the front page are pulled from the Elasticsearch service. While the reviews for each item sit within the Redis service. You can query for individual items and look at their reviews.


6. Download the latest version of Kuma
### 6. Download the latest version of Kuma

```
$ wget https://kong.bintray.com/kuma/kuma-0.2.2-darwin-amd64.tar.gz
Expand All @@ -94,7 +93,7 @@ kuma-0.2.2-darwin-amd64.tar.g 100%[=============================================
2019-10-13 05:54:08 (2.09 MB/s) - ‘kuma-0.2.2-darwin-amd64.tar.gz’ saved [42892462/42892462]
```

7. Unbundle the files to get the following components:
### 7. Unbundle the files to get the following components:

```
$ tar xvzf kuma-0.2.2-darwin-amd64.tar.gz
Expand All @@ -111,14 +110,14 @@ x ./README
x ./LICENSE
```

8. Go into the ./bin directory where the kuma components will be:
### 8. Go into the ./bin directory where the kuma components will be:

```
$ cd bin && ls
envoy kuma-cp kuma-dp kuma-tcp-echo kumactl
```

7. Install the control plane using `kumactl`
### 9. Install the control plane using `kumactl`

```
$ ./kumactl install control-plane | kubectl apply -f -
Expand Down Expand Up @@ -157,7 +156,7 @@ kuma-injector-9c96cddc8-745r7 1/1 Running 0 70s

In the following steps, we will be using the pod name of the `kuma-control-plane-*************` pod. Please replace any `${KUMA_CP_POD_NAME}` with your pod name.

8. Delete the existing kuma-demo pods so they restart:
### 10. Delete the existing kuma-demo pods so they restart:

```
$ kubectl delete pods --all -n kuma-demo
Expand All @@ -176,7 +175,7 @@ kuma-demo-app-8fc49ddbf-k5z5q 3/3 Running 0 2m25s
redis-master-6d4cf995c5-jxjjm 2/2 Running 0 2m25s
```

10. Port-forward the sample application again to access the front-end UI at http://localhost:8080
### 11. Port-forward the sample application again to access the front-end UI at http://localhost:8080

<pre><code>$ kubectl port-forward <b>${KUMA_DEMO_APP_POD_NAME}</b> -n kuma-demo 8080 3001
Forwarding from 127.0.0.1:8080 -> 8080
Expand All @@ -187,7 +186,7 @@ Forwarding from [::1]:3001 -> 3001

Now you can access the marketplace application through your web browser at http://localhost:8080 with Envoy handling all the traffic between the services. Happy shopping!

11. Now we will port forward the kuma-control-plane so we can access it with `kumactl`
### 12. Now we will port forward the kuma-control-plane so we can access it with `kumactl`

<pre><code>$ kubectl -n kuma-system port-forward <b>${KUMA_CP_POD_NAME}</b> 5681
Forwarding from 127.0.0.1:5681 -> 5681
Expand All @@ -196,15 +195,15 @@ Forwarding from [::1]:5681 -> 5681

Please refer to step 7 to copy the correct `${KUMA_CP_POD_NAME}`.

12. Now configure `kumactl` to point towards the control plane address
### 13. Now configure `kumactl` to point towards the control plane address

```
$ ./kumactl config control-planes add --name=minikube --address=http://localhost:5681
added Control Plane "minikube"
switched active Control Plane to "minikube"
```

13. You can use `kumactl` to look at the dataplanes in the mesh. You should see three dataplanes that correlates with our pods in Kubernetes:
### 14. You can use `kumactl` to look at the dataplanes in the mesh. You should see three dataplanes that correlates with our pods in Kubernetes:

```
$ ./kumactl inspect dataplanes
Expand All @@ -214,18 +213,18 @@ default redis-master-6d4cf995c5-jxjjm app=redis pod-template-hash=6d4cf995c5
default kuma-demo-app-8fc49ddbf-k5z5q app=kuma-demo-api pod-template-hash=8fc49ddbf service=kuma-demo-api.kuma-demo.svc:3001 Online 9m8s 9m7s 3 0
```

13. You can also use `kumactl` to look at the mesh. As shown below, our default mesh does not have mTLS enabled.
### 15. You can also use `kumactl` to look at the mesh. As shown below, our default mesh does not have mTLS enabled.

```
$ ./kumactl get meshes
NAME mTLS DP ACCESS LOGS
default off off
```

14. Let's enable mTLS.
### 16. Let's enable mTLS.

```
$ cat <<EOF | kubectl apply -f -
$ cat <<EOF | kubectl apply -f -
apiVersion: kuma.io/v1alpha1
kind: Mesh
metadata:
Expand All @@ -247,10 +246,10 @@ NAME mTLS DP ACCESS LOGS
default on off
```

15. Now let's enable traffic-permission for all services so our application will work like it use to:
### 17. Now let's enable traffic-permission for all services so our application will work like it use to:

```
$ cat <<EOF | kubectl apply -f -
$ cat <<EOF | kubectl apply -f -
apiVersion: kuma.io/v1alpha1
kind: TrafficPermission
mesh: default
Expand All @@ -269,17 +268,19 @@ EOF
```

Using `kumactl`, you can check the traffic permissions like this:

```
$ ./kumactl get traffic-permissions
MESH NAME
default everything
```

Now that we have traffic permission that allows any source to talk to any destination, our application should work like it use to.
Now that we have traffic permission that allows any source to talk to any destination, our application should work like it use to.

### 18. Let's add logging for traffic between all services and send them to logstash:

16. Let's add logging for traffic between all services and send them to logstash:
```
$ cat <<EOF | kubectl apply -f -
$ cat <<EOF | kubectl apply -f -
apiVersion: kuma.io/v1alpha1
kind: Mesh
metadata:
Expand Down Expand Up @@ -323,11 +324,13 @@ spec:
backend: logstash
EOF
```

Logs will be sent to https://kumademo.loggly.com/

17. Now let's take down our Redis service because someone is spamming fake reviews. We can easily accomplish that by changing our traffic-permissions:
### 19. Now let's take down our Redis service because someone is spamming fake reviews. We can easily accomplish that by changing our traffic-permissions:

```
$ cat <<EOF | kubectl apply -f -
$ cat <<EOF | kubectl apply -f -
apiVersion: kuma.io/v1alpha1
kind: TrafficPermission
mesh: default
Expand All @@ -346,4 +349,3 @@ EOF
```

Now try to access the reviews on each item. They will not load because of the traffic-permissions you described in the the policy above.

0 comments on commit 6904c80

Please sign in to comment.