From 1ea665386a15d0120891a68d69f50c00fdd347e9 Mon Sep 17 00:00:00 2001 From: Soam Vasani Date: Fri, 9 Mar 2018 11:26:15 -0800 Subject: [PATCH] Docs update (#542) * Misc doc updates * Some theme updates: no all caps headers, remove blue arrows --- Documentation/docs-site/config.toml | 2 +- .../docs-site/content/concepts/_index.en.md | 3 +- .../content/concepts/environments.en.md | 2 +- .../content/installation/_index.en.md | 2 +- .../content/installation/installation.en.md | 24 +++---- .../usage/access-secret-cfgmap-in-function.md | 67 ++++++++++++------- .../content/usage/environments.en.md | 4 +- .../docs-site/content/usage/trigger.en.md | 13 ++-- .../themes/learn/layouts/partials/footer.html | 8 +-- .../themes/learn/static/css/theme-fission.css | 20 ++++-- .../themes/learn/static/css/theme.css | 4 +- 11 files changed, 85 insertions(+), 64 deletions(-) diff --git a/Documentation/docs-site/config.toml b/Documentation/docs-site/config.toml index ca8c72ac..e54176e0 100644 --- a/Documentation/docs-site/config.toml +++ b/Documentation/docs-site/config.toml @@ -11,7 +11,7 @@ defaultContentLanguageInSubdir= true editURL = "https://github.com/fission/fission/edit/master/Documentation/docs-site/content/" description = "Documentation for Fission" author = "Fission" - showVisitedLinks = true + showVisitedLinks = false themeVariant = "fission" [outputs] diff --git a/Documentation/docs-site/content/concepts/_index.en.md b/Documentation/docs-site/content/concepts/_index.en.md index d94e26d9..28265e51 100644 --- a/Documentation/docs-site/content/concepts/_index.en.md +++ b/Documentation/docs-site/content/concepts/_index.en.md @@ -7,4 +7,5 @@ weight: 30 # Fission Concepts -#### Understanding Fission terminology and concepts \ No newline at end of file +This is an overview of the few main concepts in Fission: Functions, +Environments, and Triggers. diff --git a/Documentation/docs-site/content/concepts/environments.en.md b/Documentation/docs-site/content/concepts/environments.en.md index 0b696b2e..96acea6d 100644 --- a/Documentation/docs-site/content/concepts/environments.en.md +++ b/Documentation/docs-site/content/concepts/environments.en.md @@ -1,5 +1,5 @@ --- -title: "Environment" +title: "Environments" draft: false weight: 32 --- diff --git a/Documentation/docs-site/content/installation/_index.en.md b/Documentation/docs-site/content/installation/_index.en.md index 7c2e40f9..1177392a 100644 --- a/Documentation/docs-site/content/installation/_index.en.md +++ b/Documentation/docs-site/content/installation/_index.en.md @@ -7,4 +7,4 @@ chapter : true # Installation -### Installing and upgrading Fission \ No newline at end of file +### Installing and upgrading Fission diff --git a/Documentation/docs-site/content/installation/installation.en.md b/Documentation/docs-site/content/installation/installation.en.md index 758d4e2e..bf55903f 100644 --- a/Documentation/docs-site/content/installation/installation.en.md +++ b/Documentation/docs-site/content/installation/installation.en.md @@ -20,19 +20,19 @@ ready. If you already have helm, [skip ahead to the fission install](#install-fi Ensure you have the Kubernetes CLI. You can get the Kubernetes CLI for OSX like this: -``` +```sh $ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin ``` Or, for Linux: -``` +```sh $ curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin ``` Ensure you have access to a cluster; use kubectl to check your Kubernetes version: -``` +```sh $ kubectl version ``` @@ -47,7 +47,7 @@ the next section](#install-fission). First, you'll need the helm CLI: On __OS X__: -``` +```sh $ curl -LO https://storage.googleapis.com/kubernetes-helm/helm-v2.7.0-darwin-amd64.tar.gz $ tar xzf helm-v2.7.0-darwin-amd64.tar.gz @@ -56,7 +56,7 @@ $ mv darwin-amd64/helm /usr/local/bin ``` On __Linux__: -``` +```sh $ curl -LO https://storage.googleapis.com/kubernetes-helm/helm-v2.7.0-linux-amd64.tar.gz $ tar xzf helm-v2.7.0-linux-amd64.tar.gz @@ -66,7 +66,7 @@ $ mv linux-amd64/helm /usr/local/bin Next, install the Helm server on your Kubernetes cluster: -``` +```sh $ helm init ``` @@ -74,7 +74,7 @@ $ helm init #### Minikube -``` +```sh $ helm install --namespace fission --set serviceType=NodePort https://github.com/fission/fission/releases/download/0.6.0/fission-all-0.6.0.tgz ``` @@ -84,7 +84,7 @@ want to expose anything outside the cluster. #### Cloud hosted clusters (GKE, AWS, Azure etc.) -``` +```sh $ helm install --namespace fission https://github.com/fission/fission/releases/download/0.6.0/fission-all-0.6.0.tgz ``` @@ -94,7 +94,7 @@ The fission-all helm chart installs a full set of services including the NATS message queue, influxDB for logs, etc. If you want a more minimal setup, you can install the fission-core chart instead: -``` +```sh $ helm install --namespace fission https://github.com/fission/fission/releases/download/0.6.0/fission-core-0.6.0.tgz ``` @@ -104,13 +104,13 @@ $ helm install --namespace fission https://github.com/fission/fission/releases/d Get the CLI binary for Mac: -``` +```sh $ curl -Lo fission https://github.com/fission/fission/releases/download/0.6.0/fission-cli-osx && chmod +x fission && sudo mv fission /usr/local/bin/ ``` #### Linux -``` +```sh $ curl -Lo fission https://github.com/fission/fission/releases/download/0.6.0/fission-cli-linux && chmod +x fission && sudo mv fission /usr/local/bin/ ``` @@ -123,7 +123,7 @@ this windows executable: [fission.exe](https://github.com/fission/fission/releas Finally, you're ready to use Fission! -``` +```sh $ fission env create --name nodejs --image fission/node-env:0.6.0 $ curl -LO https://raw.githubusercontent.com/fission/fission/master/examples/nodejs/hello.js diff --git a/Documentation/docs-site/content/usage/access-secret-cfgmap-in-function.md b/Documentation/docs-site/content/usage/access-secret-cfgmap-in-function.md index d07c7b0c..e12cb1f0 100644 --- a/Documentation/docs-site/content/usage/access-secret-cfgmap-in-function.md +++ b/Documentation/docs-site/content/usage/access-secret-cfgmap-in-function.md @@ -1,28 +1,38 @@ --- -title: "Accessing Secret/configmap in function" +title: "Accessing Secrets in Functions" draft: false weight: 47 --- -From fission v0.5.0 and later, functions are able to access [Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) and [ConfigMaps](https://kubernetes.io/docs/concepts/storage/volumes/#configmap) specified by users. +Functions can access Kubernetes +[Secrets](https://kubernetes.io/docs/concepts/configuration/secret/) +and +[ConfigMaps](https://kubernetes.io/docs/concepts/storage/volumes/#configmap). -### Create Secret and ConfigMap +Use secrets for things like API keys, authentication tokens, and so +on. -You can create Secret and ConfigMap with CLI. +Use config maps for any other configuration that doesn't need to be a +secret. + +### Create A Secret or a ConfigMap + +You can create a Secret or ConfigMap with the Kubernetes CLI: ``` bash -$ kubectl -n default create secret generic foo --from-literal=TEST_KEY="TESTVALUE" -$ kubectl -n default create configmap bar --from-literal=TEST_KEY=TESTVALUE +$ kubectl -n default create secret generic my-secret --from-literal=TEST_KEY="TESTVALUE" + +$ kubectl -n default create configmap my-configmap --from-literal=TEST_KEY="TESTVALUE" ``` -Or use `kubectl create -f ` to create these from a YAML file. +Or, use `kubectl create -f ` to create these from a YAML file. ``` yaml apiVersion: v1 kind: Secret metadata: namespace: default - name: foo + name: my-secret data: TEST_KEY: VEVTVFZBTFVF # value after base64 encode type: Opaque @@ -32,14 +42,16 @@ apiVersion: v1 kind: ConfigMap metadata: namespace: default - name: bar + name: my-configmap data: TEST_KEY: TESTVALUE ``` -### Access Secret and ConfigMap +### Accessing Secrets and ConfigMaps -Since content of Secret and ConfigMap are key-value pairs, functions can access them with following paths: +Secrets and configmaps are accessed similarly. Each secret or +configmap is a set of key value pairs. Fission sets these up as files +you can read from your function. ``` bash # Secret path @@ -52,24 +64,25 @@ Since content of Secret and ConfigMap are key-value pairs, functions can access From the previous example, the paths are: ``` bash -# secret foo -/secrets/default/foo/TEST_KEY +# secret my-secret +/secrets/default/my-secret/TEST_KEY -# confimap bar -/configs/default/bar/TEST_KEY +# confimap my-configmap +/configs/default/my-configmap/TEST_KEY ``` -Now, let's create a simple python function (leaker.py) that return value of Secret `foo` and ConfigMap `bar`. +Now, let's create a simple python function (leaker.py) that returns +the value of Secret `my-secret` and ConfigMap `my-configmap`. ``` python # leaker.py def main(): - path = "/configs/default/bar/TEST_KEY" + path = "/configs/default/my-configmap/TEST_KEY" f = open(path, "r") config = f.read() - path = "/secrets/default/foo/TEST_KEY" + path = "/secrets/default/my-secret/TEST_KEY" f = open(path, "r") secret = f.read() @@ -79,27 +92,29 @@ def main(): ``` -Create environment, function and http trigger. +Create an environment and a function: ``` bash # create python env $ fission env create --name python --image fission/python-env # create function named "leaker" -$ fission fn create --name leaker --env python --code leaker.py --secret foo --configmap bar - -# create route(http trigger) -$ fission route create --function leaker --url /leaker --method GET +$ fission fn create --name leaker --env python --code leaker.py --secret my-secret --configmap my-configmap ``` -Try to access the function, the output should look like following. +Run the function, and the output should look like this: ``` bash -$ curl http://$FISSION_ROUTER/leaker +$ fission function test --name leaker ConfigMap: TESTVALUE Secret: TESTVALUE ``` -Note: If the Secret or ConfigMap value is updated, the function may not get the updated value for some time; it may get a cached older value. + +{{% notice note %}} +If the Secret or ConfigMap value is updated, the function may +not get the updated value for some time; it may get a cached older +value. +{{% /notice %}} diff --git a/Documentation/docs-site/content/usage/environments.en.md b/Documentation/docs-site/content/usage/environments.en.md index 5a0b3e1a..69b5f936 100644 --- a/Documentation/docs-site/content/usage/environments.en.md +++ b/Documentation/docs-site/content/usage/environments.en.md @@ -22,7 +22,7 @@ When you create an environment, you can specify a builder image and builder comm fission env create --name python --image fission/python-env:latest --builder fission/python-builder:latest ``` -### Viweing environment information +### Viewing environment information You can list the environments or view information of an individual environment: @@ -34,4 +34,4 @@ $ $ fission env get --name node NAME UID IMAGE node ac84d62e-001f-11e8-85c9-42010aa00010 fission/node-env:0.4.0 -``` \ No newline at end of file +``` diff --git a/Documentation/docs-site/content/usage/trigger.en.md b/Documentation/docs-site/content/usage/trigger.en.md index ef6b0d01..35b64f9a 100644 --- a/Documentation/docs-site/content/usage/trigger.en.md +++ b/Documentation/docs-site/content/usage/trigger.en.md @@ -1,5 +1,5 @@ --- -title: "Trigger" +title: "Triggers" draft: false weight: 44 --- @@ -38,11 +38,16 @@ halfhourly 0 30 * * * hello minute @every 1m hello ``` -### Create a MQ Trigger +### Create a Message Queue Trigger -For creating a MQ based trigger which will invoke the function when a new message arrives in newfile topic, you can use the syntax below. The response of the function execution will be sent to topic newfileresponse. +A message queue trigger invokes a function based on messages from an +message queue. Currently, NATS and Azure Storage Queue are supported +queues. (Kafka support is under development.) ``` $ fission mqt create --name hellomsg --function hello --mqtype nats-streaming --topic newfile --resptopic newfileresponse trigger 'hellomsg' created -``` \ No newline at end of file +``` + +You can list or update message queue triggers with `fission mqt list`, +or `fission mqt update`. diff --git a/Documentation/docs-site/themes/learn/layouts/partials/footer.html b/Documentation/docs-site/themes/learn/layouts/partials/footer.html index 4fd380dc..9c31cc90 100644 --- a/Documentation/docs-site/themes/learn/layouts/partials/footer.html +++ b/Documentation/docs-site/themes/learn/layouts/partials/footer.html @@ -39,13 +39,7 @@ {{ end }} {{ end }} - - {{with ($.Scratch.Get "prevPage")}} - - {{end}} - {{with ($.Scratch.Get "nextPage")}} - - {{end}} + diff --git a/Documentation/docs-site/themes/learn/static/css/theme-fission.css b/Documentation/docs-site/themes/learn/static/css/theme-fission.css index 50652c2b..39984bc4 100644 --- a/Documentation/docs-site/themes/learn/static/css/theme-fission.css +++ b/Documentation/docs-site/themes/learn/static/css/theme-fission.css @@ -98,6 +98,7 @@ textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[typ box-shadow: inset 0 1px 3px rgba(0,0,0,.06),0 0 5px rgba(0,169,218,.7) } #header-wrapper { + /*background: #4a4a4b;*/ background: #1E022D; color: #fff; text-align: center; @@ -445,6 +446,7 @@ textarea:focus, input[type="email"]:focus, input[type="number"]:focus, input[typ } body { font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + /*font-family: -apple-system,BlinkMacSystemFont,"avenir next",avenir,"helvetica neue",helvetica,ubuntu,roboto,noto,"segoe ui",arial,sans-serif;*/ font-weight: 300; line-height: 1.6; font-size: 18px !important; @@ -457,11 +459,13 @@ h2, h3, h4, h5, h6 { letter-spacing: -1px; } h1 { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - text-align: center; - text-transform: uppercase; - color: #222; - font-weight: 200; + font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + /*font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;*/ + /*text-align: center;*/ + /*text-transform: uppercase;*/ + color: #5e5e5e; + font-weight: 400; + letter-spacing: -1px; } blockquote { border-left: 10px solid #F0F2F4; @@ -1116,8 +1120,10 @@ pre .copy-to-clipboard:hover { } #sidebar #shortcuts h3 { - font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - color: white ; + /*font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif;*/ + font-family: "Work Sans", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; + color: #eee; + font-weight: 200; margin-top:1rem; padding-left: 1rem; } diff --git a/Documentation/docs-site/themes/learn/static/css/theme.css b/Documentation/docs-site/themes/learn/static/css/theme.css index d449cd9c..0a6bce8d 100644 --- a/Documentation/docs-site/themes/learn/static/css/theme.css +++ b/Documentation/docs-site/themes/learn/static/css/theme.css @@ -458,8 +458,8 @@ h2, h3, h4, h5, h6 { } h1 { font-family: "Novacento Sans Wide", "Helvetica", "Tahoma", "Geneva", "Arial", sans-serif; - text-align: center; - text-transform: uppercase; + /*text-align: center;*/ + /* text-transform: uppercase; */ color: #222; font-weight: 200; }