Skip to content

Instantly share code, notes, and snippets.

@alexellis

alexellis/GUIDE.md

Last active Jul 2, 2020
Embed
What would you like to do?
Customise OpenFaaS helm chart for Raspberry Pi / ARM

Guide

You can use the OpenFaaS helm chart to generate custom YAML files for your OpenFaaS installation on ARMHF and ARM64.

Why? tiller is not available for ARM so we cannot customize the chart that way. So instead we ship some defaults for the community which you can then tweak as you see fit.

But what might you want to change?

  • httpProbe - this is a much faster way to check functions are healthy than the default execProbe
  • basicAuth - you may want to expose your cluster to the internet and therefore enable authentication
  • fine-tuning - you can fine-tune any of the values found in the main faas-netes chart
  • Super-charging the templates - the of-watchdog and new Golang template is probably one of the fastest so far

Get helm

curl -L https://git.io/get_helm.sh | bash

Now:

helm init --client-only
helm repo add openfaas https://openfaas.github.io/faas-netes/
helm repo update

Get faas-netes

You may need git:

sudo apt install -qy git

Clone the repo:

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

Checkout the options

cat chart/openfaas/values.yaml

Decide what you like, what you want to customize and then add the values to one of the following:

./contrib/values-armhf.yaml
./contrib/values-arm64.yaml

Regenerate the YAML files

make charts

You'll see on git diff that the charts have been updated.

Test it out

Now apply the new files:

kubectl apply -f ./namespaces.yml,./yaml_armhf
# or
kubectl apply -f ./namespaces.yml,./yaml_arm64

Example - httpProbe for more efficient function health-checks

Edit ./contrib/values-armhf.yaml:

faasnetes:
  image: openfaas/faas-netes:0.8.0-armhf
  httpProbe: true              # Setting to true will use HTTP for readiness and liveness (incompatible with Istio < 1.1.5)

Now apply:

make charts
kubectl apply -f ./namespaces.yml,./yaml_armhf

Example - enable basicAuth

Edit ./contrib/values-armhf.yaml:

basic_auth: true

Create your basic-auth secret:

# generate a random password
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"

Apply:

make charts
kubectl apply -f ./namespaces.yml,./yaml_armhf

Attempt to access the gateway without auth:

curl -i 127.0.0.1:31112/system/functions

Super-charging the templates

Try these two super-fast templates:

First run faas-cli template pull https://

Then faas-cli new --list

Use the templates ending in -armhf

@rootsongjc

This comment has been minimized.

Copy link

@rootsongjc rootsongjc commented Jun 27, 2020

This guide is using helm v2, why not helm 3?

@alexellis

This comment has been minimized.

Copy link
Owner Author

@alexellis alexellis commented Jun 27, 2020

Because is a very old and random gist not meant for you or anyone else to be considering for use. Use the OpenFaaS docs or workshop.

https://docs.openfaas.com

@alexellis

This comment has been minimized.

Copy link
Owner Author

@alexellis alexellis commented Jun 27, 2020

@alexellis

This comment has been minimized.

Copy link
Owner Author

@alexellis alexellis commented Jun 27, 2020

And feel free to join us on Slack (link in docs)

@rootsongjc

This comment has been minimized.

Copy link

@rootsongjc rootsongjc commented Jul 2, 2020

Yes, I have filled the form and request to join openfaas slack yesterday. Waiting for confirm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment