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

Tips on How to Study for CompTIA Linux+ XK0–004 Certification Exam

Blockers: Shifting from reactive to proactive

Upload data from web page (client) to a bucket in AWS S3

Uploading and downloading from AWS S3 in Unity

May LeetCoding Challenge — Day 14

Installing Gnome DE, Terminal On FreeBSD 12

SPO600 Lab 3

Migrating to Bazel from Maven or Gradle? Part 2 — How to Decide on CI Server and remote execution

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

Creating a Kubernetes Cluster using kind

Sealed Secrets for Kubernetes

Introduction to Openshift Operators

Set up a Kubernetes Cluster with kubeadm