Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Create a new dev environment using KinD and immediately forward the Gateway port
#!/bin/bash
DEVENV=${1:-devopenfaas}
kind create cluster --name "$DEVENV"
export KUBECONFIG="$(kind get kubeconfig-path --name="$DEVENV")"
kubectl rollout status deploy coredns --watch -n kube-system
# INSTALLING HELM
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
# SETUP REQUIRED NAMESPACES
kubectl apply -f https://raw.githubusercontent.com/openfaas/faas-netes/master/namespaces.yml
# CONFIGURE BASIC AUTH
export PASSWORD="tester"
kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password="$PASSWORD"
# INSTALL OPENFAAS VIA HELM
helm repo add openfaas https://openfaas.github.io/faas-netes/
helm repo update
helm upgrade openfaas --install openfaas/openfaas \
--namespace openfaas \
--set basic_auth=true \
--set functionNamespace=openfaas-fn
kubectl rollout status deploy gateway --watch -n openfaas
## In a new terminal
kubectl -n openfaas port-forward deploy/gateway 31112:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.