-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support annotations in function schema #682
Comments
For Kubernetes we could use annotations instead of labels. This change only affects faas-netes and o6s. |
What about where people have used labels for node-selectors? |
The stack file has a dedicated field for node selectors, how would people use labels to target nodes in k8s? |
Hi @alexellis @stefanprodan , do you mean label like below is invalid for Kubernetes? I got it from one of the yaml files of the
If we just simply move these labels to annotations, will that cause problem for label selector? Though I don't see any label selector in all the yaml files of |
No this is about where we store the labels for OpenFaaS functions when we create/update functions. It's not about the helm chart. Look at the faas-netesd controller code where we store the labels from the request. |
@alexellis , sorry just get time to look back at this thread. Do you mean the code under |
Yes search for the word label and exclude the vendor folder. You'll see it then. |
@ewilde I've updated this issue with more details. |
@alexellis thanks for updating the issue description, seems clear, will begin working on this |
Great, thank you for the update. |
@alexellis i'm guessing we are adding the annotations support so that functions themselves can access this new meta-data? If so, how does the function access the meta-data? |
@alexellis I guess what i'm asking for is how to position annotations in the documentation / code comments? Currently labels are described as:
|
The functions will not have access to the annotations, it will be used to manage and orchestrate them with things like automation, eventing and build. |
Annotation attributes are metadata for functions which may be used by the back-end for making scheduling or routing decisions. Relates to openfaas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Derek set milestone: 0.8.7 |
Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deployment, pod, service and replicaset Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deployment, pod, service and replicaset Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deployment, pod, service and replicaset Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deployment, pod, service and replicaset Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Store stack.yml annotation meta data in deploy, update and read handlers Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Relates to openfaas/faas#682 Signed-off-by: Edward Wilde <ewilde@gmail.com>
Derek close: released |
Description
We should consider adding annotations to the schema or using them to store labels with Kubernetes
Example
"label": {"value-with-json-meta": "data"}
Swarm: valid
Kubernetes: invalid
"Git-Deploy": "03/03/2018 10:10:00"
Swarm: valid
Kubernetes: invalid
"valid-for-both": "anything-that-123-looks-like-a.domain"
Swarm: valid
Kubernetes: valid
Problem/Issue
Kubernetes uses annotations to configure metadata for objects like Pods. With Docker Swarm we use labels which support almost any string - but the label schema for Kubernetes is very restrictive only allowing a value which is a valid DNS entry.
OpenFaaS Cloud and the event connectors make use of metadata for filtering so for a rich experience with Kubernetes we need to think about how to start accommodating this metadata.
For Swarm labels work well - for Kubernetes we may need to make use of annotations in addition to labels.
Proposal
Add new field to function schema named "annotations"
Format: map[string]string (same as label)
Kubernetes: implemented as annotations in deployment and CRD
Swarm: implemented as label with special name
This is a vertical slice going all the way from the CLI through to the gateway to the providers and into the container orchestration system. The work will require (copy/paste/rename) of where labels are mentioned, but the work will have to be tested (manual end-to-end testing) and well co-ordinated with project lead.
Acceptance
Previously the above would not be supported in Kubernetes - storing complex metadata in the function, but this would have been supported in Swarm.
Labels vs Annotations in K8s:
Labels: allows for only a-z, (-) and (.) character
Annotations: any value.
The text was updated successfully, but these errors were encountered: