Skip to content

Instantly share code, notes, and snippets.

@alexellis
Last active December 4, 2018 12:25
Show Gist options
  • Save alexellis/76709e2bc76a43a90910a9f69957ffd2 to your computer and use it in GitHub Desktop.
Save alexellis/76709e2bc76a43a90910a9f69957ffd2 to your computer and use it in GitHub Desktop.
Bootstrap OpenFaaS on ARM64
#!/bin/sh
# Bootstrap OpenFaaS on Packet.NET Type 2A/5 hardware or 64-bit Raspbian.

# Notes: before starting install kubeadm / kubectl via https://blog.alexellis.io/kubernetes-in-10-minutes/

# Alex Ellis 2017 (c) OpenFaaS

cd ; kubeadm reset && rm -rf .kube

swapoff -a

kubeadm init --apiserver-advertise-address=$PUBLIC_IP --pod-network-cidr=172.16.6.64/27 --kubernetes-version stable-1.7

rm -rf .kube
mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

kubectl taint nodes --all node-role.kubernetes.io/master-

sysctl net.bridge.bridge-nf-call-iptables=1

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

# curl -SL "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')&env.IPALLOC_RANGE=172.16.6.64/27" \
# | sed "s/amd64/arm64/"  \
# | kubectl apply -f -

mkdir -p $HOME/go/src/github.com/openfaas
cd $HOME/go/src/github.com/openfaas/
git clone https://github.com/openfaas/faas-netes

cd $HOME/go/src/github.com/openfaas/faas-netes

kubectl apply -f namespaces.yml,./yaml_arm64

kubectl get all -n kube-system
kubectl get all
@vielmetti
Copy link

some work in progress notes, in preparation for an edit to support packet.net and Kubernetes 1.9:

  • kubeadm-init should pick up stable-1.9 instead of stable-1.7
  • use $PRIVATE-IP for the admin address, and then use Doorman for a VPN into the private net
  • the pod-network-cidr and IPALLOC_RANGE will change (details tbd)
  • weave installs more easily on 1.9 without the need for the sed step

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