Skip to content

Commit a4f9342

Browse files
committed
Add screenshot to show valid TLS cert
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 05d5c60 commit a4f9342

File tree

2 files changed

+54
-6
lines changed

2 files changed

+54
-6
lines changed

_posts/2021-05-19-istio.md

Lines changed: 54 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@ description: "Learn how to enable Istio for OpenFaaS to take advantage of Mutual
44
date: 2021-05-12
55
image: /images/2021-05-istio/background.jpg
66
categories:
7-
- live
8-
- use-cases
7+
- security
8+
- enterprise
99
- functions
10+
- istio
1011
author_staff_member: alex
1112
dark_background: true
1213

@@ -33,8 +34,8 @@ Thank you to [John Howard](https://github.com/howardjohn) from Google for helpin
3334

3435
In this blog post we'll give you a quick introduction so that you can start integrating Istio with OpenFaaS. We'll then go on to show you how to measure the resource consumption of the cluster, and how to create a TLS certificate for the Istio Gateway.
3536

36-
There are many service mesh products available. Other popular options include: [Linkerd](https://linkerd.io), [Kuma](https://kuma.io/) and [Consul](https://learn.hashicorp.com/tutorials/consul/service-mesh).
37-
37+
> There are many service mesh products available. Other popular options include: [Linkerd](https://linkerd.io), [Kuma](https://kuma.io/) and [Consul](https://learn.hashicorp.com/tutorials/consul/service-mesh).
38+
>
3839
> You may also like the workshop we created to show how to do mutual TLS and traffic shifting with [OpenFaaS and Linkerd](https://github.com/openfaas/openfaas-linkerd-workshop).
3940
4041
## Tutorial
@@ -78,7 +79,7 @@ arkade install openfaas \
7879

7980
At this point everything is configured and you can use OpenFaaS.
8081

81-
### Deploy a test function
82+
### Access OpenFaaS with an Istio Gateway
8283

8384
Create an Istio Gateway so that we can connect to the OpenFaaS Gateway and log in.
8485

@@ -141,6 +142,8 @@ PASSWORD=$(kubectl get secret -n openfaas basic-auth -o jsonpath="{.data.basic-a
141142
echo -n $PASSWORD | faas-cli login --username admin --password-stdin
142143
```
143144

145+
### Deploy a test function
146+
144147
```bash
145148
# Find something you are interested in with:
146149
faas-cli store list
@@ -194,6 +197,43 @@ kubectl top node
194197
kubectl top pod -A
195198
```
196199

200+
These are my results after having completed the whole tutorial including: KinD, cert-manager, openfaas, inlets-operator and the metrics-server itself.
201+
202+
```bash
203+
kubectl top node
204+
NAME CPU(cores) CPU% MEMORY(bytes) MEMORY%
205+
openfaas-istio-control-plane 399m 4% 1693Mi 5%
206+
207+
kubectl top pod -A
208+
NAMESPACE NAME CPU(cores) MEMORY(bytes)
209+
cert-manager cert-manager-7998c69865-ljf2h 7m 22Mi
210+
cert-manager cert-manager-cainjector-7b744d56fb-5blx4 3m 40Mi
211+
cert-manager cert-manager-webhook-7d6d4c78bc-k58l8 3m 14Mi
212+
default inlets-operator-65d855b646-d7hrb 1m 14Mi
213+
istio-system istio-ingressgateway-5bcdc9b77f-knrpz 12m 41Mi
214+
istio-system istio-ingressgateway-tunnel-client-8676784869-wcbdc 1m 6Mi
215+
istio-system istiod-865fd47fcc-24vdp 4m 48Mi
216+
kube-system coredns-f9fd979d6-8mr5v 4m 11Mi
217+
kube-system coredns-f9fd979d6-gbmjz 5m 11Mi
218+
kube-system etcd-openfaas-istio-control-plane 32m 66Mi
219+
kube-system kindnet-mjntd 1m 9Mi
220+
kube-system kube-apiserver-openfaas-istio-control-plane 83m 412Mi
221+
kube-system kube-controller-manager-openfaas-istio-control-plane 19m 52Mi
222+
kube-system kube-proxy-jfgtc 1m 17Mi
223+
kube-system kube-scheduler-openfaas-istio-control-plane 4m 18Mi
224+
kube-system metrics-server-56c4ff648b-jzkrq 2m 15Mi
225+
local-path-storage local-path-provisioner-78776bfc44-tgr64 2m 8Mi
226+
openfaas alertmanager-7cb8f6487d-ch4fp 9m 53Mi
227+
openfaas basic-auth-plugin-565b7cbc48-h9t8d 10m 51Mi
228+
openfaas gateway-5fb6bf58dd-74j8c 15m 65Mi
229+
openfaas nats-76b689f8d8-mkwtl 10m 51Mi
230+
openfaas prometheus-5664d7cbb9-kchff 20m 101Mi
231+
openfaas queue-worker-5b7c5b898d-fqkv5 7m 47Mi
232+
openfaas-fn nodeinfo-857d9c469b-ww66k 12m 63Mi
233+
```
234+
235+
If this seems like a lot of infrastructure for running a single function, then you may be interested in taking a look at a more minimal stack with [faasd](https://github.com/openfaas/faasd). faasd runs on a single host and makes different tradeoffs so that it requires very minimal resources to run functions.
236+
197237
### Getting a TLS certificate
198238

199239
Let's now get a TLS certificate so that we can serve traffic to clients securely.
@@ -321,15 +361,23 @@ Invoke the function:
321361
curl -s -d "" $OPENFAAS_URL/function/nodeinfo
322362
```
323363

364+
![Valid TLS cert](/images/2021-05-istio/valid.png)
365+
> You can also see the certificate if you open your browser
366+
324367
## Wrapping up
325368

326369
In a short period of time we were able to deploy Istio and OpenFaaS on a local KinD cluster and see Envoy's sidecar providing mutual TLS encryption. We then went on to explore the additional resource consumption added by using Istio, and finally showed you how to create a TLS certificate for external traffic using a free certificate from Let's Encrypt.
327370

328-
If you wanted to take things further, you could look into more advanced policies for routing and traffic shifting or partial weighting using [VirtualServices](https://istio.io/latest/docs/reference/config/networking/virtual-service/) for individual functions.
371+
Istio is feature-rich, with extensive documentation and examples.
372+
373+
I found the FAQ answered many questions I had whilst preparing this tutorial and recommend taking a read: [Istio FAQ](https://istio.io/latest/about/faq/).
374+
375+
A good place to start exploring what is possible, would be the [Task-based section](https://istio.io/latest/docs/tasks/) of the documentation. For instance, you could look into more advanced policies for routing and traffic shifting or partial weighting using [VirtualServices](https://istio.io/latest/docs/reference/config/networking/virtual-service/) for individual functions.
329376

330377
> You may also like the workshop we created to show how to do mutual TLS and traffic shifting with [OpenFaaS and Linkerd](https://github.com/openfaas/openfaas-linkerd-workshop).
331378
332379
Do you have questions, comments or suggestions?
333380

334381
* Find out more about [Istio](https://istio.io)
382+
* Browse the [OpenFaaS documentation](https://docs.openfaas.com)
335383
* Join [OpenFaaS Slack](https://slack.openfaas.io/)

images/2021-05-istio/valid.png

107 KB
Loading

0 commit comments

Comments
 (0)