Giter Club home page Giter Club logo

kubernetes-hard-way-ansible's Introduction

Kubernetes Hard Way Ansible

Ansible template to create kubernetes cluster with the following specs:

  • Kubernetes v1.22.10
  • Flannel v0.18.1
  • CNI v1.1.1
  • CRI v1.22.0
  • runc v1.1.3
  • containerd v1.6.6
  • gvisor 20220510
  • etcd v3.5.4
  • core-dns 1.9.3
  • metrics-server v0.6.1
  • metallb v0.12.1
  • Haproxy & keepalived
  • Secure communication between component

Additional Feature

  • OIDC supported
  • MetalLB supported
  • Vagrant installation supported
  • Insecure Registry supported
  • Renewing certificate playbook
  • Adding worker node playbook
  • Upgrade Kubernetes playbook

Tested Environment

  • Ubuntu 18.04
    • 3 master nodes, 3 worker nodes
    • 3 etcd nodes, 3 master nodes, 3 worker nodes

Step Installation

Execution happen on the deployer node. All the ceritificate generated and store in the deployer node. The deployer node cannot be deleted if you want to renew certificate or extending kubernetes worker node. All this step executed in the deployer node.

  • Prepare ansible
sudo apt-add-repository ppa:ansible/ansible -y
sudo apt update
sudo apt install ansible -y
  • Make sure have access into all nodes

please make sure that have privilege access, you can add the user in sudoers files, after bootstrap is done, fell free to remove that.

ssh-keygen

# copy to deployer itself
ssh-copy-id <user>@<deployer-node>

# copy to etcd node
ssh-copy-id <user>@<etcd-node>
ssh-copy-id <user>@<etcd-node>
ssh-copy-id <user>@<etcd-node>

# copy to master node
ssh-copy-id <user>@<master-node>
ssh-copy-id <user>@<master-node>
ssh-copy-id <user>@<master-node>

# copy to master node
ssh-copy-id <user>@<worker-node>
ssh-copy-id <user>@<worker-node>
ssh-copy-id <user>@<worker-node>
  • disable ansible hostkey checking
vi ~/.ansible.cfg

[defaults]
host_key_checking = False
  • Clone this repository
git clone https://github.com/zufardhiyaulhaq/kubernetes-hardway-ansible.git
git checkout --track origin/<TAG>
  • Adjust variable in the group_vars
vi group_vars/all.yml
  • Adjust Kubernetes host and nodes
vi hosts/hosts
  • Run ansible
ansible-playbook main.yml -i hosts/hosts

Please backup certificate directory in the deployer node!

Additional Setup

kubernetes-hard-way-ansible's People

Contributors

zufardhiyaulhaq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kubernetes-hard-way-ansible's Issues

Add logging for Kubernetes component

  • logging kube-apiserver
  • logging kube-controller-manager
  • logging kube-scheduler
  • logging etcd
  • logging kubelet
  • logging kube-proxy
  • logging containerd

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.