Fission: A Deep Dive Into Serverless Kubernetes Frameworks (2)

Background

Introduction to Fission

Core Concepts

Key Components

Mechanism Explanation

Function Executor

PoolManager

fission environment create --name python --image fission/python-env
fission function create --name hello --env python --code hello.py --executortype poolmgr

NewDeploy

fission fn create --name hello --env python --code hello.py --executortype newdeploy --minscale 1 --maxscale 3 --targetcpu 50
i. When minscale is greater than 0, NewDeploy immediately creates the service, deployment, and HPA for this function. Pods are managed by deployment, and every pod that runs this function will be specialized.
ii. When minscale is less than 0, the resources will not be created until the function is actually triggered.

Comparison between PoolManager and NewDeploy

Summary

Pod Specialization

Trigger

HTTP Trigger

fission httptrigger create --url /echo --method GET --function hello --createingress --host example.com
apiVersion: extensions/v1beta1
kind: Ingress
metadata:
# The name of the ingress project
name: xxx
...
spec:
rules:
- host: example.com
http:
paths:
- backend:
# Point to the router service
serviceName: router
servicePort: 80
# Access path
path: /echo

Time Trigger

fission tt create --name halfhourly --function hello --cron "*/30 * * * *"
trigger 'halfhourly' created

Message Queue Trigger

fission mqt create --name hellomsg --function hello --mqtype kafka --topic input --resptopic output --errortopic error

Summary

Auto-Scaling

fission fn create --name hello --env python --code hello.py --executortype newdeploy --minmemory 64 --maxmemory 128 --minscale 1 --maxscale 6 --targetcpu 50
apiVersion: autoscaling/v1
kind: HorizontalPodAutoscaler
metadata:
labels:
executorInstanceId: xxx
executorType: newdeploy
functionName: hello
...
# The name of the HPA
name: hello-${executorInstanceId}
# The namespace where the HPA is located
namespace: fission-function
...
spec:
# The maximum number of replicas allowed
maxReplicas: 6
# The minimum number of replicas allowed
minReplicas: 1
# The target that is associated with this HPA
scaleTargetRef:
apiVersion: extensions/v1beta1
kind: Deployment
name: hello-${executorInstanceId}
# The CPU usage of the target
targetCPUUtilizationPercentage: 50

Summary

Log Processing

Summary

Summary: Kubeless vs. Fission

Reference

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store