Skip to content

maxgio92/openfaas-demo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Setup

Install OpenFaaS CLI

curl -sL https://cli.openfaas.com | sh

git clone https://github.com/openfaas/faas-netes

Create the K8s namespaces

kubectl apply -f ./faas-netes/namespaces.yml

Create the password for the gateway

PASSWORD=$(head -c 12 /dev/urandom | shasum| cut -d' ' -f1)

kubectl -n openfaas create secret generic basic-auth \
--from-literal=basic-auth-user=admin \
--from-literal=basic-auth-password="${PASSWORD}"

Deploy OpenFaaS

kubectl apply -f ./faas-netes/yaml

Demo

Access to the gateway

export OPENFAAS_URL=http://$(minikube ip):31112

echo -n $PASSWORD | faas-cli login --password-stdin

Deploy a sample Python function

pushd ./functions
faas-cli new --lang python hello-python

Build the function

Important: First, start the Docker daemon, in order to build and (optionally) publish the Docker image artifact

faas-cli build -f ./hello-python.yml

(optional) Publish the function

(optional) If configured a registry repo URL (i.e. in ./functions/hello-python.yml):

faas-cli push -f ./hello-python.yml

Deploy the function

faas-cli deploy -f ./hello-python.yml

Or build, push and deploy in one single step:

faas-cli up -f ./hello-python.yml

About

OpenFaaS demo

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages