diff --git a/docs/content/en/docs/usage/functions.en.md b/docs/content/en/docs/usage/functions.en.md index c51af9fd..2465743f 100644 --- a/docs/content/en/docs/usage/functions.en.md +++ b/docs/content/en/docs/usage/functions.en.md @@ -4,12 +4,12 @@ draft: false weight: 2 --- -This section walks through working with functions, for controlling execution of functions please refer to [Controlling Function Execution]({{% relref "executor.en.md" %}}) +This section walks through working with functions, for controlling execution of functions please refer to [Controlling Function Execution]({{% ref "executor.en.md" %}}) ### Create a function Before creating a function, you'll need an environment; read -[environments]({{% relref "environments.en.md" %}}) if you +[environments]({{% ref "environments.en.md" %}}) if you haven't already. Let's create an environment for our function. @@ -43,7 +43,7 @@ $ fission route create --function hello --url /hello trigger '5327e9a7-6d87-4533-a4fb-c67f55b1e492' created ``` -Setup [FISSION_ROUTER]({{% relref "../installation/env_vars.en.md" %}}) environment variable if you haven't already. +Setup [FISSION_ROUTER]({{% ref "../installation/env_vars.en.md" %}}) environment variable if you haven't already. When you hit this function's URL, you get the expected response: @@ -138,7 +138,7 @@ $ fission fn logs --name hello Most real world functions will require more than one source files. It is also easier to simply provide source files and let Fission take care of building from source files. Fission provides first class support for building from source as well as using compiled artifacts to create functions. -You can attach the source/deployment packages to a function or explicitly create packages and use them across functions. Check documentation for [package]({{% relref "package.en.md" %}}) for more information. +You can attach the source/deployment packages to a function or explicitly create packages and use them across functions. Check documentation for [package]({{% ref "package.en.md" %}}) for more information. #### Building functions from source @@ -229,7 +229,7 @@ b: {c: 3, d: 4} ``` If you're using Fission with source code, be sure to read about the -recommended [development workflow]({{%relref "../spec/_index.md" %}}). +recommended [development workflow]({{%ref "../spec/_index.md" %}}). #### Using compiled artifacts with Fission diff --git a/docs/content/en/docs/usage/using-fission-api.md b/docs/content/en/docs/usage/using-fission-api.md new file mode 100644 index 00000000..71b7380f --- /dev/null +++ b/docs/content/en/docs/usage/using-fission-api.md @@ -0,0 +1,43 @@ +--- +title: "Using Fission API" +date: 2020-04-18T14:56:20+05:30 +draft: false +--- + +# Introduction + +The Fission API can be accessed from Kubernetes API as well as from the Fission controller directly. + +# With Kubernetes API + +Fission is built using Kubernetes CRDs and the Fission API follows the standard Kubernetes API model. If you are not aware of Kubernetes API or never used it before, it would be a good idea to have a [Kubernetes API documentation](https://kubernetes.io/docs/concepts/overview/kubernetes-api). Kubernetes also supports the OpenAPI standard and provides Swagger definitions as you can notice in the [Kubernetes API documentation page](https://kubernetes.io/docs/concepts/overview/kubernetes-api/#openapi-and-swagger-definitions). For more details on authentication and authorization with the API you can check the documentation on [Controlling Access to Kubernetes API](https://kubernetes.io/docs/reference/access-authn-authz/controlling-access/) + +You can download the entire the Kubernetes API documentation from a cluster which has Fission installed - so you also get Fission API calls built in the definition. + +- To download the entire Kubernetes API Swagger definition, assuming you are proxying the API server on localhost use the URL: [http://localhost:8001/openapi/v2](http://localhost:8001/openapi/v2). The Kubernetes API document is huge and generally consumes a lot of resources when you are trying to load it in browser. You can use https://editor.swagger.io/ to load the doc in browser or sign up at http://app.swaggerhub.com/ and then create APIs by importing the document. + +- We have also hosted a Swagger DOC created in April 2020 here for a Kubernetes cluster with Fission installed: https://app.swaggerhub.com/apis/Infracloud/kubernetes/v1.15.9#/fissionIo_v1 + + +![Kubernetes API](/images/fission-k8s.png) + + +# With Fission Controller + +To download only the Fission Swagger API doc, assuming you are proxying the API server on localhost use the URL: [http://localhost:8001/api/v1/namespaces/fission/services/controller:80/proxy/v2/apidocs.json](http://localhost:8001/api/v1/namespaces/fission/services/controller:80/proxy/v2/apidocs.json) + +For accessing this API, you will have to proxy the controller pod locally and then access the API. For programmatic access this means you should be able to access controller pod from outside the cluster. + +``` +$ kubectl port-forward controller-548c5d8988-fgqxt 8888:8888 +Forwarding from 127.0.0.1:8888 -> 8888 +Forwarding from [::1]:8888 -> 8888 +Handling connection for 8888 + +``` + +![Fission Controller API](/images/fission-controller-api.png) + +# Reccomended Approach + + diff --git a/docs/static/images/fission-controller-api.png b/docs/static/images/fission-controller-api.png new file mode 100644 index 00000000..19706789 Binary files /dev/null and b/docs/static/images/fission-controller-api.png differ diff --git a/docs/static/images/fission-k8s.png b/docs/static/images/fission-k8s.png new file mode 100644 index 00000000..7a0119a6 Binary files /dev/null and b/docs/static/images/fission-k8s.png differ