GithubHelp home page GithubHelp logo

ansible-for-kubernetes-glusterfs-cluster-setup's Introduction

Server Setup

These servers will contain two major components:

  • Kubernetes (k8s) cluster
  • Glusterfs (network storage) cluster

This document covers the necessary steps to install above components into any number of servers from scratch.

Pre-requisites of server

After getting the physical or virtual machines (at least two), we need to prepare the servers for installing cluster by ensuring following steps:

Root password should be set on every machine.

sudo passwd root

Ensure root ssh is allowed on every machines (if not already allowed) by appending following line into /etc/ssh/sshd_config

PermitRootLogin yes

Remember to restart the ssh service after making the above change.

sudo service ssh restart

sudo service sshd restart

Ensure password less ssh login from master to all worker nodes (both for current user and root user).

ssh-keygen (if rsa key is already not generated on master)

ssh-copy-id -i ~/.ssh/id_rsa user@host

Just for readibility purpose, you can always alter each of the node's /etc/hosts file in-order to add some reasonable naming against each local IP address.

Setting up Server

Once you established the initial communication channel among the servers by above pre-requisite steps, you are ready to setup the server. In-order to setup the server, you need to install ansible on your local machine:

sudo apt update

sudo apt install ansible

Now let's make some changes on the available ansible inventory file on inventory/*.ini with our server ip addresses.

Once we are done with modifing ansible inventory, then ensure password less ssh login from current local machine to all servers.

ssh-keygen (if rsa key is already not generated on master)

ssh-copy-id -i ~/.ssh/id_rsa emis@host

Let's run the following command to install all necessary component on the provided servers now:

ansible-playbook playbook.yaml -i inventory/qa.ini --user=emis --extra-vars "ansible_become_pass=yourPassword glusterfs_nodes='glusternode_ip_1 glusternode_ip_2' lb_ip_range_from=<start-of-private-ip-range> lb_ip_range_to=<end-of-private-ip-range>"

Great! Above step should install all necessary components into your server machines and bring up live kubernates and glusterfs cluster infrastructure.

Execute following steps on master node to make the gluster fs cluster ready for you application stack.

Initiate the cluster by running following command on master node:

heketi-cli cluster create

Add worker nodes into the glusterfs cluster:

heketi-cli node add --zone=1 --cluster=<cluster-id> --management-host-name=<node-dns-name> --storage-host-name=<node-local-ip>

Example:

heketi-cli node add --zone=1 --cluster=8868d0e6a35c328f5af396e449b06534 --management-host-name=emis-2 --storage-host-name=10.0.0.42

Follow the above step for each of the glusterfs worker nodes. Once done adding all nodes, check the cluster status by:

heketi-cli cluster info <cluster-id>

Finally, add additional storage device for each of the glusterfs nodes:

heketi-cli device add --name=/dev/sdb --node=<node-id>

Run lsblk on each of the node to get available list of devices on each node.

ansible-for-kubernetes-glusterfs-cluster-setup's People

Contributors

mushrafulhoque-dsi avatar

Watchers

James Cloos avatar  avatar  avatar Mojahedul Hoque Abul Hasanat 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.