Skip to content

Ammly/k8s-cluster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster Setup

Kubernetes cluster using Ansible and Vagrant

Requirements

You'll need the following installed on your workstation

  1. Ansible
  2. Vagrant
  3. Virtualbox
  4. Kubectl

Usage

  1. git clone https://github.com/Ammly/k8s-cluster.git
  2. cd k8s-cluster
  3. vagrant up

This will set up the following

  • A master node called k8s-master
  • 2 worker nodes k8s-worker-1 and k8s-worker-2

Accessing master

vagrant ssh k8s-master

Accessing nodes

 vagrant ssh k8s-worker-1
 vagrant ssh k8s-worker-2

To access your cluster from your host, run the following command to copy kube config from k8s-master to your home dir

scp vagrant@k8s-master.test:/etc/kubernetes/admin.conf ~/.kube/config

Alternatively you can install vagrant scp plugin and run the following

vagrant scp k8s-master:/etc/kubernetes/admin.conf ~/.kube/config

Create .kube/ directory if it doesn't exist

Get cluster info

kubectl cluster-info

Get nodes in your cluster

kubectl get nodes

Tested on

Ubuntu 20.04 LTS

More information

Get more information on the setup here: https://kubernetes.io/blog/2019/03/15/kubernetes-setup-using-ansible-and-vagrant

About

Kubernetes cluster using Ansible and Vagrant

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published