Skip to content
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

[Question] Where does OpenFaaS store the function metadata? #880

Open
ctwkongmu opened this issue Nov 26, 2021 · 4 comments
Open

[Question] Where does OpenFaaS store the function metadata? #880

ctwkongmu opened this issue Nov 26, 2021 · 4 comments

Comments

@ctwkongmu
Copy link

Not sure if this is the right place to ask this question.
I'm quite new to OpenFaaS and I could find any document about how OpenFaaS stores function metadata, like function name, image location and so on.
I'm also a little concerned about that if/how that information is persisted in OpenFaaS on kubernetes, and if I restart the cluster how should I make sure that those functions that have been deployed once will be loaded into the restarted openfaas cluster.

Thanks in advance!

@LucasRoesler
Copy link
Member

faas-netes uses a combination of annotations and labels on Services and Deployments, as well as CRDs to store th metadata. This m ans all of the metadata, such as name, is simply stored in the cluster itself and shares the same persistence as your k8s cluster.

@ctwkongmu
Copy link
Author

faas-netes uses a combination of annotations and labels on Services and Deployments, as well as CRDs to store th metadata. This m ans all of the metadata, such as name, is simply stored in the cluster itself and shares the same persistence as your k8s cluster.

@LucasRoesler
Thanks for quick response. Is there any reference or guidelines about how to make function persistent on k8s? Like which path/file should I mount to make sure that the function will still be loaded after I tear down the openfaas k8s cluster and restart it.
I did try helm delete and helm install combo and found the function I previously loaded were gone after the restart.
Is there a best practice regarding making functions persistent?

Thanks in advance!

@LucasRoesler
Copy link
Member

What exactly are you doing when you say "tear down the openfaas k8s cluster" are you deleting namespaces? Helm delete should only remove the openfaas components but leave the functions alone.

Unless you delete the function namespace, then it will delete all objects in those namespaces. This is just a feature of k8s.

Regarding function persistence, the functions are just labeled objects in the k8s cluster. So the best practice for persistence will be the same as persistence for any object in the k8s cluster and will depend specifically on how the k8s cluster is constructed

@LucasRoesler
Copy link
Member

@ctwkongmu anything else we can clarify? If not I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants