WORK IN PROGRESS

February 24, 2023 ยท View on GitHub

contributions highly appreciated ;)

K0S Cilium Playground

Intro

This repository holds set of scripts that helps building and configuring a full cilium playground with :

  • cluster-mesh enabled
  • metallb as an IPAM solution

This toolkit has been tested on MACOS but should behave the exact same way on Linux hosts.

Requirements

For this project to run successfully you will need the following binaries deployment on your host:

  • multipass
  • k0sctl
  • brew
  • kubectl
  • helm

Note: on MACOS/Linux you just need brew installed, the scripts will install the rest of the needed requirements.

Variables

Several variables as been declared in the playground_vars.sh script, some of them can be overridden:

namedescriptiontypedefault valuecomment
DEBUGENABLEDEnables Debug Mode i.e: k0s controller visible and debug log enabledBooleantrueIf you don't need to see the controller(s) nor the full logs, pass the variable to 'false'
K0SCTLVERSVersion of the k0sctl binarystringv0.14.0if the binary doesn't exist AND brew installed, it will automatically deploy the latest version [UNUSED FOR NOW]
METALLBVERSVersion of metallb usedstringv0.13.7
CILIUMENABLEDEnable or not the Cilium CNI AND clustermesh configurationBooleantrueif cilium is not deployed i.e:CILIUMENABLED=false
the default CNI will be used
(as of now kube-router)
CILIUMVERSVersion of cilium usednumber1.12.4Cilium version <1.13 NEEDS metallb , the 1.13 is yet to be tested
CUSTOMCILIUMEnables usage of a custom Cilium helm charts configurationBooleanfalseif set to true
the CUSTOMCILIUMVALUESFILES should be filled with the values.yaml content to be used with cilium
CUSTOMCILIUMVALUESFILESValues to be passed to the cilium helm chartsstring[empty]values to be passed in yaml format
NUMBER_OF_VMSnumber of VMs for each clusternumber3the number of VMs counts both controllers and workers nodes
SSHPKEYPATHpath to access the ssh key filestring~/.ssh/
SSHKEYNAMEname of the ssh key filestringid_rsaif the file doesn't exist the scripts will create it and initialize it with a blank passphrase

if the keypair already exist make sure it has a BLANK passphrase or use ssh-agent and load the keypair before running the scripts
K0SADMINUSERNAMEsystem acountname to be created in each VMsstringk0s
K0SCONTROLLERCOUNTnumber of controller nodes to be configuednumber1
K0SCLUSTERNUMBERnumber of cluster to be deployed and configurednumber2
K0SCLUSTERNAMEVARname to be for each clusterstringk0scilium

deployment

if you don't feel the need to tweak the default variables, you just need to run the init_playground :

git clone https://github.com/xinity/k0s_cilium_playground
chmod u+x playground.sh
./playground.sh -i

or

./playground.sh --install

TODO

  • code refactoring
  • log management
  • FULL debug mode
  • add full https local FQDN management
  • add cilium full ingress support
  • add support for Cilium 1.13 IPAM (without metallb)