TODO: add this step combine with https://github.com/openfaas/faas-netes/blob/master/HELM.md
gcloud container clusters get-credentials ${CLUSTER-NAME} --zone us-central1-a --project ${PROJECT-ID}
git clone https://github.com/openfaas/faas-netes
cd faas-netes
faas-cli new FUNCTION_NAME --lang python
faas-cli build -f ./FUNCTION_NAME.yml
setting up local docker to push to google container registry (based on this)
gcloud components install docker-credential-gcr
docker-credential-gcr configure-docker
the YAML of the function should contain
image: us.gcr.io/PROJECT-ID/faas/FUNCTION_NAME
push the function to the registry
faas-cli build -f ./FUNCTION_NAME.yml
TODO: add Kubernetes install steps OpenFaaS portal connect to the cluster and setup a proxy (Kubernetes Dashboard)
kubectrl proxy
setup the gateway in the project's YAML (building the url)
provider:
name: faas
gateway: http://localhost:8001/api/v1/proxy/namespaces/default/services/gateway:8080
deploy the function
faas-cli deploy -f ./FUNCTION_NAME.yml
choose the gateway service using
kubectl -n openfaas get pods
init the port forwarding
kubectl -n openfaas port-forward gateway-pod-name 8080:8080
simple navigate to the dash