msgis / demo-terraform-ansible-kubespray

Demo of setting up a kubernetes cluster on OpenvCloud using terraform, ansible and kubespray

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Demo of Terraform, Ansible and Kubespray integration

With the code in this repository you can meneja the meneja infrastructure

This consists of

  • terraform configuration to manage the cloudspaces and create the virtual machines
  • ansible configuration to configure the virtual machines
  • kubespray configuration to deploy the kubernetes cluster

Using this repository

Import submodule:

git config --global status.submoduleSummary true
git submodule init
git submodule update

Requirements:

Before starting you must make terraform/iyo.env and add your IYO client_jwt.
This file is in the gitignore file, so it will not be commited to the repo by accident. The env file will be sourced by ./1_terraform-provision.sh.

Set up your IYO environment variables:

$ cp terraform/iyo.env.example terraform/iyo.env
$ vi terraform/iyo.env
# Replace your.iyo.jwt with the JWT received from IYO

Provision with terraform

Run ./1_terraform-provision.sh

Provision with ansible

Run ./2_ansible.sh

If you receive the following error:
The ipaddr filter requires python's netaddr be installed on the ansible controller
You may need to install the ipaddr library using your package manager:
apt-get install python-ipadddr (if ansible uses python 3.x install python3-ipaddr)

Provision with kubespray

Run ./3_kubespray.sh

Tear down everything

Run ./9_destroy.sh

About

Demo of setting up a kubernetes cluster on OpenvCloud using terraform, ansible and kubespray


Languages

Language:HCL 58.8%Language:Python 24.8%Language:Shell 16.4%