Skip to content

Deploy a multi-master, multi-node Kubernetes cluster using Vagrant and Ansible.

License

Notifications You must be signed in to change notification settings

le-garff-yoann/vagrant-k8s

Repository files navigation

vagrant-k8s

CI

Deploy a multi-master, multi-node Kubernetes cluster preinstalled with some addons using Vagrant and Ansible. It's mostly meant for testing purposes.

Prerequisites

  • bash and Ansible (tested with version 2.9.6) installed on your host.
  • openssl if you plan to use tls-bootstraping.sh to automatically generate the cluster CA and what comes out of it.

Usage

Configuration

cp .env.example .env
ENV Mandatory? Default value Description
VAGRANT_K8S_MASTERS_COUNT None Number of masters.
VAGRANT_K8S_MASTERS_CPUS None CPUs (for each master).
VAGRANT_K8S_MASTERS_MEMORY None RAM (for each master).
VAGRANT_K8S_NODES_COUNT None Number of nodes.
VAGRANT_K8S_NODES_CPUS None CPUs (for each node).
VAGRANT_K8S_NODES_MEMORY None RAM (for each node).
VAGRANT_K8S_NODES_PORT_FORWARDING None Port forwarding rules (separated by ,) to be applied for each node (separated by :). e.g. 8080=8080:8081=8081,8082=8082:8083=8083.

The .defaults.env file and the Ansible roles used for the provisioning of the instances defines/inject configuration too.

TLS bootstraping

bash tls-bootstraping.sh

This script will not generate files if they already exist in the $VAGRANT_K8S_CERTS_HOSTDIR directory.

That also means that you could provide your own certificates and keys by simply copying them into that directory. If you want to get an idea of ​​the name they should have just run tls-bootstraping.sh and look at the names of the files in the directory.

Setup

bash vagrant.sh up

Cleanup

bash vagrant.sh destroy

About

Deploy a multi-master, multi-node Kubernetes cluster using Vagrant and Ansible.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages