-
Notifications
You must be signed in to change notification settings - Fork 749
Allow arbitrary Kubernetes resources to be deployed with a Function #1201
Comments
Going further along this idea, would it be even more beneficial/flexible if someone could also define other resources like istio VirtualService or DestinationRule for every function? |
Use helm chart is a good way. |
Sure that is also a way of doing this. The question is which is better UX?
|
It seems the helm integration would not be too hard: https://helm.sh/docs/topics/advanced/#go-sdk |
I updated the description of this Issue to reflect the further ideas mentioned here. I will raise separate issues for Helm chart deployment of Kubeless and other related things. |
My suggestion would be to implement controllers per target feature. Let's say, if you want to be able to extend Kubeless and be able to create PodDisruptionBudgets, you just need to create a K8s controller, listen for This is the way Kubeless trigger controllers are implemented for example (with the difference that Triggers have their own CRDs). |
Sure trigger controllers are doing what you are suggesting. But HPA is implemented inside the function controller. It seems this is not so clear cut. I started using Kubernetes a year ago so maybe I have a different point of view or not really understanding the Kubernetes way or I have a very special use case, but for me a Function is a nano application where sure the developer only needs to provide the code, but the operational concerns are not going away with that. The widespread use of Helm and other tools providing a way handling resources together instead of one by one seems to back this. I think there would be multiple benefits of this proposal:
I am not insisting on Helm, that is an implementation detail for me. I proposed that because I have worked with Helm and it seems to be able to do the job. I have never worked with Kustomize, but if this is achievable with it or with some other way/tool I am all for it. |
I agree, having HPA within the function-controller is not the cleanest, mostly because it doesn't scale. It should be possible to add new entities (like
I think I am not following what you are proposing. Maybe you can put an example? Are you suggesting that the user provides a Helm chart rather than a function or that Kubeless generate a Helm chart?
Not necessarily. Depends on the implementation of the trigger, you can allow arbitrary input that can be just forwarded to the target object (e.g.
I don't understand what you mean here :) If the people need to define their own manifest with all the infra, kubeless would not be helping that much.
That's not necessary a benefit. Kubeless is meant to be Kubernetes native, so anything that goes far from that statement is not aligned with the product.
This is something that you can already get with Kubernetes resources, for example using OwnerReferences. |
Thanks for the responses, I am already learning new things here, like OwnerReferences.
HTTPTrigger and CronJobTrigger are just indirectly creating Ingress or CronJob resources. I do not see any difference between a HPA, PDB or Ingress/CronJob resource. As I see all of them are resources which are defined by the creator of the Function.
Kubeless is a FaaS solution. Its goal is to hide all the operational complexities of implementing an RPC. Hiding does not mean they are not there. Currently Kubeless has an opinion about this operational complexity in the form of the deployed resources: Service, Deployment, etc. My proposal about this opinion. I think it is fine to have a minimal and simplistic opinion to make it easy to try Kubeless out and to get the simple use cases covered.
Obviously Kubernetes is not a public FaaS, where the only concerns of developers are operational ones (security, SLA and others), but I think in the other three architectures there are still existing operational concerns, where developers might want some configuration possibilities. Currently Kubeless allow its users to provide arbitrary function code and its dependencies and the runtime where it can be executed. But there are limited possibilities to define the infrastructure how it should be operated. One can add triggers, customize the deployment and provide some scaling and that is it. I am not sure about the implementation, but this proposal is mainly about adding that capability, which allows those users to address these concern by bundling arbitrary resources to a Function. As I am using Helm for the same purpose in case of application deployments to a Kubernetes cluster and a Function really is a nano application, it seems to me that Helm charts could be an implementation candidate. I do not know much or have much experience with Kustomize, but that could be also a solution.
The user provides a Function as it is now, and provides a separate resource collection (lets call it bundle) like it provides the runtime for a function as the resource bundle the functions should be deployed with. Sidenote: the runtimes could be custom resources too instead of part of the configmap.
In case of deployments this is not necessarily forwarded, see: #1197. As Kubeless serializes that spec into an internal object, and if the API moved forward, the new features are not supported, until Kubeless updates its internals to support it.
See my explanation above about operational concerns and different FaaS architectures.
Although I do not view it as it makes Kubeless less Kuberenetes native, then more effort is needed to keep Kubeless supporting the latest Kubernetes API/resources. ps.: I renamed the issue again to reflect more the gist of what I am trying to discuss here. |
I have just found two projects which might be of interest in relation with this discussion: |
Thanks for the detailed thoughts @andrascz! Will try my best to reply them.
One of the goals of Kubeless is to abstract the unneeded complexity of Kubernetes to deploy functions and apply the serverless paradigm to this ecosystem. That's why we split between triggers and functions. Apart from that, we take an opinionated approach so for example, the user don't need to know how to define a kubernetes Having said that, I am okay giving the user the opportunity to extend to whatever is not covered by the current triggers: e.g. Istio VirtualService. I generally agree with your reasoning so the only thing I would discuss is the implementation details. I still struggle to see how the helm chart packaging would help for extending the supported resources. As far as I can tell, you are suggesting for people to provide a helm chart and Kubeless would install it but probably it's not exactly that. In any case, we are talking about two different things.
This is as extensible as people want but if you want to add a new feature (e.g. If you just want to have a generic controller and install whatever is in the function spec, you can do that as well, in this case, the YAML would look something like:
And then having the controller go over these Hope this clarifies how I see this feature working. |
Is this a BUG REPORT or FEATURE REQUEST?: feature request
What happened:
To my knowledge there is currently no way to define a PodDistruptionBudget for a Function object.What you expected to happen:
Be able to define a PodDisruptionBudget for a Function either in the Function object or in the ConfigMap.Provide a method to define auxiliary Kubernetes resources for a Function with a default or based on arbitrary number of defined base profiles which could be overridden per Function.
How to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
A potential way of doing this is deploying functions as Helm charts. This allows Kubeless to unbound itself from the Kubernetes API in relation to Function resource deployments, see #1197 for benefits of doing that.
According to the Helm docs integrating with Helm should not be a big deal.
Environment:
kubectl version
):kubeless version
):The text was updated successfully, but these errors were encountered: