Elgarni / minimal-kubernetes-cluster

Minimal Kubernetes Cluster with Minikube

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Objective

Run a full-stack web application that resides inside a kubernetes cluster.

Plan

The final result should be as follows:

gif

Thus, there will be #3 applications:

  • Frontend (HTML/Js)

  • Backend (Springboot)

  • Datastore (Redis)

The interaction between the apps should be as follows :

               |
               | 
  Browser -->  Frontend -----> Spring ------> Redis
               |
               |

The #3 apps source code can be found here applications/.

Kubernetes : Defining Cluster State

Kubernetes uses objects to manage the state of the cluster. The following object kinds will be used:

  • Ingress
  • Deployment
  • Secret
  • Service
  • Persistence Volume Claim
  • Persistent Volume

The following diagram depicts how objects are linked :

alt text

All objects definitions can be found in kubernetes/

Getting Started : Setup

Debian-based Linux :

An Ansible playbook was written to take care of cluster setup. Following commands are enough to execute all necessary steps :

$ git clone https://github.com/Elgarni/minimal-kubernetes-cluster.git
$ cd minimal-kubernetes-cluster/ansible
$ sudo chmod +x setup.sh
$ ./setup.sh

The Ansible Playbook parts can be found at ansible/

Final Note

This project's sole purpose is to showcase a running kubernetes cluster with minikube. Several parts could have been written in a better way, but it was kept simple for brevity.

About

Minimal Kubernetes Cluster with Minikube


Languages

Language:Java 61.2%Language:JavaScript 16.4%Language:HTML 12.2%Language:Dockerfile 7.9%Language:Shell 1.5%Language:CSS 0.8%