Skip to content

Commit 9e0b604

Browse files
ewildealexellis
authored andcommitted
Add annotation attribute to stack schema
Signed-off-by: Edward Wilde <[email protected]>
1 parent 2155fe2 commit 9e0b604

File tree

2 files changed

+22
-7
lines changed

2 files changed

+22
-7
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.idea

docs/reference/yaml.md

+21-7
Original file line numberDiff line numberDiff line change
@@ -128,21 +128,35 @@ Or only using nodes running with Windows:
128128

129129
#### Function: Labels
130130

131-
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.
131+
Labels can be applied through a map which is passed directly to the container scheduler.
132+
Labels are also available from the OpenFaaS REST API for querying or grouping functions.
132133

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

135136
```yaml
136137
labels:
137-
topic: "kafka.payments-received"
138+
canary: true
139+
Git-Owner: alexellis
138140
```
139141

140-
You may also want to group functions by user or apply a `canary` label:
142+
> Important note: When used with a Kubernetes provider, labels support a restricted character set and length.
143+
*"Valid label values must be 63 characters or less and must be empty or begin and end with an alphanumeric character
144+
([a-z0-9A-Z]) with dashes (-), underscores (_), dots (.), and alphanumerics between."*
145+
>
146+
>See [Syntax and character set](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)
147+
for more information
148+
149+
#### Function: Annotations
150+
151+
Annotations are a collection of meta-data which is stored with the function by the provider.
152+
Annotations are also available from the OpenFaaS REST API for querying.
153+
154+
Example of setting a "topic" for the Kafka event connector:
141155

142156
```yaml
143-
labels:
144-
canary: true
145-
Git-Owner: alexellis
157+
annotations:
158+
topic: "kafka.payments-received"
159+
expire-date: "Wed Aug 8 07:40:18 BST 2018"
146160
```
147161

148162
#### Function: Memory/CPU limits

0 commit comments

Comments
 (0)