Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit

Permalink
Merge pull request #181 from IBM/markdownlint
Browse files Browse the repository at this point in the history
add support for markdownlint
  • Loading branch information
jzaccone authored Jan 14, 2021
2 parents 8361398 + ebe5b88 commit df32189
Show file tree
Hide file tree
Showing 17 changed files with 105 additions and 90 deletions.
4 changes: 4 additions & 0 deletions .markdownlint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"line-length": false,
"MD014": false
}
20 changes: 7 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
language: script

services:
- docker
---
language: node_js
node_js: 10

before_script:
- npm install markdownlint-cli
script:
- bash -n $(find . -name *.sh)
- ./.verify-links.sh -v

deploy:
- provider: script
skip_cleanup: true
script: echo hi
on:
all_branches: true
- markdownlint -c .markdownlint.json workshop --ignore workshop/SUMMARY.md
- ./.verify-links.sh -v workshop
23 changes: 12 additions & 11 deletions presentation/DEMO.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Circuit-breaker
# Circuit-breaker

Now that we have reviewed the metrics Mixer is collecting, let's start generating some failures.
We will be using a simple application that will respond to our requests with an HTTP status code.
Expand All @@ -14,29 +14,30 @@ demo-circuit.sh
Let's start to generate some load to the httpbin backend to see if we can trip the circuit.

Our first load test will be with one call to ensure that we return a 200.
<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

Our single request completes with a 200.

Let's trip the breaker with 2 connections and 20 requests. Our current circuit-breaker settings only allow 1 connection and 1 pending request. We should see a 500 for at least one request in our load generation.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

After running this load test twice we now see our 503 error codes going up.

Let's generate even more load with 3 connections and 20 requests.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

## Failure testing

To test how our service deals with failure, we will try to inject some delays within our bookinfo service. This service will display books with brief descriptions. It will also dispaly ratings by calling on a seperate service.

Let's view a working example of our application.

<b>NAVIGATE TO INGRESSIP/productpage in browser</b>
**NAVIGATE TO INGRESSIP/productpage in browser.**

We create a default routing rule to enable all of our services to connect with each other over version v1 labels

```shell
./demo-failtest.sh
```
Expand All @@ -45,7 +46,7 @@ From our browser Network dev tools we can see that our landing page is loading a

Let's switch everyone over to v2 and introduce some latency between reviews and book details.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

We now get pretty stars on our landing page and our network latency has gone up slightly to X milliseconds. Now are users depend on the stars to always show up and we want to see how are system reacts when we introduce delays in calling to our reviews.

Expand All @@ -58,19 +59,19 @@ kubectl -n istio-system port-forward $(kubectl -n istio-system get pod -l app=gr
We now introduce an artificial 2 second latency for all requests to our ratings backend service with a httpFault RouteRule
(manifests/2secratings.yaml)

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

Notice how our Network debug tools always return in 2+ seconds when we refresh the page. Our ratings service graphs also show increase responce time for our 99th percentile of requests.

Now that we have artifical latency set, we can introduce a mandatory request timeout of 1 second for client's calling our reviews service. (manifests/1secreviews.yaml). Our 2 second latency should now cause failures because we timeout requests in 1 second when calling to the reviews service. We should see failures when calling to the reviews service.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

Now when we reload the page, we see an error returned indicating that we cannot fetch reviews for our book. And if we lower our grafana viewing window to 15 minutes, we see all of the metrics indicating 400s from our reviews service.

If we cleanup the delays we caused, our metrics should indicate that we are back to normal.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

Grafana shows that our 400s are now decreasing and we're back to version 1 success.

Expand All @@ -89,8 +90,8 @@ Notice how both frank and jason see the same page
We now want to add stars to our rating service to display alongside each review.
Our new rule ( scripts/samples/bookinfo/kube/route-rule-reviews-test-v2.yaml ) will filter all requests for user=jason to the v2 service while everyone else will continue to see v1.

<b>PRESS ENTER IN TERMINAL.</b>
**PRESS ENTER IN TERMINAL.**

Notice how jason can now see stars next to his reviews and if we login as frank, we still see no stars on v1

<b>PRESS ENTER IN TERMINAL TO CLEANUP</b>
**PRESS ENTER IN TERMINAL TO CLEANUP.**
4 changes: 3 additions & 1 deletion presentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@
Getting to know Istio Meetup content

## Setup

- Follow the prerequisites in [SETUP.md](./SETUP.md)
- Use the [setup script](./scripts/setup.sh) when you are ready to prepare your kubernetes cluster

## Demos

The [DEMO](./DEMO.md) contains a walkthrough of each demo and what script to run.
<b>All demo scripts should be run within the manifests directory.</b>

**All demo scripts should be run within the manifests directory.**

- Each demo script will halt for a user to press a button when further explanation is needed before continuing.
- Files will be presented to the screen after the command runs so that the presenter can review
Expand Down
17 changes: 9 additions & 8 deletions presentation/SETUP.md
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
## Istio Setup
# Istio Setup

These notes are for information and are not necessarily designed to be shown in the demo. This should be set up ahead of presentation start.

### Prerequisites
## Prerequisites

- [minikube 0.25.0](https://github.com/kubernetes/minikube#installation)
- openssl (Tested with LibreSSL 2.2.7)
- Make
- [kubectl v1.9](https://kubernetes.io/docs/tasks/tools/install-kubectl/#install-kubectl-binary-via-curl)
- MacOS: `brew update; brew install kubectl`
- [istioctl Installation steps 2 & 4](https://istio.io/docs/setup/kubernetes/quick-start.html)
- Istio 0.5.0
- Istio 0.5.0
- `make download` from the scripts directory

### Minikube Environment
## Minikube Environment

- WARNING: This command contains a MacOS workaround for cluster certificates
- WARNING: ClusterSigningCertFile & ClusterSigningKeyFile may not work on non-MacOS platforms

minikube:

```shell
minikube start \
--extra-config=controller-manager.ClusterSigningCertFile="/var/lib/localkube/certs/ca.crt" \
--extra-config=controller-manager.ClusterSigningKeyFile="/var/lib/localkube/certs/ca.key" \
--extra-config=apiserver.Admission.PluginNames=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota \
--kubernetes-version=v1.9.0
--extra-config=controller-manager.ClusterSigningCertFile="/var/lib/localkube/certs/ca.crt" \
--extra-config=controller-manager.ClusterSigningKeyFile="/var/lib/localkube/certs/ca.key" \
--extra-config=apiserver.Admission.PluginNames=NamespaceLifecycle,LimitRanger,ServiceAccount,PersistentVolumeLabel,DefaultStorageClass,DefaultTolerationSeconds,MutatingAdmissionWebhook,ValidatingAdmissionWebhook,ResourceQuota \
--kubernetes-version=v1.9.0
```

### Demo Preparation
Expand Down
1 change: 1 addition & 0 deletions presentation/scripts/install/kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Please follow the installation instructions from [istio.io](https://istio.io/docs/setup/kubernetes/quick-start.html).

## Directory structure

If you prefer to install Istio from checking out the [istio/istio](https://github.com/istio/istio) repostiory, you can run `updateVersion.sh` in the parent directory to generate the required installation files. This directory contains files needed for installing Istio on a Kubernetes cluster:

* istio.yaml - use this generated file for installation without authentication enabled
Expand Down
16 changes: 10 additions & 6 deletions presentation/scripts/samples/bookinfo/README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
# Bookinfo Sample
See https://istio.io/docs/guides/bookinfo.html.

See <https://istio.io/docs/guides/bookinfo.html>.

## Build docker images without pushing
```

```shell
src/build-services.sh <version>
```

The bookinfo versions are different from Istio versions since the sample should work with any version of Istio.

## Update docker images in the yaml files
```

```shell
sed -i "s/\(istio\/examples-bookinfo-.*\):[[:digit:]]\.[[:digit:]]\.[[:digit:]]/<your docker image with tag>/g" */bookinfo*.yaml
```

## Push docker images to docker hub

One script to build the docker images, push them to docker hub and to update the yaml files
```

```shell
build_push_update_images.sh <version>
```

## Tests
Bookinfo is tested by e2e smoke test on every PR. The Bookinfo e2e test is in [tests/e2e/tests/bookinfo](https://github.com/istio/istio/tree/master/tests/e2e/tests/bookinfo), make target `e2e_bookinfo`.

The reference productpage HTML files are in [tests/apps/bookinfo/output](https://github.com/istio/istio/tree/master/tests/apps/bookinfo/output). If the productpage HTML produced by the app is changed, remember to regenerate the reference HTML files and commit them with the same PR.
Bookinfo is tested by e2e smoke test on every PR. More info aobut the Bookinfo example can be found [here](https://github.com/istio/istio/blob/master/samples/bookinfo/README.md).
8 changes: 6 additions & 2 deletions workshop/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Beyond the Basics: Istio and IBM Cloud Kubernetes Service

[Istio](https://www.ibm.com/cloud/info/istio) is an open platform to connect, secure, control and observe microservices, also known as a service mesh, on cloud platforms such as Kubernetes in IBM Cloud Kubernetes Service and VMs. With Istio, You can manage network traffic, load balance across microservices, enforce access policies, verify service identity, secure service communication and observe what exactly is going on with your services.

YouTube: Istio Service Mesh Explained:
Expand All @@ -10,7 +11,9 @@ In this course, you can see how to install Istio alongside microservices for a s
Estimated completion time: 2 hours

## Objectives

After you complete this course, you'll be able to:

- Download and install Istio in your cluster
- Deploy the Guestbook sample app
- Use metrics, logging and tracing to observe services
Expand All @@ -20,16 +23,18 @@ After you complete this course, you'll be able to:
- Enforce policies for your microservices

## Prerequisites

You must you must have a Pay-As-You-Go, or Subscription [IBM Cloud account](https://cloud.ibm.com/registration/) to complete all the modules in this course.

You must have [already created a Standard 1.16+ cluster](https://cloud.ibm.com/docs/containers?topic=containers-clusters#clusters_standard) in IBM Cloud Kubernetes Service. **FREE Cluster is not supported for this lab**

You should have a basic understanding of containers, IBM Cloud Kubernetes Service, and Istio. If you have no experience with those, take the following courses:

1. [Get started with Kubernetes and IBM Cloud Kubernetes Service](https://cognitiveclass.ai/courses/kubernetes-course/)
2. [Get started with Istio and IBM Cloud Kubernetes Service](https://cognitiveclass.ai/courses/get-started-with-microservices-istio-and-ibm-cloud-container-service/)


## Workshop setup

- [Exercise 1 - Accessing a Kubernetes cluster with IBM Cloud Kubernetes Service](exercise-1/README.md)
- [Exercise 2 - Installing Istio](exercise-2/README.md)
- [Exercise 3 - Deploying Guestbook sample application](exercise-3/README.md)
Expand All @@ -46,4 +51,3 @@ You should have a basic understanding of containers, IBM Cloud Kubernetes Servic
Script to uninstall `ibmcloud` CLI: [clean_your_local_machine.sh](cleanup/clean_your_local_machine.sh) and unset `KUBECONFIG`.

Script to delete Istio and Guestbook: [clean_your_k8s_cluster.sh](cleanup/clean_your_k8s_cluster.sh).

2 changes: 2 additions & 0 deletions workshop/SUMMARY.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
# Table of contents

### About this workshop

* [Overview](README.md)

### Workshop setup

* [Exercise 1 - Accessing a Kubernetes cluster with IBM Cloud Kubernetes Service](exercise-1/README.md)
* [Exercise 2 - Installing Istio](exercise-2/README.md)
* [Exercise 3 - Deploying Guestbook sample application](exercise-3/README.md)
Expand Down
1 change: 0 additions & 1 deletion workshop/exercise-1/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ Learn how to set the context to work with your cluster by using the `kubectl` CL
ibmcloud ks cluster config --cluster $MYCLUSTER
```
1. Get basic information about your cluster and its worker nodes. This information can help you manage your cluster and troubleshoot issues.
a. View details of your cluster.
Expand Down
13 changes: 9 additions & 4 deletions workshop/exercise-2/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Exercise 2 - Installing Istio on IBM Cloud Kubernetes Service

In this module, you will use the Managed Istio add-on to install Istio on your cluster.
In this module, you will use the Managed Istio add-on to install Istio on your cluster.

Managed Istio is available as part of IBM Cloud™ Kubernetes Service. The service provides seamless installation of Istio, automatic updates and lifecycle management of control plane components, and integration with platform logging and monitoring tools.

Expand All @@ -20,7 +20,7 @@ Managed Istio is available as part of IBM Cloud™ Kubernetes Service. The servi
ibmcloud ks cluster addon enable istio --cluster $MYCLUSTER
```

2. The install can take up to 10 minutes. Ensure the corresponding pods are all in **`Running`** state before you continue.
1. The install can take up to 10 minutes. Ensure the corresponding pods are all in **`Running`** state before you continue.

```shell
kubectl get pods -n istio-system
Expand All @@ -30,6 +30,7 @@ Managed Istio is available as part of IBM Cloud™ Kubernetes Service. The servi

```shell
NAME READY STATUS RESTARTS AGE
istio-egressgateway-6c966469cc-52t6f 1/1 Running 0 69s
istio-egressgateway-6c966469cc-qq5qd 1/1 Running 0 55s
istio-ingressgateway-7698c7b4f4-69c24 1/1 Running 0 68s
Expand All @@ -38,18 +39,22 @@ istiod-cbb98c74d-2wvql 1/1 Running 0 54s
istiod-cbb98c74d-kcr4d 1/1 Running 0 67s
```

Before you continue, make sure all the pods are deployed and either in the **`Running`** or **`Completed`** state. If they're in `pending` state, wait a few minutes to let the installation and deployment finish.
> **NOTE** Before you continue, make sure all the pods are deployed and either in the **`Running`** or **`Completed`** state. If they're in `pending` state, wait a few minutes to let the installation and deployment finish.
1. Check the version of your Istio:
2. Check the version of your Istio:
```shell
istioctl version
```
Sample output:
```shell
client version: 1.5.6
control plane version: 1.5.6
data plane version: 1.5.6 (4 proxies)
```
Congratulations! You successfully installed Istio into your cluster.
## [Continue to Exercise 3 - Deploy Guestbook with Istio Proxy](../exercise-3/README.md)
2 changes: 1 addition & 1 deletion workshop/exercise-3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ Watson Tone Analyzer detects the tone from the words that users enter into the G

1. Open the `analyzer-deployment.yaml` and find the env section near the end of the file. Replace `YOUR_API_KEY` with your own API key, and replace `YOUR_URL` with the url value you saved before. YOUR_URL should look something like `https://gateway.watsonplatform.net/tone-analyzer/api`. Save the file.

1. Deploy the analyzer pods and service, using the `analyzer-deployment.yaml` and `analyzer-service.yaml` files found in the `guestbook/v2` directory. The analyzer service talks to Watson Tone Analyzer to help analyze the tone of a message. Ensure you are still in the `guestbook/v2` directory.
1. Deploy the analyzer pods and service, using the `analyzer-deployment.yaml` and `analyzer-service.yaml` files found in the `guestbook/v2` directory. The analyzer service talks to Watson Tone Analyzer to help analyze the tone of a message. Ensure you are still in the `guestbook/v2` directory.

```shell
kubectl apply -f analyzer-deployment.yaml
Expand Down
9 changes: 5 additions & 4 deletions workshop/exercise-4/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,13 @@ You can read more about how [Istio mixer enables telemetry reporting](https://is

### Configure Istio to receive telemetry data

3. Enable Istio monitoring dashboards, by running these two commands:
1. Enable Istio monitoring dashboards, by running these two commands:

```shell
kubectl patch cm managed-istio-custom -n ibm-operators --type='json' -p='[{"op": "add", "path": "/data/istio-monitoring", "value":"true"}]'
```
```

```shell
kubectl annotate iop -n ibm-operators managed-istio --overwrite version="custom-applied-at: $(date)"
```

Expand All @@ -26,7 +28,7 @@ You can read more about how [Istio mixer enables telemetry reporting](https://is
kubectl get services -n istio-system
```

2. Obtain the guestbook endpoint to access the guestbook.
1. Obtain the guestbook endpoint to access the guestbook.

You can access the guestbook via the external IP for your service as guestbook is deployed as a load balancer service. Get the EXTERNAL-IP of the guestbook service via output below:

Expand Down Expand Up @@ -64,7 +66,6 @@ Read more about [Jaeger](https://www.jaegertracing.io/docs/)
1. Create a secret which will be used to set the login credentials for Grafana
```shell
cat <<EOF | kubectl apply -f -
apiVersion: v1
Expand Down
4 changes: 2 additions & 2 deletions workshop/exercise-5/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ Let's leverage this feature with Istio ingress gateway:
```shell
Retrieving health check monitor statuses for NLB pods...
OK
Hostname IP Health Monitor H.Monitor Status
Hostname IP Health Monitor H.Monitor Status
mycluster-85f044fc29ce613c264409c04a76c95d-0001.us-east.containers.appdomain.cloud 169.1.1.1 Enabled Healthy
```

Expand All @@ -127,7 +127,7 @@ Congratulations! You extended the base Ingress features by providing a DNS entry

* [Kubernetes Ingress](https://kubernetes.io/docs/concepts/services-networking/ingress/)

* [Istio Ingress](https://istio.io/docs/tasks/traffic-management/ingress.html)
* [Istio Ingress](https://istio.io/latest/docs/tasks/traffic-management/ingress/)

* [Bring your own ALB](https://www.ibm.com/blogs/bluemix/2019/04/bring-your-own-alb-dns-with-health-checks-and-ssl-certificates-beta/)

Expand Down
Loading

0 comments on commit df32189

Please sign in to comment.