Skip to content

Instantly share code, notes, and snippets.

@zeerorg
Last active March 12, 2019 06:40
Show Gist options
  • Save zeerorg/f6ae09ee6a405247ea544476131d0a06 to your computer and use it in GitHub Desktop.
Save zeerorg/f6ae09ee6a405247ea544476131d0a06 to your computer and use it in GitHub Desktop.
# Script to deploy openfaas in local kubernetes cluster
# Step 1 install helm and tiller
curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get | bash
kubectl -n kube-system create sa tiller \
&& kubectl create clusterrolebinding tiller \
--clusterrole cluster-admin \
--serviceaccount=kube-system:tiller
helm init --skip-refresh --upgrade --service-account tiller
# create namesapce
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
# add repo
helm repo add openfaas https://openfaas.github.io/faas-netes/
# set password
PASSWORD="something"
# deploy
kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password="$PASSWORD"
helm repo update \
&& helm upgrade openfaas --install openfaas/openfaas \
--namespace openfaas \
--set basic_auth=true \
--set functionNamespace=openfaas-fn \
--wait
export OPENFAAS_URL=http://localhost:31112
echo -n $PASSWORD | faas-cli login -g $OPENFAAS_URL -u admin --password-stdin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment