From 9e0b604c1cb5ae4261cc766bb51b48c9316338a2 Mon Sep 17 00:00:00 2001 From: Edward Wilde Date: Fri, 10 Aug 2018 07:09:00 +0100 Subject: [PATCH] Add annotation attribute to stack schema Signed-off-by: Edward Wilde --- .gitignore | 1 + docs/reference/yaml.md | 28 +++++++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..723ef36f --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.idea \ No newline at end of file diff --git a/docs/reference/yaml.md b/docs/reference/yaml.md index 39a44ca6..c35d49da 100644 --- a/docs/reference/yaml.md +++ b/docs/reference/yaml.md @@ -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