Giter Club home page Giter Club logo

kubernetes-cluster's Introduction

  1. Introduction
  2. Getting Started
  3. Terraform Configuration
  4. Ansible Configuration

  • Automated scripts to provision a Kubernetes cluster on the Azure cloud, based on Terraform and Ansible.
  • These scripts provision a Kubernetes cluster. The Kubernetes cluster has 1 master VMs and 2 node VMs, these numbers can also be configured when launching the Terraform script.

General Requirements:

  • Docker

  • Instructions for installing Docker on Ubuntu:

https://docs.docker.com/install/linux/docker-ce/ubuntu/#set-up-the-repository

Create the service principal:

Authenticating a service principal with Azure Resource Manager.

  • Export credentials through environment variables:
$ export AZURE_CLIENT_ID         = "YOUR_AZURE_CLIENT_ID"
$ export AZURE_CLIENT_SECRET     = "YOUR_AZURE_CLIENT_SECRET"
$ export AZURE_SERVICE_PRINCIPAL = "YOUR_AZURE_SERVICE_PRINCIPAL"
$ export AZURE_SUBSCRIPTION_ID   = "YOUR_AZURE_SUBSCRIPTION_ID"
$ export AZURE_TENANT_ID         = "YOUR_AZURE_TENANT_ID"

Setup

  • Cleaning the environment:
$ make clean
  • Create the environment for execution:
$ make setup

Spin up infrastructure:

  • Initialize a working directory containing Terraform configuration files:
$ make terraform-init
  • Create an execution plan:
$ make terraform-plan
  • Building the Infrastructure:
$ make terraform-apply

Create a Kubernetes cluster Using Kubeadm

  • Create a hosts file containing inventory information such as the IP addresses from Terraform output:
$ make ansible-inventory
  • Execute the master playbook:
$ make ansible-playbook 

File Content
variables.tf Configure Azure Provider as well as declare all the variables that we will use in all our Terraform configurations.
var_values.tfvars Assign values to variables. Terraform automatically loads them to populate variables.
networks.tf Instructions for creating the entire network infrastructure of the project. In this file the main VNET is created, the routes and the subnets for the VMs.
storage.tf Storage account with a container to store VHDs of Virtual Machines.
security_group.tf This file contains inbound and outbound rules for traffic flow.
vm-.tf Terraform configuration to provision the VMs.
pip_nic.tf Public IP address to connect to the VMs from the internet.
ansible-inventory.sh Creates Ansible inventory from Terraform output.
File Content
1-dependencies.yml Installing Kubernetes' Dependencies.
2-master.yml Setting Up the Master Node.
3-workers.yml Setting Up the Worker Nodes.
hosts Host inventories.
list.yml Master playbook. The plays and tasks in each playbook listed will be run in the order they are listed.

  • Contact

kubernetes-cluster's People

Watchers

James Cloos 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.