Configure kubernetes cluster using ansible role

- hosts: localhost
tasks:
- ec2:
image: ami-048f6ed62451373d9
region: us-east-1
instance_type: t2.micro
vpc_subnet_id: subnet-b0037d91
group_id: sg-08cb0a77090774f8f
key_name: k8s_master_node
instance_tags:
Name: "{{ item }}"
count_tag:
Name: "{{ item }}"
exact_count: 1
aws_access_key: 'xyzzzzzzzzzzzz'
aws_secret_key: 'abccccccccc'
register: ec2
loop:
- "MasterNode"
- "SlaveNode"
- hosts: tag_Name_MasterNode
tasks:
- include_role:
name: k8s-cluster
vars:
kubernetes_node: "MasterNode"
- hosts: tag_Name_SlaveNode
tasks:
- include_role:
name: k8s-cluster
vars:
kubernetes_node: "SlaveNode"

--

--

--

enthusiastic for new technologies

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

Setting Up Cinemachine in Unity

Is Php really dead? or It’s still everywhere?

Java Math Operators and special operators

10 Tips to Start Out as a Junior Software Developer

10 Tips to Start Out as a Junior Software Developer

PostgreSQL: why and how WAL bloats

How to Create Your First Python Package

Playing with Django Models

Terraform configurations for creating Virtual Machines

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Dhiraj Kumar

Dhiraj Kumar

enthusiastic for new technologies

More from Medium

Is Kubernetes That Important?

Create Kubernetes Cluster Using Linode LKE

How to set up an NFS for VMs & Kubernetes

Features and Benefits of Red Hat OpenShift Service on AWS (ROSA)

Red Hat OpenShift Service on AWS ( ROSA )