Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/runlevel5/serverless-kubeless-examples

Just an example on how to deploy functions to a K8S cluster running kubeless with Severless Framework CLI
https://github.com/runlevel5/serverless-kubeless-examples

kubeless kubernetes serverless-framework

Last synced: about 8 hours ago
JSON representation

Just an example on how to deploy functions to a K8S cluster running kubeless with Severless Framework CLI

Awesome Lists containing this project

README

        

# An example on kubeless function deployment with serverless framework CLI

## Prerequisites

* Latest LTS NodeJS
* K8S cluster running latest Kubeless
* kubectl

## How to?
```console
$ npm install
$ export KUBECONFIG=~/.kube/config
$ aws-vault exec admin@dev-cluster -- kubectl create namespace pr-app
$ aws-vault exec admin@dev-cluster -- npx serverless deploy --namespace pr-app --rootDomain example.com
$ aws-vault exec admin@dev-cluster -- npx serverless invoke --function admin-api--create-user --log --data 'hello world!' --namespace pr-app
Serverless: Calling function: admin-api--create-user...
--------------------------------------------------------------------
Hello world!

$ aws-vault exec admin@dev-cluster -- kubeless trigger http create admin-api--create-user --gateway traefik --function-name admin-api--create-user --namespace default --hostname example.com --path create-user
$ aws-vault exec admin@dev-cluster -- kubeless trigger http create admin-api--list-users --gateway traefik --function-name admin-api--list-users --namespace default --hostname example.com --path list-users

$ aws-vault exec admin@dev-cluster -- serverless remove --namespace pr-app
$ aws-vault exec admin@dev-cluster -- kubectl remove namespace pr-app
```

## TODO

* Why can't function name in camelCase format? (the [doc](https://www.serverless.com/framework/docs/providers/kubeless/guide/intro/) shows that it is possible - could it be out of date?)
* Is there any way to create trigger with serverless.yaml?