Giter Site home page Giter Site logo

ansible-k8s's Introduction

kubernetes-ansible

Ansible playbook to create a Highly Available kubernetes cluster using latest release (1.13.4) on Bare metal system (have been tested on CentOS 7, Ubuntu 18.04).

Requirements:

  • Ansible 2.7

Download the Kubernetes-Ansible playbook and set up variable according to need in group variable file all.yml. Please read this file carefully and modify according to your need.

git clone https://github.com/pawankkamboj/kubernetes-ansible.git
cd kubernetes-ansible
cp group_vars/all.yml.example group_vars/all.yml
ansible-playbook -i inventory cluster.yml

Ansible roles

  • yum-proxy - installs Squid proxy server
  • yum-repo - installs epel repo
  • sslcert - create all ssl certificates require to run secure K8S cluster
  • runtime-env - common settings for container runtime environment
  • docker - install latest docker release on all cluster nodes
  • containerd - IF you want to use containerd runtime instead of Docker, use this role and enable this in group variable file
  • etcd - setup etcd cluster, running as container on all master nodes
  • haproxy - setup haproxy for API service HA, running on all master nodes
  • keepalived - using keepalive for HA of IP address for kube-api server, running on all master nodes
  • master - setup kubernetes master controller components - kube-apiserver, kube-controller, kube-scheduler, kubectl client
  • node - setup kubernetes node agent - kubelet
  • addon - to create addon services: flanneld, kube-proxy, kube-dns, metrics-server

Note - Addon roles should be run after cluster is fully operational. Addons are in addons.yml playbook. After cluster is up and running then run addon.yml to deploy add-ons. Included addons are: flannel network, kube-proxy, kube-dns and kube-dashboard.

ansible-playbook -i inventory addon.yml

kubernetes HA architecture

Below is a sample Kubernetes cluster architecture after successfully building it using playbook. It is just a sample, so number of servers/node may vary according to your setup.

kubernetes HA architecture

ansible-k8s's People

Contributors

omidasadpour avatar

Watchers

 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.