Skip to content
serverless deployment in kubernetes
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
java
nodejs
python
.gitignore
README.md
package.json
yarn.lock

README.md

kubernetes serverless sample

serverless sample in kubernetes , here will use kubeless and its serverless plugin

  • the serverless plugin for kubeless now only support the following runtimes Node.js,Python,Ruby

Supported Runtimes
ballerina0.981.0, dotnetcore2.0, dotnetcore2.1, go1.10, java1.8, nodejs6, nodejs8, php7.2, python2.7, python3.4, python3.6, python3.7, ruby2.3, ruby2.4, ruby2.5, jvm1.8, nodejs_distroless8, nodejsCE8, vertx1.8

Preparation

Install Kubeless

export RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4)
export OS=$(uname -s| tr '[:upper:]' '[:lower:]')

curl -OL https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless_$OS-amd64.zip && \
unzip kubeless_$OS-amd64.zip && \
sudo mv bundles/kubeless_$OS-amd64/kubeless /usr/local/bin/

Setup

kubectl create ns kubeless
kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-non-rbac-$RELEASE.yaml
kubectl get pods -n kubeless
kubectl get deployment -n kubeless
kubectl get customresourcedefinition

See More Here

Test

Java

  • cd java/ && sh deploy.sh
  • Check the deployment status executing kubeless function ls hello-java wait a few seconds for the

Nodejs

  • cd nodejs && sls deploy
  • run sls invoke --function hello-nodejs to check the response

Python

  • cd python && sls deploy
  • run sls invoke --function hello-python to check the response
You can’t perform that action at this time.