Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Get k3s with OpenFaaS using k3sup and multipass

Get k3s with OpenFaaS using k3sup and multipass

multipass from Canoncial is like Docker Desktop, but for Ubuntu and works on MacOS, Linux and Windows.


We can get a Kubernetes cluster with k3s in a very short period of time. We can use this for workshops and building labs, and for R&D, including testing.

  - ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC8Q/aUYUr3P1XKVucnO9mlWxOjJm+K01lHJR90MkHC9zbfTqlp8P7C3J26zKAuzHXOeF+VFxETRr6YedQKW9zp5oP7sN+F2gr/pO7GV3VmOqHMV7uKfyUQfq7H1aVzLfCcI7FwN2Zekv3yB7kj35pbsMa1Za58aF6oHRctZU6UWgXXbRxP+B04DoVU7jTstQ4GMoOCaqYhgPHyjEAS3DW0kkPW6HzsvJHkxvVcVlZ/wNJa1Ie/yGpzOzWIN0Ol0t2QT/RSWOhfzO1A2P0XbPuZ04NmriBonO9zR7T1fMNmmtTuK7WazKjQT3inmYRAqU6pe8wfX8WIWNV7OowUjUsv alex@alexr.local

- curl -SLsf | sh
- mkdir -p /home/ubuntu/.kube/
- k3sup install --local --local-path /home/ubuntu/.kube/config
- curl -sLfS | sh
- HOME=/home/ubuntu k3sup app install openfaas | tee /home/ubuntu/post-install.txt
- echo "export KUBECONFIG=/home/ubuntu/.kube/config" | tee -a /home/ubuntu/.bashrc
- chown ubuntu:ubuntu -R /home/ubuntu/
  • Edit the ssh_authorized_keys and replace with your own $HOME/.ssh/ value

  • multipass launch ubuntu --name k3s-1 --cloud-init=./cloud-init.yaml

  • Run multipass info k3s-1 and get the IP and set export IP="" with the value

  • Next run:

k3sup install --user ubuntu --ip $IP --skip-install

This step will download the KUBECONFIG file from the VM, that you can use to access OpenFaaS and your k3s cluster!

  • Grab the OpenFaaS post-install instructions: ssh ubuntu@$IP cat

You're now good to go.


This comment has been minimized.

Copy link

Tanoh-Hermann commented Jan 19, 2020

Thanks! (--no-install flag now = --skip-install)


This comment has been minimized.

Copy link
Owner Author

alexellis commented Jan 19, 2020

Good catch 👍

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.