Convert Figma logo to code with AI

vmware-archive logokubeless

Kubernetes Native Serverless Framework

6,860
754
6,860
200

Top Related Projects

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.

24,977

OpenFaaS - Serverless Functions Made Simple

5,295

High-Performance Serverless event and data processing platform

8,411

Fast and Simple Serverless Functions for Kubernetes

5,543

Kubernetes-based, scale-to-zero, request-driven compute

Apache OpenWhisk is an open source serverless cloud platform

Quick Overview

Kubeless is a Kubernetes-native serverless framework that allows you to deploy small bits of code without worrying about the underlying infrastructure. It leverages Kubernetes resources to provide auto-scaling, API routing, monitoring, troubleshooting and more. Kubeless supports multiple runtimes and programming languages.

Pros

  • Kubernetes-native: Seamlessly integrates with existing Kubernetes deployments
  • Multi-language support: Works with Python, Node.js, Ruby, PHP, Go, .NET, Ballerina, and custom runtimes
  • Built-in auto-scaling: Automatically scales functions based on incoming requests
  • CLI tool: Provides an easy-to-use command-line interface for function management

Cons

  • Limited community support: The project is archived and no longer actively maintained
  • Complexity: Requires understanding of Kubernetes concepts, which may be challenging for beginners
  • Performance overhead: Running functions in containers may introduce some latency compared to other serverless platforms
  • Limited ecosystem: Fewer integrations and extensions compared to more popular serverless frameworks

Code Examples

  1. Creating a simple Python function:
def hello(event, context):
    print("Hello world!")
    return event['data']
  1. Deploying a function using the Kubeless CLI:
kubeless function deploy hello --runtime python3.7 \
                               --from-file test.py \
                               --handler test.hello
  1. Invoking a deployed function:
kubeless function call hello --data '{"msg":"Hello World!"}'

Getting Started

  1. Install Kubeless on your Kubernetes cluster:
kubectl create ns kubeless
kubectl create -f https://github.com/kubeless/kubeless/releases/download/v1.0.8/kubeless-v1.0.8.yaml
  1. Install the Kubeless CLI:
wget https://github.com/kubeless/kubeless/releases/download/v1.0.8/kubeless_linux-amd64.zip
unzip kubeless_linux-amd64.zip
sudo mv bundles/kubeless_linux-amd64/kubeless /usr/local/bin/
  1. Create and deploy a simple function:
echo 'def hello(event, context):
    return "Hello World!"' > hello.py

kubeless function deploy hello --runtime python3.7 \
                               --from-file hello.py \
                               --handler hello.hello
  1. Test the function:
kubeless function call hello

Competitor Comparisons

⚡ Serverless Framework – Effortlessly build apps that auto-scale, incur zero costs when idle, and require minimal maintenance using AWS Lambda and other managed cloud services.

Pros of Serverless

  • More active development and larger community support
  • Supports multiple cloud providers (AWS, Azure, GCP, etc.)
  • Extensive plugin ecosystem for enhanced functionality

Cons of Serverless

  • Steeper learning curve due to more complex architecture
  • Potential vendor lock-in with cloud-specific configurations
  • Higher resource consumption for larger applications

Code Comparison

Kubeless function deployment:

apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
  name: hello
spec:
  handler: handler.hello
  runtime: python2.7

Serverless function deployment:

service: hello-world
provider:
  name: aws
  runtime: nodejs14.x
functions:
  hello:
    handler: handler.hello

Summary

Serverless offers a more versatile and widely-supported framework for serverless applications across multiple cloud providers. It boasts a larger ecosystem and more frequent updates. However, this comes at the cost of increased complexity and potential vendor lock-in.

Kubeless, being Kubernetes-native, provides a simpler approach for those already familiar with Kubernetes ecosystems. It offers easier integration with existing Kubernetes deployments but lacks the multi-cloud support and extensive plugin system of Serverless.

The choice between the two depends on specific project requirements, existing infrastructure, and desired cloud provider flexibility.

24,977

OpenFaaS - Serverless Functions Made Simple

Pros of OpenFaaS

  • More active development and larger community support
  • Supports multiple container orchestration platforms (Kubernetes, Docker Swarm)
  • Offers a web UI for easier function management

Cons of OpenFaaS

  • Steeper learning curve for beginners
  • Requires more resources to run compared to Kubeless

Code Comparison

Kubeless function example:

def hello(event, context):
    print("Hello world!")
    return event['data']

OpenFaaS function example:

def handle(req):
    print("Hello world!")
    return req

Both frameworks use similar syntax for defining functions, with minor differences in parameter naming and structure. OpenFaaS uses a handle function, while Kubeless uses a custom function name with event and context parameters.

OpenFaaS provides a more flexible and feature-rich serverless platform, supporting multiple orchestrators and offering a user-friendly web interface. However, it may require more resources and have a steeper learning curve compared to Kubeless. Kubeless, being Kubernetes-native, offers a simpler setup for those already familiar with Kubernetes but has limited platform support.

5,295

High-Performance Serverless event and data processing platform

Pros of Nuclio

  • More active development and community support
  • Supports multiple triggers and runtimes
  • Built-in UI for function management and monitoring

Cons of Nuclio

  • Steeper learning curve due to more complex architecture
  • Requires more resources to run compared to Kubeless

Code Comparison

Kubeless function example:

def hello(event, context):
    return "Hello world!"

Nuclio function example:

def handler(context, event):
    return context.Response(body="Hello world!",
                            headers={},
                            content_type="text/plain",
                            status_code=200)

Key Differences

  • Kubeless is simpler and easier to get started with
  • Nuclio offers more advanced features and scalability options
  • Kubeless is more tightly integrated with Kubernetes
  • Nuclio provides better support for real-time data processing

Community and Support

  • Kubeless: Archived project with limited ongoing support
  • Nuclio: Active development and growing community

Use Cases

  • Kubeless: Simple serverless functions on Kubernetes
  • Nuclio: Complex event-driven applications and data processing

Performance

  • Kubeless: Lightweight and efficient for basic functions
  • Nuclio: Optimized for high-performance and low-latency scenarios
8,411

Fast and Simple Serverless Functions for Kubernetes

Pros of Fission

  • Active development and maintenance, with regular updates and releases
  • Supports multiple languages and runtimes out of the box
  • Offers built-in autoscaling and cold-start optimization

Cons of Fission

  • Steeper learning curve for beginners
  • Requires more setup and configuration compared to Kubeless
  • Limited community support and ecosystem compared to more established serverless platforms

Code Comparison

Kubeless function deployment:

apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
  name: hello
spec:
  handler: handler.hello
  runtime: python2.7

Fission function deployment:

apiVersion: fission.io/v1
kind: Function
metadata:
  name: hello
spec:
  environment:
    name: python
    poolsize: 1
  package:
    functionName: hello
    sourcePath: "hello.py"

Both Kubeless and Fission aim to provide serverless capabilities on Kubernetes, but they differ in their approach and features. Kubeless is simpler to set up and use, making it ideal for quick prototyping and small-scale projects. Fission, on the other hand, offers more advanced features and flexibility, making it suitable for larger, more complex serverless applications. However, it's worth noting that Kubeless is now archived, while Fission continues to be actively developed and maintained.

5,543

Kubernetes-based, scale-to-zero, request-driven compute

Pros of Serving

  • More active development and larger community support
  • Broader scope, offering a complete serverless platform for Kubernetes
  • Better integration with other cloud-native technologies

Cons of Serving

  • Steeper learning curve due to its more complex architecture
  • Requires more resources and setup compared to Kubeless

Code Comparison

Kubeless function deployment:

apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
  name: hello
spec:
  handler: handler.hello
  runtime: python2.7

Knative Serving deployment:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: hello
spec:
  template:
    spec:
      containers:
      - image: gcr.io/knative-samples/helloworld-go
        env:
        - name: TARGET
          value: "World"

Kubeless focuses on simplicity, with a straightforward function deployment model. Serving offers more flexibility and features, but requires more configuration. Serving's approach allows for better scalability and integration with other Kubernetes resources, while Kubeless provides a more lightweight solution for simple serverless functions.

Apache OpenWhisk is an open source serverless cloud platform

Pros of OpenWhisk

  • More comprehensive and mature serverless platform
  • Supports multiple programming languages and runtimes
  • Offers a flexible and scalable architecture

Cons of OpenWhisk

  • Higher complexity and steeper learning curve
  • Requires more resources for deployment and management
  • Less native integration with Kubernetes

Code Comparison

OpenWhisk action example:

function main(params) {
    var name = params.name || 'World';
    return {payload: 'Hello, ' + name + '!'};
}

Kubeless function example:

def hello(event, context):
    name = event['data'].get('name', 'World')
    return f"Hello {name}!"

Both examples show simple functions that greet a user, but they use different languages and slightly different approaches to handling input parameters.

OpenWhisk uses a JavaScript function with a params object, while Kubeless uses a Python function with event and context parameters. OpenWhisk returns an object with a payload property, whereas Kubeless directly returns a string.

These differences reflect the distinct design philosophies and implementation details of each platform, with OpenWhisk offering more flexibility in terms of language support and function structure.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Kubeless logo

CircleCI Slack Not Maintained

WARNING: Kubeless is no longer actively maintained by VMware.

VMware has made the difficult decision to stop driving this project and therefore we will no longer actively respond to issues or pull requests. If you would like to take over maintaining this project independently from VMware, please let us know so we can add a link to your forked project here.

Thank You.

Overview

kubeless is a Kubernetes-native serverless framework that lets you deploy small bits of code without having to worry about the underlying infrastructure plumbing. It leverages Kubernetes resources to provide auto-scaling, API routing, monitoring, troubleshooting and more.

Kubeless stands out as we use a Custom Resource Definition to be able to create functions as custom kubernetes resources. We then run an in-cluster controller that watches these custom resources and launches runtimes on-demand. The controller dynamically injects the functions code into the runtimes and make them available over HTTP or via a PubSub mechanism.

Kubeless is purely open-source and non-affiliated to any commercial organization. Chime in at anytime, we would love the help and feedback !

Tools

Quick start

Check out the instructions for quickly set up Kubeless here.

Building

Consult the developer's guide for a complete set of instruction to build kubeless.

Compatibility Matrix with Kubernetes

Kubeless fully supports Kubernetes versions greater than 1.9 (tested until 1.15). For other versions some of the features in Kubeless may not be available. Our CI run tests against two different platforms: GKE (1.12) and Minikube (1.15). Other platforms are supported but fully compatibiliy cannot be assured.

Roadmap

We would love to get your help, feel free to lend a hand. We are currently looking to implement the following high level features:

  • Add other runtimes, currently Golang, Python, NodeJS, Ruby, PHP, .NET and Ballerina are supported. We are also providing a way to use custom runtime. Please check this doc for more details.
  • Investigate other messaging bus (e.g SQS, rabbitMQ)
  • Optimize for functions startup time
  • Add distributed tracing (maybe using istio)

Community

Issues: If you find any issues, please file it.

Slack: We're fairly active on slack and you can find us in the #kubeless channel.