Skip to content

sdmoradi/kube-vagrant

Repository files navigation

kube-vagrant

Kubernetes Logo

In this Project We'll Deploy Kubernetes Cluster and then Monitor it using Prometheus and Grafana

Step One: Deploy Kubernetes multi master ha cluster with Vagrant and virtualbox.

Step Two: Using Ceph-Rook as Storage Class.

Step Three: At the End Deploy Mariadb HA with Galera Cluster and Monitor Deploymet by using prometheus, thanos and grafana.

All steps will be automated

Requirements

Attention : we use https://shecan.ir/ DNS in this project for lifting of sanctions

Ansible

Usage

Install Ansible according to Ansible installation guide then run the following steps:

Before Deploy

You need to install vagrant-disksize plugin for extra disk cause ceph rook need second hard disk drive in raw (without format) for install please run in host:

vagrant plugin install vagrant-disksize

You can edit Vagrant file variables in vagrant/config.rb before deploy

Quick Start

To deploy the cluster you can use :

Vagrant

Usage

# Install dependencies from ``requirements.txt``
sudo pip install -r requirements.txt
vagrant up

If a vagrant run failed and you've made some changes to fix the issue causing the fail, here is how you would re-run ansible:

ansible-playbook -vvv -i .vagrant/provisioners/ansible/inventory/vagrant_ansible_inventory --become --become-user=root cluster.yml

Access to cluster nodes and manage

vagrant ssh k8s-1
sudo cp /etc/kubernetes/admin.conf .
sudo chown vagrant:vagrant admin.conf
export KUBECONFIG=admin.conf

kubectl get nodes -o wide

Check cluster nodes state

kubectl get nodes -o wide

About the solutions use in this challenge

for deploying we use [kubespry] https://github.com/kubernetes-sigs/kubespray.git in this project we have changed features and added new features :

  • Use shecan dns by adding role in roles/ for lifting of sanctions
  • Change in Vagrantfile for nodes extra disk
  • Add rook_ceph role in cluster.yaml and create rook role in roles/kubernetes-app/ for installing rook as kubernetes storage class
  • Add galera_cluster role in cluster.yaml and create galera_cluster role in roles/kubernetes-app/ for installing galera cluster database on storage class
  • Add monitoring role in cluster.yaml and create monitoring role in roles/kubernetes-app/ for installing prometheus and grafana and monitor mysql metrics in dashboard with helm

About

Deploy Automated Kubernetes multi-master ha Cluster Using Vagrant and Virtualbox.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published