Guangning Yu's Blog
Home
Code
Data
Setup
Industry
MachineLearning
Archive
Kubeless Basics
2019-05-14 10:09:51
|
Kubernetes
# Deploy kubeless to a Kubernetes cluster ``` $ export RELEASE=$(curl -s https://api.github.com/repos/kubeless/kubeless/releases/latest | grep tag_name | cut -d '"' -f 4) $ kubectl create ns kubeless $ kubectl create -f https://github.com/kubeless/kubeless/releases/download/$RELEASE/kubeless-$RELEASE.yaml ``` ``` $ kubectl get pods -n kubeless $ kubectl get deployment -n kubeless $ kubectl get customresourcedefinition ``` # Deploy sample function ``` def hello(event, context): print event return event['data'] ``` ``` $ kubeless function deploy hello --runtime python2.7 \ --from-file test.py \ --handler test.hello ``` ``` $ kubectl get functions $ kubeless function ls ``` ``` $ kubeless function call hello --data 'Hello world!' ```
Previous:
Setup Nextcloud on Ubuntu
Next:
Windows cmd