Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save weivall/d1ef450dcff0a33b965c71074977f79f to your computer and use it in GitHub Desktop.
Save weivall/d1ef450dcff0a33b965c71074977f79f to your computer and use it in GitHub Desktop.
Fission with Minikube and Helm
# Install virtualbox
sudo apt install virtualbox
# Install Kubectl
curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin
# Install Minikube
curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.14.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/
# Launch Minikube
minikube start
# Veritfy minikube & kubernetes installation with following commands
kubectl get nodes
# NAME STATUS AGE
# minikube Ready 24s
kubectl config current-context
# minikube
minikube ip
# 192.168.99.100
kubectl cluster-info
# Kubernetes master is running at https://192.168.99.100:8443
# KubeDNS is running at https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/services/kube-dns
# kubernetes-dashboard is running at https://192.168.99.100:8443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboard
# Install Helm
curl -Lo /tmp/helm-linux-amd64.tar.gz https://kubernetes-helm.storage.googleapis.com/helm-v2.1.3-linux-amd64.tar.gz
tar -xvf /tmp/helm-linux-amd64.tar.gz -C /tmp/
chmod +x /tmp/linux-amd64/helm && sudo mv /tmp/linux-amd64/helm /usr/local/bin/
# Initialize helm, install Tiller(the helm server side component)
helm init
# Make sure we get the latest list of chart
helm repo update
# * Happy Helming *
# List of installed helm packages
helm ls
# Clone Fission Repo
git clone https://github.com/fission/fission.git
cd fission/charts/
# Install Fission Chart
helm install --name fission-sample --set serviceType=NodePort fission/
# Followup notes in output
curl http://fission.io/linux/fission > fission && chmod +x fission && sudo mv fission /usr/local/bin/
export FISSION_URL=http://$(minikube ip):31313
export FISSION_ROUTER=$(minikube ip):31314
echo $FISSION_URL $FISSION_ROUTER
# http://192.168.99.100:31313 192.168.99.100:31314
# Install fission CLI
curl -Lo /tmp/fission http://fission.io/linux/fission && chmod +x /tmp/fission && sudo mv /tmp/fission /usr/local/bin/
# Create nodejs env
fission env create --name nodejs --image fission/node-env
# Sample nodejs source
echo 'module.exports = function(context, callback) { callback(200, "Hello, world!\n"); }' > hello.js
# Create function
fission function create --name hello --env nodejs --code hello.js
# Create Route
fission route create --method GET --url /hello --function hello
fission env list
# NAME UID IMAGE
# nodejs 39c20a26-272a-402d-b384-53e48574c6fb fission/node-env
fission route list
# NAME METHOD URL FUNCTION_NAME FUNCTION_UID
# 47f15d32-ebce-4ab5-847d-bdee521bd597 GET /hello hello
fission function list
# NAME UID ENV
# hello e0aec068-4ff7-4e2d-8913-ed9283b6e81c nodejs
# Request
curl http://$FISSION_ROUTER/hello
# Hello, world!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment