-
Creating the function
(so far python3 and golang functions are supported, feel free to contribute)
go run main.go create <language> <function-name>
this will create a folder with the function name in the current directory,
edit the code in the function file to add your function code
-
Building the function image
go run main.go build <path-to-the-function-folder>
this will create a docker image based on your function
-
Pushing the function image
go run main.go push <path-to-the-function-folder> <repo-user/repo-name>
(setup your repository with docker first before using this command)
-
Deploying on the kubernetes cluster
go run main.go deploy <path-to-the-function-folder>
(again, setup the repository with the kubernetes first)
this will create a deployment, and a service for the function
config.yaml contains the metadata for the function
you can change the number of replicas and the auto-scaling parameters here
running the deploy commands will apply these configs
function_name: coffee
runtime: python
repository: xatriya/coffee
replicas: 3
autoscaling: true
min_replicas: 3
max_replicas: 10
cpu_percent: 50
isbuilt: true
deployment.yaml and service.yaml is generated after the pushing image
you can modify these files, although do not change the labels