serverless / serverless-kubeless

This plugin enables support for Kubeless within the Serverless Framework.
Apache License 2.0
303 stars 80 forks source link

Ingress is corrupted when deploying a single function #173

Open fabiob opened 5 years ago

fabiob commented 5 years ago

When I perform a full deploy (using serverless deploy) of a stack containing multiple functions with http triggers, a single ingress is created, point to each one of them. That's really nice.

However, when I try to deploy a single function (using serverless deploy -f myFunc), the ingress is recreated and it starts pointing to that single function. All the other functions become inaccessible.

andresmgot commented 5 years ago

Hi @fabiob, I can confirm that's an issue. The way it currently works is that we treat serverless deploy -f <func> as the whole deployment but with a single function. That has the side effect you mention.

See the code here:

https://github.com/serverless/serverless-kubeless/blob/master/deployFunction/kubelessDeployFunction.js#L40

The source of the issue here is that this plugin shouldn't create the Ingress objects itself, it should rely on the Kubeless backend to create them. What this plugin should create are "HTTP Trigger" objects the same way it creates Kafka or NATS triggers. The problem with that is that we would lose the aggregation of HTTP Triggers in a single Ingress object since that is not supported in Kubeless yet.

I don't have the resources to work on this right now so if anyone wants to give it a try I'll me happy to help.