Skip to content

Ansible playbooks to automate kubernetes cluster deployment

Notifications You must be signed in to change notification settings

Moody-san/ansible-k8s-deployment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

35 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ansible Kubernetes Deployment

This repository contains Ansible playbooks and scripts for deploying a Kubernetes cluster with Kubeadm.

Prerequisites

  • Infra provisioned through IAC: Deployed infrastructure using terraform multi cloud iac (as it contains a module to automatically update inventory for ansible scripts given that ansible repo and terraform repo are in the same directories).
  • Ansible Controller Scripts: Run the setupiptables.yml and acceptfingerprint.yml from ansible_controller_setup repository . Link in Additional Resources .
  • Software Requirements: Ensure Ansible cli is installed.

Installation

Clone the repository to your local machine to get started with the Kubernetes deployment:

git clone https://github.com/Moody-san/ansible-k8s-deployment.git
cd ansible-k8s-deployment/playbooks

Usage

ansible-playbook initmaster.yml -i ../inventory/oracleinventory
ansible-playbook addworkernodes.yml -i ../inventory/oracleinventory
ansible-playbook addcontrolnodes.yml -i ../inventory/oracleinventory
ansible-playbook addistiomesh.yml -i ../inventory/oracleinventory

Configuration

you can use the -l limit tag to add specific nodes only for example

ansible-playbook addworkernodes.yml -i ../inventory/oracleinventory -l oraclemaster,oracleworker

Additional Resources

Notes

  • You will be prompted for your private load balancer ip when initializing kubernetes cluster . The one provisioned through the terraform .
  • When using limit with for example with addworkernodes oraclemaster is required as we use oracle master to generate the join string .

Demo

https://www.youtube.com/watch?v=7lCZTS3z6kk

Releases

No releases published

Packages

No packages published

Languages