Go HTTP Function - Kubeless Typing CST Test
Loading…
Go HTTP Function — Kubeless Code
Kubeless function using Go runtime to handle HTTP requests.
# kubeless/demo/go-http.yaml
apiVersion: kubeless.io/v1beta1
kind: Function
metadata:
name: hello-go
namespace: default
spec:
runtime: go1.15
handler: handler.Hello
source: |
package handler
import (
"fmt"
"github.com/kubeless/kubeless/pkg/functions"
)
func Hello(event functions.Event, context functions.Context) string {
return fmt.Sprintf("Hello from Go!")
}
events:
hello-http:
type: http
metadata:
path: /go
method: GETKubeless Language Guide
Kubeless is a Kubernetes-native serverless framework that allows developers to deploy small, single-purpose functions without managing infrastructure. It leverages Kubernetes resources to handle scaling, routing, and monitoring.
Primary Use Cases
- ▸Event-driven microservices
- ▸Serverless REST APIs
- ▸Background tasks and cron jobs
- ▸Data processing pipelines
- ▸Integrating Kubernetes-native functions into CI/CD workflows
Notable Features
- ▸Function deployment using Kubernetes Custom Resources
- ▸Supports multiple programming runtimes
- ▸Kubernetes-native scaling and routing
- ▸Triggers from HTTP, Kafka, NATS, and Cron
- ▸CLI and YAML-based management for DevOps workflows
Origin & Creator
Kubeless was created by Bitnami in 2016 as an open-source serverless framework for Kubernetes.
Industrial Note
Kubeless is ideal for teams already using Kubernetes who want to adopt serverless patterns without introducing new infrastructure or cloud dependencies.