Closed Jeff-Lowrey closed 4 years ago
This does work for OpenFaaS CRD generation, perhaps it's just Knative. Are you wanting to contribute this @Jeff-Lowrey ?
/set title: Populate annotations for knative serving definitions
@Jeff-Lowrey are you absolutely sure that you have the correct location for the annotations? They can be added at multiple levels. If you are, I think this is a small patch.
@alexellis In terms of where I put the annotations, I wasn't able to get an istio sidecar to be deployed in a function pod without putting the annotation under the function definition. And I tried putting it at every other level - top level, at the same level as "functions:" and then inside the specific function def. The only one that worked was putting it where I have it.
You should be good to go then with https://github.com/openfaas/faas-cli/releases/tag/0.12.8
Just update and remember that your annotation needs to go in the YAML file if you're using one, --annotation k=v
is only for the function store (as documented via --help
)
Current Behaviour
The faas-cli generate function does not carry any annotations from the original function yaml into the knative yaml
Expected Behaviour
If the stack.yaml file contains any annotations (for example istio), they will be included in the output yaml file.
Example stack.yaml:
Calling fass-cli generate:
Should include the istio annotation in the output yaml
Context
I am deploying openfaas functions that require istio - as the examples above show. There may be other annotations for other use-cases or systems that also need to be carried over.
Related issues
641 - Add new 0.6 Knative Serving spec to generate command
640 - Add Rio to faas-cli generate
FaaS-CLI version ( Full output from:
faas-cli version
):