Terraform assignment-1 by Bharath Srinivas

provider “aws” {region = “ap-south-1”access_key = “”secret_key = “”} provider “github” {token = “”organization = “”} variable “instance_count” {type = numberdescription = “This is for demo of number variable”default = 2 }variable “users” {type = “list”default = [“bharath”, “sharath”, “nikhil”]description = “This is for demo of list variable”} variable “amis” {type = “map”default = {“us-east-1” = “ami-““us-west-2” = “ami-“}} variable “reponame” {type = stringdescription = “This is for demo of string variable”default = “terraform”} resource “aws_iam_user” “iamuser” {name = “${var.users[0]}”}

Read more

Terraform-Assignment2 by Bharath Srinivas

provider “aws” {access_key = “”secret_key = “”region = “eu-east-2”} resource “aws_instance” “web” {ami = “ami-xbbsj”instance_type = “t2.micro”count = 1tags = {Name = “Demo”}} provisioner “file” {source = “conf/install-apache.yml”destination = “/etc/install-apache.yml”} provisioner “remote-exec” {inline = [“sudo apt update”, “sudo apt install python3 -y”, “sudo apt install ansible -y”] } provisioner “local-exec” {command = “ANSIBLE_HOST_KEY_CHECKING=False ansible-playbook -u root -i ‘${self.ipv4_address},’ –private-key ${var.pvt_key} -e ‘pub_key=${var.pub_key}’ install-apache.yml”} } install-apache.yml -name=install_httpdhosts=webservertasks=-name:install httpd in serveryum:name: httpdstate: latest

Read more

7. List of 20 docker commands and its use cases with example? by Bharath Srinivas

docker info: displays information about docker installation docker ps : to check the running containers docker ps -a : to check all the containers which are running and exited docker images: to check the list of images docker pull: to pull the image from registry docker push: to push the created image to registry docker stop: to stop the container docker start: to start the stopped container docker kill: to kill the running container unsafe docker rmi: to remove the

Read more

5. List of Docker file instructions and its Brief Summary? by Bharath Srinivas

FROM : To get the base image MAINTAINER: author of the generated image ADD: It is similar to COPY but it supports get remote URLs and also unzips tar balls RUN: Run is used to run specific commands. CMD: This is similar to ENTRYPOINT it allows the override the command ENTRYPOINT: after starting the container it is the initial process that runs. Entry point doesn’t allow override the command WORKDIR: Used to create working directory inside the container. COPY: copy

Read more

1. Components of Docker and its Brief Summary by Bharath Srinivas

Docker Engine:It is the main part of docker system. It follows client-server architecture.It is installed on host machine. It contains:1.Server: It is called as dockerd used to manage images containers network2.Rest API: used to instruct daemon3.CLI: where we run the docker commands Docker Client:when you run commandon CLI client sends to daemon which makes the action.Docker clientcan communicate with more than one daemon Docker Registry:It is the location where docker images are stored.it can be public or a privatewhen we

Read more