All the commands in this file assume you've set up the Python virtual environment for this project as per the README.
These instructions desribe:
If you already have a cluster set up with kubectl
working, you can just
follow the Faasm k8s
docs.
Install kubectl
with:
inv k8s.install-kubectl --system
Note that this will place the binary in /usr/local/bin
, to be available
globally. If you just want to use the installs with the tasks in this repo, you
can drop the system
flag.
Check kubectl
gives the right version with:
cat K8S_VERSION
which kubectl
kubectl version --client
To improve your QoL when using k8s, you can install
k9s
too:
inv k8s.install-k9s --system
which k9s
These instructions are only relevant if you're installing k8s on a cluster of custom VMs. Managed k8s services like AKS will require their own specific setup steps.
Make sure that all of your VMs have the relevant kubectl port open to your client machine. You can check what port this by running:
kubectl config view
on your client machine. It's 16443
is the default at the time of writing.
You first need to set up an Ansible inventory containing the VMs you want to set
up K8s on. See ansible/inventory/README.md
, or run the Azure-specific command
as described in the Azure docs.
Check that Ansible can ping the vms:
inv k8s.host-ping
To install Ansible on the hosts listed in the inventory file:
inv k8s.install
This will use the ansible playbooks defined in the ansible
directory to
install and set up k8s, and check out our code.
This is performing a lot of setup and takes a while depending on the VM type.
If you see any errors, you can try just rerunning. If that fails, you may find
the ansible troubleshooting
docs
useful. You can also try nuking the ~/.ansible
directory and rerunning.
Once k8s is installed, you should be able to run the following to update your
config to run kubectl
:
inv k8s.config
To check you can run:
kubectl get nodes
and should see your VMs. If it doesn't work, make sure the right ports are open on your VMs (if running on Azure, you can see the Azure docs for how to do this).
Once running, you can follow the Faasm k8s docs to set up Faasm.