Learn Fission - 9 Code Examples & CST Typing Practice Test
Fission is a serverless framework for Kubernetes that allows developers to deploy functions quickly without managing infrastructure. It focuses on fast, event-driven, and scalable function execution.
Learn FISSION with Real Code Examples
Updated Nov 25, 2025
Code Sample Descriptions
Simple Fission Function (Go)
# fission/demo/function.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: hello-go
namespace: default
spec:
environment:
name: go
runtime: go
code:
inline:
function: |
package main
import (
"fmt"
"net/http"
)
func Handler(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Hello, Fission!")
}
routes:
- path: /hello
method: GET
A simple Fission YAML configuration to deploy a Go HTTP function.
Python HTTP Function
# fission/demo/python_func.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: hello-python
namespace: default
spec:
environment:
name: python
runtime: python3
code:
inline:
function: |
import json
def main(req):
return json.dumps({'message': 'Hello, Fission!'})
routes:
- path: /hello
method: GET
Deploys a Python HTTP function that returns JSON.
Node.js Function Example
# fission/demo/node_func.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: hello-node
namespace: default
spec:
environment:
name: nodejs
runtime: nodejs14
code:
inline:
function: |
module.exports = async function(context) {
return { status: 200, body: 'Hello from Node.js!' };
}
routes:
- path: /hello
method: GET
A Node.js HTTP function returning a greeting.
Go Function with Query Param
# fission/demo/go_query.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: greet-go
namespace: default
spec:
environment:
name: go
runtime: go
code:
inline:
function: |
package main
import (
"fmt"
"net/http"
)
func Handler(w http.ResponseWriter, r *http.Request) {
name := r.URL.Query().Get("name")
if name == "" { name = "Guest" }
fmt.Fprintf(w, "Hello, %s!", name)
}
routes:
- path: /greet
method: GET
A Go HTTP function that reads a query parameter and responds.
Python Function with POST Body
# fission/demo/python_post.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: echo-python
namespace: default
spec:
environment:
name: python
runtime: python3
code:
inline:
function: |
import json
def main(req):
data = json.loads(req.body)
return {'received': data}
routes:
- path: /echo
method: POST
A Python HTTP function that reads JSON from POST body.
Node.js Function with Params
# fission/demo/node_query.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: greet-node
namespace: default
spec:
environment:
name: nodejs
runtime: nodejs14
code:
inline:
function: |
module.exports = async function(context) {
const name = context.query.name || 'Guest';
return { status: 200, body: `Hello, ${name}!` };
}
routes:
- path: /greet
method: GET
Node.js HTTP function that reads query params.
Go JSON Response Function
# fission/demo/go_json.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: json-go
namespace: default
spec:
environment:
name: go
runtime: go
code:
inline:
function: |
package main
import (
"encoding/json"
"net/http"
)
type Response struct { Message string `json:"message"` }
func Handler(w http.ResponseWriter, r *http.Request) {
resp := Response{Message: "Hello JSON!"}
json.NewEncoder(w).Encode(resp)
}
routes:
- path: /json
method: GET
A Go HTTP function returning JSON.
Python Environment Variables
# fission/demo/python_env.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: env-python
namespace: default
spec:
environment:
name: python
runtime: python3
code:
inline:
function: |
import os
def main(req):
return {'env_value': os.getenv('MY_VAR', 'default')}
routes:
- path: /env
method: GET
A Python function using environment variables.
Node.js POST JSON Function
# fission/demo/node_post.yaml
apiVersion: fission.io/v1
kind: Function
metadata:
name: echo-node
namespace: default
spec:
environment:
name: nodejs
runtime: nodejs14
code:
inline:
function: |
module.exports = async function(context) {
return { status: 200, body: context.body };
}
routes:
- path: /echo
method: POST
A Node.js HTTP function that echoes JSON POST data.
Frequently Asked Questions about Fission
What is Fission?
Fission is a serverless framework for Kubernetes that allows developers to deploy functions quickly without managing infrastructure. It focuses on fast, event-driven, and scalable function execution.
What are the primary use cases for Fission?
Serverless microservices. Event-driven functions for Kubernetes apps. REST API endpoints. Cron-based background jobs. Data processing pipelines triggered by messages
What are the strengths of Fission?
Quick deployment and scaling of functions. Kubernetes-native with minimal setup. Supports multiple programming languages. Handles event-driven workloads efficiently. Integrates with existing Kubernetes services
What are the limitations of Fission?
Requires Kubernetes knowledge. Limited ecosystem compared to AWS Lambda or OpenFaaS. Not ideal for very large monolithic apps. Cold-start latency may affect short-lived functions. Monitoring and debugging require Kubernetes tooling
How can I practice Fission typing speed?
CodeSpeedTest offers 9+ real Fission code examples for typing practice. You can measure your WPM, track accuracy, and improve your coding speed with guided exercises.