serverless / serverless-kubeless

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

Feature Request: Provide configuration support for ingress annotations #114

Open mcolomerc opened 6 years ago

mcolomerc commented 6 years ago

Provide configuration support for ingress rules.

provider:
  name: kubeless
  runtime: nodejs8

plugins:
  - serverless-kubeless

functions:
  capitalize:
    handler: handler.capitalize
    events:
      - http:
          path: /cap

Plugin defines nginx by default: https://github.com/serverless/serverless-kubeless/blob/master/lib/ingress.js

annotations: { 'kubernetes.io/ingress.class': 'nginx', 'nginx.ingress.kubernetes.io/rewrite-target': '/', },

Aftrer function deployment, it's possible to re-configure the ingress rule to use traefik ingress.class:

"annotations": { "kubernetes.io/ingress.class": "traefik", "traefik.frontend.rule.type": "PathPrefixStrip" }

The we can invoke the function through traefik.

$ curl -H "Content-Type: application/json" -X POST -d 'xyz' http://localhost:31907/cap

Xyz

Could be possible to add annotations to the configuration?

Thanks!

andresmgot commented 6 years ago

Yes, the idea is to rely in Kubeless to deploy the Ingress objects instead of this plugin. Right now it supports traefik as Ingress Controller but it needs some refactoring. I will keep you noticed.

SomeoneWeird commented 6 years ago

Any update on this? We're looking to do the same.