@@ -368,7 +372,8 @@ Explanation of the fields used above:
...
@@ -368,7 +372,8 @@ Explanation of the fields used above:
| Parameter | Description |
| Parameter | Description |
|-----------|-------------|
|-----------|-------------|
| `name` | Indicates which provider is used to execute the `serverless.yml` file. In this case, the TriggerMesh middleware. |
| `name` | Indicates which provider is used to execute the `serverless.yml` file. In this case, the TriggerMesh middleware. |
| `environment` | Includes the environment variables to be passed as part of function execution for **all** functions in the file, where `FOO` is the variable name and `BAR` are he variable contents. You may replace this with you own variables. |
| `envs` | Includes the environment variables to be passed as part of function execution for **all** functions in the file, where `FOO` is the variable name and `BAR` are he variable contents. You may replace this with you own variables. |
| `secrets` | Includes the contents of the Kubernetes secret as environment variables accessible to be passed as part of function execution for **all** functions in the file. The secrets are expected in ini format. |
### `functions`
### `functions`
...
@@ -381,7 +386,10 @@ subsequent lines contain the function attributes.
...
@@ -381,7 +386,10 @@ subsequent lines contain the function attributes.
| `source` | Directory with sources of a functions. |
| `source` | Directory with sources of a functions. |
| `runtime` (optional)| The runtime to be used to execute the function. This can be a runtime alias (see [Runtime aliases](#runtime-aliases)), or it can be a full URL to a custom runtime repository. When the runtime is not specified, we assume that `Dockerfile` is present in the function directory specified by `source`. |
| `runtime` (optional)| The runtime to be used to execute the function. This can be a runtime alias (see [Runtime aliases](#runtime-aliases)), or it can be a full URL to a custom runtime repository. When the runtime is not specified, we assume that `Dockerfile` is present in the function directory specified by `source`. |
| `description` | A short description of the function. |
| `description` | A short description of the function. |
| `environment` | Sets an environment variable for the specific function only. |
| `envs` | Sets an environment variable for the specific function only. |
| `secrets` | Includes the contents of the Kubernetes secret as environment variables accessible to be passed as part of function execution for the specific function only. The secrets are expected in ini format. |
### Deployment
#### Runtime aliases
#### Runtime aliases
...
@@ -435,6 +443,33 @@ The sample function can now be triggered from any HTTP client using a simple `PO
...
@@ -435,6 +443,33 @@ The sample function can now be triggered from any HTTP client using a simple `PO
![function execution](img/function-execution.png)
![function execution](img/function-execution.png)
### Secrets
To access your Kubernetes secrets from within your function, the secrets should be created under the namespace of your serverless deployment.