Git Product home page Git Product logo

vagrant-kubernetes's Introduction

Vagrant Kubernetes Cluster

Kubernetes cluster deployment with a single control plane node and an arbitrary number of nodes, using Vagrant (VirtualBox provider, Ansible provisioner).

What's in the Box

The default configuration will build a 4 node cluster --- a master and 3 workers:

$ kubectl get nodes
NAME     STATUS   ROLES    AGE    VERSION
master   Ready    master   176m   v1.17.0
node01   Ready    <none>   115m   v1.17.0
node02   Ready    <none>   79m    v1.17.0
node03   Ready    <none>   74m    v1.17.0

Prerequisites

You will need the following installed:

Getting Started

  1. Download the zip file or git clone this repository:
git clone https://github.com/craigforr/vagrant-kubernetes.git
  1. Change into the project directory and run Vagrant:
cd vagrant-kubernetes
vagrant up
  1. Once the cluster is built, you can either run kubectl against the master from your local system or SSH into the master, as follows:
vagrant ssh
  1. When you're done using the cluster, you can either stop the nodes or destroy the cluster:
  • Power down all the nodes:
$ vagrant halt
==> node03: Attempting graceful shutdown of VM...
==> node02: Attempting graceful shutdown of VM...
==> node01: Attempting graceful shutdown of VM...
==> master: Attempting graceful shutdown of VM...
  • Delete all the nodes:
$ vagrant destroy
# vagrant destroy --force
==> node03: Destroying VM and associated drives...
==> node02: Destroying VM and associated drives...
==> node01: Destroying VM and associated drives...
==> master: Destroying VM and associated drives...
==> master: Running action triggers after destroy ...
==> master: Running trigger: Remove join_command.sh...
    master: Running local: Inline script
    master: rm -v playbooks/join_command.sh
    master: VERBOSE: Performing the operation "Remove File" on target
    master: "/home/user/vagrant-kubernetes/playbooks/join_command.sh".

To see the status of the cluster nodes at any time, use vagrant status:

$ vagrant status
Current machine states:

master                    poweroff (virtualbox)
node01                    poweroff (virtualbox)
node02                    poweroff (virtualbox)
node03                    poweroff (virtualbox)

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.