Coder Social home page Coder Social logo

sceptic30 / terraform-gke-cluster Goto Github PK

View Code? Open in Web Editor NEW
3.0 2.0 0.0 4.08 MB

Google Kubernetes Cluster auto-provisioning script supporting clustered persistent volumes using Longhorn, Haproxy ingress controller, CertManager, External-DNS, NetData auto-claiming mechanism, and Nginx.

HCL 4.36% Shell 9.57% CSS 25.76% JavaScript 4.87% PHP 1.02% HTML 54.42%
gcp gke-cluster longhorn haproxy-loadbalancer cert-manager external-dns netdata nginx kubernetes ansible

terraform-gke-cluster's Introduction

Google Kubernetes Cluster Autoprovisioning

This project autoprovisioning a full regional cluster in Google Kubernetes Engine, while using Longhorn clustering mechanism to cluster 3 Persistent Disks across 3 different zones, ensuring Fault Tolerance and High Availability.

A bash script lifting the weight of creating the appropriate commands by creating persistent disks in each zone, and automatically attaching these disks to each Kubernetes Node, while Ansible takes care of mounting the disks to a specified location at each node. After all revelant installations finish, you will be promped via command line to create a Username and a Password for securing the UI of Longhorn and Netdata, and will be submitted to Kubernetes API as secrets.

Lastly, your kubernetes nodes will be automatically claimed, and you will have immediate access to all metrics.

Programming Language Used

  1. Bash

DevOps Tooling Used

  1. Terraform (Infrastructure Provisioning Tool)
  2. Ansible (Configuration Management Tool)
  3. Jenkins (Continuous Integration - Continuous Deployment Automation Server)
  4. NetData (Health Monitoring - Observability Tool)

In-Cluster Technologies Used

There is a number of technologies used such as:

  1. CertManager
  2. External-DNS
  3. Haproxy Ingress Controller
  4. Longhorn Distrubuted Storage Platform
  5. Nginx

Usage

First, download clone the repository, and give to install.sh and initiate.sh the appropriate permissions chmod a+x and generate and public-private key pair as exactly show below:

git clone https://github.com/sceptic30/terraform-gke-cluster.git
cd terraform-gke-cluster
chmod a+x install.sh initiate.sh
mkdir -p keys
ssh-keygen -t ed25519 -f ./keys/root_id_ed25519

The private-public key pair will be used by Ansible, as it's necessary to configure the Docker Daemon systemd service. Then, edit the following variables in initiate.sh:

export BASE_DOMAIN=your_domain_name
export NETDATA_TOKEN=your_netdata_token
export NETDATA_ROOMS=your-netdata-rooms
export CLUSTER_ADMIN_EMAIL=your_google_mail_address

And run the installation script:

source initiate.sh

Demo

Watch the whole process of provisioning in the Demo Video on Youtube.

Cluster Requirements

The recommended cpu-memory requirements is 4 cores with 4Gb of RAM per node.

terraform-gke-cluster's People

Contributors

sceptic30 avatar

Stargazers

 avatar  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.