Skip to content

Ansible playbook for provisioning a Raspberry Pi Kubernetes cluster

License

Notifications You must be signed in to change notification settings

jnschaeffer/k8s-ansible-rpi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

k8s-ansible-rpi - Ansible playbook for Raspberry Pi Kubernetes clusters

Example Raspberry Pi cluster

k8s-ansible-rpi is an Ansible playbook designed to (mostly) provision Raspberry Pi Kubernetes clusters.

This is a personal project, made open source in hopes that it might be useful to some.

Motivation

While Kubernetes distributions such as k3s and microk8s exist that target the Raspberry Pi as a deployment environment, at the time this project was conceived (late 2020) they all lacked IPv6 support. k8s-ansible-rpi attempts to rectify that by provisioning a full-fledged Kubernetes cluster on Raspberry Pi nodes.

Overview

k8s-ansible-rpi can be run using a command like the following:

ansible-playbook site.yml -i inventory/my-cluster/hosts.ini

Following a run of the playbook, k8s-ansible-rpi creates a cluster that includes:

Clusters are provisioned using kubeadm.

The following features are currently not included in k8s-ansible-rpi:

  • Worker node joining to clusters (you have to do this yourself)
  • CNI configuration
  • Node deprovisioning

Configuration

k8s-ansible-rpi, like other Ansible playbooks, can be configured using a given host inventory. An example inventory is available in the examples directory.

Hosts are arranged into the following groups:

Name Description
k8s_cluster Used for all nodes in the cluster
master Used for control plane nodes in the cluster

The following variables are used to configure cluster provisioning:

Name Description
pod_subnet The Pod subnets to use
service_subnet The Service subnets to use
node_cidr_mask_size_v4 IPv4 Node CIDR mask size, passed to kube-controller-manager
node_cidr_mask_size_v6 IPv6 Node CIDR mask size, passed to kube-controller-manager
dns_server The DNS server to point machines at. Maybe it's a Pi-hole

About

Ansible playbook for provisioning a Raspberry Pi Kubernetes cluster

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages