From e70ea9c4993734ad545762b21f97cc74dea09eac Mon Sep 17 00:00:00 2001 From: Yuval Kohavi Date: Wed, 25 Apr 2018 10:49:58 -0400 Subject: [PATCH 1/2] added fission example doc --- docs/tutorials/fission.md | 81 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 docs/tutorials/fission.md diff --git a/docs/tutorials/fission.md b/docs/tutorials/fission.md new file mode 100644 index 00000000000..b466cf29368 --- /dev/null +++ b/docs/tutorials/fission.md @@ -0,0 +1,81 @@ +This document shows how to access your OpenFaaS functions securly via Gloo. We will deploy everything +to minikube. With minor adjustments can be applied to any kubernets cluster. + +# Deploy Fission & Gloo +The official OpenFaas install guide is here: https://docs.fission.io/0.6.0/installation/installation/ + +Setting up kubernetes: https://docs.fission.io/0.6.0/installation/kubernetessetup/ + + +To install gloo, run: +``` +kubectl apply -f https://raw.githubusercontent.com/solo-io/gloo-install/master/kube/install.yaml +``` + +# Deploy Function + +Let's deploy an example function: this can also be found on the install guide, here: https://docs.fission.io/0.6.0/installation/installation/#run-an-example + +``` +fission env create --name nodejs --image fission/node-env +curl -LO https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js +fission function create --name hello --env nodejs --code hello.js +fission function test --name hello +``` + +With in a minute or so, you will see a function added to the gateway upstream: +``` +$ glooctl upstream get fission-router-80 ++-------------------+------------+----------+----------+ +| NAME | TYPE | STATUS | FUNCTION | ++-------------------+------------+----------+----------+ +| fission-router-80 | kubernetes | Accepted | hello | ++-------------------+------------+----------+----------+ + +``` + +# Secure Access +Lets provide secure access for it! + +create a pair of ssl certs. make sure to provide a Common Name when creating the certificate, +envoy will reject a certificate without one: +``` +openssl req -x509 -newkey rsa:4096 -keyout server.key -out server.cert -days 365 -nodes +``` + +Add the certificates as secrets to kubernetes (this makes them available to gloo): +``` +glooctl secret create certificate --name gloo-secure -c server.cert -p server.key +``` + +Configure gloo's default virtual host to route to the function and use the certificates: +``` +$ cat < Date: Fri, 27 Apr 2018 09:05:57 -0400 Subject: [PATCH 2/2] typo --- docs/tutorials/fission.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/tutorials/fission.md b/docs/tutorials/fission.md index b466cf29368..4e4568044fe 100644 --- a/docs/tutorials/fission.md +++ b/docs/tutorials/fission.md @@ -1,8 +1,8 @@ -This document shows how to access your OpenFaaS functions securly via Gloo. We will deploy everything +This document shows how to access your Fission functions securly via Gloo. We will deploy everything to minikube. With minor adjustments can be applied to any kubernets cluster. # Deploy Fission & Gloo -The official OpenFaas install guide is here: https://docs.fission.io/0.6.0/installation/installation/ +The official Fission install guide is here: https://docs.fission.io/0.6.0/installation/installation/ Setting up kubernetes: https://docs.fission.io/0.6.0/installation/kubernetessetup/