Skip to content

Commit

Permalink
Add annotation attribute to stack schema
Browse files Browse the repository at this point in the history
Signed-off-by: Edward Wilde <[email protected]>
  • Loading branch information
ewilde authored and alexellis committed Aug 10, 2018
1 parent 2155fe2 commit 9e0b604
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea
28 changes: 21 additions & 7 deletions docs/reference/yaml.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,21 +128,35 @@ Or only using nodes running with Windows:

#### Function: Labels

Labels can be applied through a map which are passed directly to the container scheduler. Labels are also available from the OpenFaaS REST API for querying or grouping functions.
Labels can be applied through a map which is passed directly to the container scheduler.
Labels are also available from the OpenFaaS REST API for querying or grouping functions.

Example of setting a "topic" for the Kafka event connector:
Example of using a label to group by user or apply a `canary` label:

```yaml
labels:
topic: "kafka.payments-received"
canary: true
Git-Owner: alexellis
```

You may also want to group functions by user or apply a `canary` label:
> Important note: When used with a Kubernetes provider, labels support a restricted character set and length.
*"Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character
([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between."*
>
>See [Syntax and character set](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)
for more information

#### Function: Annotations

Annotations are a collection of meta-data which is stored with the function by the provider.
Annotations are also available from the OpenFaaS REST API for querying.

Example of setting a "topic" for the Kafka event connector:

```yaml
labels:
canary: true
Git-Owner: alexellis
annotations:
topic: "kafka.payments-received"
expire-date: "Wed Aug 8 07:40:18 BST 2018"
```

#### Function: Memory/CPU limits
Expand Down

0 comments on commit 9e0b604

Please sign in to comment.