|
1 | 1 | # Kubeless Runtime Variants
|
2 | 2 |
|
3 |
| -By default Kubeless has support for the following runtimes: |
| 3 | +By default Kubeless has support for runtimes in different states: stable and incubator. You can find the different runtimes available in this repository: |
4 | 4 |
|
5 |
| - - Python: For the branches 2.7, 3.4 and 3.6 |
6 |
| - - NodeJS: For the branches 6 and 8, as well as NodeJS [distroless](https://github.com/GoogleContainerTools/distroless) for the branch 8 |
7 |
| - - Ruby: For the branches 2.3, 2.4 and 2.5 |
8 |
| - - PHP: For the branch 7.2 |
9 |
| - - Golang: For the branch 1.10 |
10 |
| - - .NET: For the branch 2.0 |
11 |
| - - Ballerina: For the branch 0.981.0 |
| 5 | +[https://github.com/kubeless/runtimes](https://github.com/kubeless/runtimes). |
12 | 6 |
|
13 |
| -You can see the list of supported runtimes executing: |
| 7 | +You can also see the list of supported runtimes that your Kubeless installation can use executing: |
14 | 8 |
|
15 | 9 | ```console
|
16 | 10 | $ kubeless get-server-config
|
17 | 11 | INFO[0000] Current Server Config:
|
18 | 12 | INFO[0000] Supported Runtimes are: python2.7, python3.4, python3.6, nodejs6, nodejs8, ruby2.3, ruby2.4, ruby2.5, php7.2, go1.10, dotnetcore2.0, java1.8, ballerina0.981.0
|
19 | 13 | ```
|
20 | 14 |
|
21 |
| -Each runtime is encapsulated in a container image. The reference to these images are injected in the Kubeless configuration. You can find the source code of all runtimes in [`docker/runtime`](https://github.com/kubeless/kubeless/tree/master/docker/runtime). |
| 15 | +Each runtime is encapsulated in a container image. The reference to these images are injected in the Kubeless configuration. |
22 | 16 |
|
23 | 17 | ### NodeJS
|
24 | 18 |
|
@@ -48,6 +42,8 @@ $ kubeless function deploy myFunction --runtime nodejs6 \
|
48 | 42 | --from-file test.js
|
49 | 43 | ```
|
50 | 44 |
|
| 45 | +It's also possible to add another piece of configuration for your NPM file if the variable `NPM_CONFIG_EXTRA` is set. In case it's used, the build process will execute `npm config set $NPM_CONFIG_EXTRA` before installing dependencies. |
| 46 | + |
51 | 47 | Depending on the size of the payload sent to the NodeJS function it is possible to find the error `413 PayloadTooLargeError`. It is possible to increase this limit setting the environment variable `REQ_MB_LIMIT`. This will define the maximum size in MB that the function will accept:
|
52 | 48 |
|
53 | 49 | ```console
|
@@ -139,6 +135,21 @@ $ kubeless function deploy myFunction --runtime nodejs_distroless8 \
|
139 | 135 | --from-file test.js
|
140 | 136 | ```
|
141 | 137 |
|
| 138 | +#### CloudEvents 0.1 Variant |
| 139 | + |
| 140 | +[CloudEvents](https://cloudevents.io) is a CNCF effort to standardize the way events are represented in the Cloud. There is a variant of the Node.js 8 runtime that is ready to receive events that follow that specification (v0.1). |
| 141 | + |
| 142 | +This variant expects the header `application/cloudevents+json` in order to be parsed as a JSON cloud event or the different headers that are defined in the [specification](https://github.com/cloudevents/spec/blob/master/spec.md) adapting them to the Kubeless function format. |
| 143 | + |
| 144 | +The same example Node.js function from above can then be deployed: |
| 145 | + |
| 146 | +```console |
| 147 | +$ kubeless function deploy myFunction --runtime nodejsCE8 \ |
| 148 | + --dependencies package.json \ |
| 149 | + --handler test.foobar \ |
| 150 | + --from-file test.js |
| 151 | +``` |
| 152 | + |
142 | 153 | ### Python
|
143 | 154 |
|
144 | 155 | #### Example
|
@@ -196,7 +207,7 @@ Go functions require to import the package `github.com/kubeless/kubeless/pkg/fun
|
196 | 207 |
|
197 | 208 | #### Server implementation
|
198 | 209 |
|
199 |
| -The Go HTTP server doesn't include any framework since the native packages includes enough functionality to fit our needs. Since there is not a standard package that manages server logs that functionality is implemented in the same server. It is also required to implement the `ResponseWriter` interface in order to retrieve the Status Code of the response. |
| 210 | +The Go HTTP server doesn't include any framework since the native packages includes enough functionality to fit our needs. Since there is not a standard package that manages server logs that functionality is implemented in the same server. It is also required to implement the `ResponseWriter` interface in order to retrieve the Status Code of the response. Apart from that we enable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS) to accept any request. |
200 | 211 |
|
201 | 212 | #### Debugging compilation
|
202 | 213 |
|
|
0 commit comments