Skip to content

stccenter/SDAP-K8Cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

Setting up the SDAP Kubernetes Cluster

To begin you must be in a base station.

  1. Clone the Kubespray from github, clone the version 2.15. The command is:
git clone --depth=1 –branch release hhtp://github.com/Kubernetes-sigs/kubespray.git
  1. Then navigate into the cloned folder kubespray
cd kubespray
  1. Inside that folder you have requirements.txt file. It has list of required packages. To install the packages, run the requirements.txt using pip3:
sudo pip3  install -r requirement.txt

Note: If you don’t have pip3, install using below command:

sudo yum install python3-pip
  1. Go inside the inventory folder. It has two sub-folders local and sample
cd inventory
  1. Make a copy of the sample folder using the following command and name the new folder as sdapcluster
cp -prf sample/ sdapcluster

Ensure the process worked by using ls -ltr the new folder should appear, then go into the new folder

cd sdapcluster/
  1. Create a hosts.yml using the command
vi hosts.yml

Copy and paste the following content in the hosts.yml file. Here node 1 represents master and node 2 and 3 represent working nodes. Make sure to change the according to your server IP address.

all:
  hosts:
    node1:
      ansible_host: <ip address>
      ip: <ip address>
      access_ip: <ip address>
    node2:
      ansible_host: <ip address>
      ip: <ip address>
      access_ip: <ip address>
    node3:
      ansible_host: <ip address>
      ip: <ip address>
      access_ip: <ip address>
  children:
    kube-master:
      hosts:
        node1:
    kube-node:
      hosts:
        node2:
        node3:
    etcd:
      hosts:
        node1:
    k8s-cluster:
      children:
        kube-master:
        kube-node:
    calico-rr:
      hosts: {}
  1. Now check you can connect base station to the kubernetes cluster master node using
 <ssh `your specified ip address`>

Note: If there are any authentication issues copy the base station ssh key and paste it in the master node’s authorized keys file.

  1. Look for addons.yml file it inside inventory/sdapcluster/group_vars/k8s-cluster/
vi addons.yml

Make sure two variables helm_enable and ingress_nginx_enable set as true and then save file.

  1. Run the accessible playbook to run the kubernetes cluster. Make sure you are inside kubespray folder to run the below command:
ansible-playbook -i inventory/sdapcluster/host.yml cluster.yml –become –become-user=root
  1. Once process finish ssh into kubernetes master node, and check status of the nodes Login as a root user
sude su -l

Use the below comment to check the status:

kubectl get nodes

Tutorial video

Contributors

Anusha and Shyra

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published