Skip to content

Commit 0ee4868

Browse files
mflendrichTravis Raines
and
Travis Raines
authored
docs: add guide on setting up with k8s 1.18 and istio 1.6.7
From Kong#798 Co-authored-by: Travis Raines <[email protected]>
1 parent 7a91640 commit 0ee4868

File tree

2 files changed

+237
-21
lines changed

2 files changed

+237
-21
lines changed

docs/guides/README.md

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,72 +4,73 @@ Follow one of the guides to learn more about how to use
44
Kong Ingress controller:
55

66
- [Getting started](getting-started.md) with Kong Ingress Controller
7-
- [Using KongPlugin resource](using-kongplugin-resource.md)
7+
- [Getting started using Istio](getting-started-istio.md) with Kong Ingress Controller and Istio
8+
- [Using KongPlugin resource](using-kongplugin-resource.md)
89
This guide walks through setting up plugins in Kong using a declarative
910
approach.
10-
- [Using KongIngress resource](using-kongingress-resource.md)
11+
- [Using KongIngress resource](using-kongingress-resource.md)
1112
This guide explains how the KongIngress resource can be used to change Kong
1213
specific settings like load-balancing, health-checking and proxy behaviour.
13-
- [Using KongConsumer and KongCredential resources](using-consumer-credential-resource.md)
14+
- [Using KongConsumer and KongCredential resources](using-consumer-credential-resource.md)
1415
This guide walks through how Kubernetes native declarative configuration
1516
can be used to dynamically provision credentials for authentication purposes
1617
in the Ingress layer.
17-
- [Using JWT and ACL KongPlugin resources](configure-acl-plugin.md)
18+
- [Using JWT and ACL KongPlugin resources](configure-acl-plugin.md)
1819
This guides walks you through configuring the JWT plugin and ACL plugin for
1920
authentication purposes at the Ingress layer
20-
- [Using cert-manager with Kong](cert-manager.md)
21+
- [Using cert-manager with Kong](cert-manager.md)
2122
This guide walks through how to use cert-manager along with Kong Ingress
2223
Controller to automate TLS certificate provisioning and using them
2324
to encrypt your API traffic.
24-
- [Configuring a fallback service](configuring-fallback-service.md)
25+
- [Configuring a fallback service](configuring-fallback-service.md)
2526
This guide walks through how to setup a fallback service using Ingress
2627
resource. The fallback service will receive all requests that don't
2728
match against any of the defined Ingress rules.
28-
- [Using external service](using-external-service.md)
29+
- [Using external service](using-external-service.md)
2930
This guide shows how to expose services running outside Kubernetes via Kong,
3031
using [External Name](https://kubernetes.io/docs/concepts/services-networking/service/#externalname)
3132
Services in Kubernetes.
32-
- [Configuring HTTPS redirects for your services](configuring-https-redirect.md)
33+
- [Configuring HTTPS redirects for your services](configuring-https-redirect.md)
3334
This guide walks through how to configure Kong Ingress Controller to
3435
redirect HTTP request to HTTPS so that all communication
3536
from the external world to your APIs and microservices is encrypted.
36-
- [Using Redis for rate-limiting](redis-rate-limiting.md)
37+
- [Using Redis for rate-limiting](redis-rate-limiting.md)
3738
This guide walks through how to use Redis for storing rate-limit information
3839
in a multi-node Kong deployment.
39-
- [Integrate Kong Ingress Controller with Prometheus/Grafana](prometheus-grafana.md)
40+
- [Integrate Kong Ingress Controller with Prometheus/Grafana](prometheus-grafana.md)
4041
This guide walks through the steps of how to deploy Kong Ingress Controller
4142
and Prometheus to obtain metrics for the traffic flowing into your
4243
Kubernetes cluster.
43-
- [Configuring circuit-breaker and health-checking](configuring-health-checks.md)
44+
- [Configuring circuit-breaker and health-checking](configuring-health-checks.md)
4445
This guide walks through the usage of Circuit-breaking and health-checking
4546
features of Kong Ingress Controller.
46-
- [Setting up custom plugin](setting-up-custom-plugins.md)
47+
- [Setting up custom plugin](setting-up-custom-plugins.md)
4748
This guide walks through
4849
installation of a custom plugin into Kong using
4950
ConfigMaps and Volumes.
50-
- [Using ingress with gRPC](using-ingress-with-grpc.md)
51+
- [Using ingress with gRPC](using-ingress-with-grpc.md)
5152
This guide walks through how to use Kong Ingress Controller with gRPC.
52-
- [Setting up upstream mTLS](upstream-mtls.md)
53+
- [Setting up upstream mTLS](upstream-mtls.md)
5354
This guide gives an overview of how to setup mutual TLS authentication
5455
between Kong and your upstream server.
55-
- [Preserveing Client IP address](preserve-client-ip.md)
56+
- [Preserveing Client IP address](preserve-client-ip.md)
5657
This guide gives an overview of different methods to preserve the Client
5758
IP address.
58-
- [Using KongClusterPlugin resource](using-kongclusterplugin-resource.md)
59+
- [Using KongClusterPlugin resource](using-kongclusterplugin-resource.md)
5960
This guide walks through setting up plugins that can be shared across
6061
Kubernetes namespaces.
61-
- [Using Kong with Knative](using-kong-with-knative.md)
62+
- [Using Kong with Knative](using-kong-with-knative.md)
6263
This guide gives an overview of how to setup Kong as the Ingress point
6364
for Knative workloads.
64-
- [Exposing TCP-based service](using-tcpingress.md)
65+
- [Exposing TCP-based service](using-tcpingress.md)
6566
This guide gives an overview of how to use TCPIngress resource to expose
6667
non-HTTP based services outside a Kubernetes cluster.
67-
- [Using mtls-auth plugin](using-mtls-auth-plugin.md)
68+
- [Using mtls-auth plugin](using-mtls-auth-plugin.md)
6869
This guide gives an overview of how to use `mtls-auth` plugin and CA
6970
certificates to authenticate requests using client certificates.
70-
- [Configuring custom entities in Kong](configuring-custom-entities.md)
71+
- [Configuring custom entities in Kong](configuring-custom-entities.md)
7172
This guide gives an overview of how to configure custom entities for
7273
deployments of Kong Ingress Controller running without a database.
73-
- [Using OpenID-connect plugin](using-oidc-plugin.md)
74+
- [Using OpenID-connect plugin](using-oidc-plugin.md)
7475
This guide walks through steps necessary to set up OIDC authentication.
7576

docs/guides/getting-started-istio.md

Lines changed: 215 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,215 @@
1+
## Running Kong Ingress Controller with Istio
2+
3+
In this guide, you will:
4+
* Install Istio v1.6.7 and Kong in your cluster.
5+
* Deploy an example Istio-enabled application (_bookinfo_).
6+
* Deploy an `Ingress` customized with a `KongPlugin` for the example application.
7+
* Make several requests to the sample application via Kong and Istio.
8+
* See the performance metrics of the sample application, provided by Istio.
9+
10+
### Prerequisites
11+
For this guide, you will need:
12+
13+
* A Kubernetes v1.15 (or newer) cluster which can pull container images from public registries. For example, you can use:
14+
* A managed Kubernetes cluster (AWS EKS, Google Cloud GKE, Azure AKS).
15+
* Minikube.
16+
* `microk8s` with the `dns` addon enabled.
17+
* `kubectl` with admin access to the cluster.
18+
19+
### Download Istio
20+
21+
Download the Istio bundle at version 1.6.7:
22+
23+
```console
24+
$ curl -L https://istio.io/downloadIstio | env ISTIO_VERSION=1.6.7 sh -
25+
...
26+
...
27+
Istio 1.6.7 Download Complete!
28+
29+
Istio has been successfully downloaded into the istio-1.6.7 folder on your system.
30+
...
31+
...
32+
```
33+
34+
### Install Istio Operator
35+
36+
Invoke `istioctl` to deploy the Istio Operator to the Kubernetes cluster:
37+
38+
```console
39+
$ ./istio-1.6.7/bin/istioctl operator init
40+
Using operator Deployment image: docker.io/istio/operator:1.6.7
41+
✔ Istio operator installed
42+
✔ Installation complete
43+
```
44+
45+
### Deploy Istio using Operator
46+
47+
Deploy Istio using Istio Operator:
48+
49+
```console
50+
$ kubectl create namespace istio-system
51+
namespace/istio-system created
52+
```
53+
```console
54+
$ kubectl apply -f - <<EOF
55+
apiVersion: install.istio.io/v1alpha1
56+
kind: IstioOperator
57+
metadata:
58+
namespace: istio-system
59+
name: example-istiocontrolplane
60+
spec:
61+
profile: demo
62+
EOF
63+
istiooperator.install.istio.io/example-istiocontrolplane created
64+
```
65+
```console
66+
$ kubectl describe istiooperator -n istio-system
67+
...
68+
...
69+
Status:
70+
Status: RECONCILING
71+
...
72+
...
73+
```
74+
75+
Wait until the `kubectl describe istiooperator` command returns `Status: HEALTHY`.
76+
77+
### Deploy Kong Ingress Controller in an Istio-enabled namespace
78+
79+
```console
80+
$ kubectl create namespace kong-istio
81+
namespace/kong-istio created
82+
```
83+
```console
84+
$ kubectl label namespace kong-istio istio-injection=enabled
85+
namespace/kong-istio labeled
86+
```
87+
```console
88+
$ helm install -n kong-istio example-kong kong/kong --set ingressController.installCRDs=false
89+
...
90+
NAME: example-kong
91+
LAST DEPLOYED: Mon Aug 10 15:14:44 2020
92+
NAMESPACE: kong-istio
93+
STATUS: deployed
94+
...
95+
```
96+
97+
_Optional:_ Run `kubectl describe pod -n kong-istio -l app.kubernetes.io/instance=example-kong` to see that the Istio sidecar (`istio-proxy`) is running alongside Kong Ingress Controller.
98+
99+
### Deploy bookinfo in an Istio-enabled namespace
100+
101+
Deploy the sample _bookinfo_ app from the Istio bundle:
102+
103+
```console
104+
$ kubectl create namespace my-istio-app
105+
namespace/my-istio-app created
106+
```
107+
```console
108+
$ kubectl label namespace my-istio-app istio-injection=enabled
109+
namespace/my-istio-app labeled
110+
kubectl apply -n my-istio-app -f istio-1.6.7/samples/bookinfo/platform/kube/bookinfo.yaml
111+
```
112+
Wait until the application is up:
113+
```console
114+
$ kubectl wait --for=condition=Available deployment productpage -n my-istio-app --timeout=240s
115+
```
116+
### Deploy ingress
117+
118+
Define a `KongPlugin` rate-limiting access to 100 requests per minute. Define an `Ingress` telling Kong to proxy traffic
119+
to a service belonging to the sample application:
120+
121+
```console
122+
$ kubectl apply -f - <<EOF
123+
apiVersion: configuration.konghq.com/v1
124+
kind: KongPlugin
125+
metadata:
126+
name: rate-limit
127+
namespace: my-istio-app
128+
plugin: rate-limiting
129+
config:
130+
minute: 30
131+
policy: local
132+
EOF
133+
```
134+
135+
```console
136+
$ kubectl apply -f - <<EOF
137+
apiVersion: extensions/v1beta1
138+
kind: Ingress
139+
metadata:
140+
name: productpage
141+
namespace: my-istio-app
142+
annotations:
143+
konghq.com/plugins: rate-limit
144+
spec:
145+
rules:
146+
- http:
147+
paths:
148+
- path: /
149+
backend:
150+
serviceName: productpage
151+
servicePort: 9080
152+
```
153+
154+
### Make some requests to the sample application
155+
156+
Connect to the sample application served via Kong and Istio.
157+
158+
Note that `8080:80` means that `kubectl` will open the `tcp/8080` port on the local system and forward all requests to
159+
Kong's port `80`.
160+
161+
```console
162+
$ # Keep the command below running in the background
163+
$ kubectl port-forward service/example-kong-kong-proxy 8080:80 -n kong-istio
164+
Forwarding from 127.0.0.1:8080 -> 8000
165+
Forwarding from [::1]:8080 -> 8000
166+
...
167+
```
168+
169+
Navigate your web browser to `http://localhost:8080/` You should be able to see a bookstore web application. Click
170+
through any available links several times. As you hit 30 requests per minute (for example, by holding down the "Refresh"
171+
key combination, e.g. `<Ctrl-R>` or `<Command-R>`), you should obtain a `Kong Error - API rate limit exceeded` response.
172+
173+
### See the connection graph in Kiali
174+
175+
Connect to Kiali (the Istio dashboard):
176+
177+
```console
178+
$ # Keep the command below running in the background
179+
$ kubectl port-forward service/kiali 20001:20001 -n istio-system
180+
Forwarding from 127.0.0.1:20001 -> 20001
181+
Forwarding from [::1]:20001 -> 20001
182+
...
183+
```
184+
185+
* Navigate your web browser to `http://localhost:20001/`.
186+
* Log in using the default credentials (`admin`/`admin`).
187+
* Choose _Workloads_ from the menu on the left.
188+
* Select `my-istio-app` in the _Namespace_ drop-down menu.
189+
* Click the _productpage-v1_ service name.
190+
* Click the three dots button in the top-right corner of _Graph Overview_ and click _Show full graph_.
191+
* Select `kong-istio` alongside `my-istio-app` in the _Namespace_ diagram.
192+
* Observe a connection graph spanning from `example-kong-kong-proxy` through `productpage-v1` to the other sample
193+
application services such as `ratings-v1` and `details-v1`.
194+
195+
### See the metrics in Grafana
196+
197+
Connect to Grafana (a dashboard frontend for Prometheus which has been deployed with Istio):
198+
199+
```console
200+
$ # Keep the command below running in the background
201+
$ kubectl port-forward service/grafana 3000:3000 -n istio-system
202+
Forwarding from 127.0.0.1:3000 -> 3000
203+
Forwarding from [::1]:3000 -> 3000
204+
...
205+
```
206+
207+
* Navigate your web browser to `http://localhost:3000/`.
208+
* Expand the dashboard selection drop-down menu from the top of the screen. Expand the `istio` directory and choose the
209+
_Istio Workload Dashboard_ from the list.
210+
* Choose _Namespace: my-istio-app_ and _Workload: productpage-v1_ from the drop-downs.
211+
* Choose a timespan in the top-right of the page to include the time when you made requests to the sample application (e.g. _Last 1 hour_).
212+
* Observe the incoming and outgoing request graphs reflecting actual requests from Kong to `productpage-v1`, and from `productpage-v1` to its backends.
213+
214+
Note that the requests from the web browser to Kong are not reflected in inbound stats of `example-kong-kong-proxy`
215+
because we've issued these requests by `kubectl port-forward`, thus bypassing the Istio proxy sidecar in Kong.

0 commit comments

Comments
 (0)