Git Product home page Git Product logo

terra-kubeadm-on-os's Introduction

Terraform Your Kubernetes Cluster on OpenStack with Kubeadm

This repo provides the bootstrap scripts to create a Kubernetes development cluster on an OpenStack cloud with the kubeadm tool.

It has been written to minimize dependencies -- you will only needs to install terraform, this repo and kubectl on your laptop to get a fully functional cluster running.

What Does This Do ?

At the conclusion of the scripts, you will have one Kubernetes master node and x Kubernetes worker nodes. In your OpenStack Horizon dashboard you will see this (where x == 2 worker nodes):

Finished Kubernetes Cluster

As you can see, Terraform has created the following in your OpenStack cloud:

  • One VM instance for the Kubernetes Master node
  • One floating / public IP address for the Kubernetes Master node
  • Two (configurable number) VM instances for the Kubernetes Workers nodes
  • Tenant/project network and subnet
  • Tenant/project router that connects to provide network/internet

It has also configured the following on that OpenStack infrastructure:

  • Installed Kubernetes master node on kube-master via kubeadm init
  • Installs and registers a variable number of worker nodes with Kubernetes software with kubeadm join
  • Configures new Kubernetes cluster with Weave networking
  • Writes and retrieves kubectl configuration file
  • Installs KubeDNS, Kubernetes Dashboard and WeaveScope add-ons LINKS
  • Sets up easy aliases for usage of new cluster

Logically, your new Kubernetes cluster now looks like this (using the installed WeaveScope tool):

weavescope nodes

What Does This NOT Do ?

  • High availability control plane
  • High availability etcd cluster
  • Host on any other cloud than OpenStack
  • Host on any other operating system than Ubuntu 16.04 LTS
  • (YET) Setup OpenStack cloud provider specific options (persistent storage, load balancer)

Cluster Creation

Choose your own adventure below, depending on your level of impulse control.

For The impatient

$ brew install kubectl terraform jq
$ curl -o tf.zip https://github.com/slashk/terra-kubeadm-on-os/archive/master.zip
$ unzip tf.zip
$ cd terra-kubeadm-on-os-master
$ cp sample.tfvars terraform.tfvars
$ vi terraform.tfvars
$ terraform plan
$ terraform apply
$ ./post-install.sh
$ source ./commands.alias

These lines:

  • Sets your default variables (using the sample.tfvars file that you edited)
  • installs terraform to create your infrastructure and kubectl to control your cluster
  • downloads and unzips this repo for the terraform scripts
  • runs terraform plan (preflight) then terraform apply to create the OpenStack infrastructure for the cluster (this will take a while -- five minutes on my cloud)
  • executes a small bash script to setup your local laptop and twiddles some server settings to communicate with the new cluster
  • sources some convienence commands to make it easy to REWORK

For The More Thoughtful

See this blog post

FAQ

What if I want my Kubernetes cluster on another cloud ?

Use another tool:

What if I want a Kubernetes cluster on my laptop ?

Minikube is your boy. I use it with the xhyve driver on my Mac.

terra-kubeadm-on-os's People

Contributors

slashk avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.