Posts

create ec2-vpc-sg-subnet-RT-igw using terraform

the following code helps you to make infrastructure.  terraform {   required_providers {     aws = {       source  = "hashicorp/aws"       version = "~> 4.0"     }   } } # Configure the AWS Provider provider "aws" {   region     = "us-east-1"   access_key = "AKIARMGMXWTSRZUTRJDG"   secret_key = "IqmpNV4RAQPMV50bdn9EYOoV26CIsjP9ZCo18goX" } # Create a VPC resource "aws_vpc" "terraformvpc" {   cidr_block       = "10.0.0.0/16"   instance_tenancy = "default"   tags = {     Name = "terraformvpc"   } } # create a subnet resource "aws_subnet" "terraformsubnet" {   vpc_id     = aws_vpc.terraformvpc.id   cidr_block = "10.0.0.0/16"   tags = {     Name = "terraformsubnet"   } } # create internet gateway resource "aws_internet_gateway" "igwterraform" {   vpc_id = aws_vpc.terraformvpc.id   tags =...

Create two instances in two different vpc in same region and make them to ping to each other over internal ip(local ip)

Image
 step1: Create Two VPC , one is Privpc and another is Pubvpc .    step2: Now create two subnet , one is Pubsub and another is Prisub . step3: Now create two route tables , one is pubRT and another is PriRT . And attach pubRT to                          pubvpc . Then, PriRT attach with privpc . step4: Now select pubRT and then below select subnet associate . Then, Edit subnet associate and                 select pubsub (subnet) and Save it.           Now repeate same like this but this time for PriRT .           Now sleect PriRT and then below select subnet associcate . Then, Edit subnet associate and                select prisub (subnet) and Save it.    step5: Now, create two Internet Gateway , one is pubigw and another is priigw . Then, Attach pubigw with ...

Error Solving : -bash: /usr/local/bin/kubectl: cannot execute binary file : after Kubernetes installation: you're trying to run the kubectl command on an EC2 instance in AWS

Image
you're trying to run the kubectl command on an EC2 instance in AWS, the first thing to check is whether you've downloaded the correct version of kubectl for your instance's operating system and architecture. follow these steps to resolve it: You can download the correct version of kubectl using the following commands: For Linux x86_64: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl" copy this link and paste it into your terminal and press Enter. if your system requires arm64 then copy the below link and paste it into the terminal and Enter. For Linux arm64: curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl" you will get the following screen. now, Make sure you have the correct version of kubectl for your system architecture. Once you have the correct version of kubectl , Enter the following command: ==> chmod +x kubec...

Create a public and private subnet. Create two instances (one in each subnet) and the instance in private subnet should get internet. Instance in private subnet should allow traffic only from public subnet.

Create a VPC: Go to the AWS Management Console and navigate to the VPC dashboard. Click on "Create VPC" and enter the required details, such as the VPC name, CIDR block, etc. Create Subnets: Navigate to the "Subnets" section of the VPC dashboard. Click on "Create subnet" and enter the required details, such as the subnet name, VPC ID, CIDR block, availability zone, etc. Create two subnets, one for public and one for private. Create Internet Gateway: Navigate to the "Internet Gateways" section of the VPC dashboard. Click on "Create internet gateway" and enter the required details, such as the internet gateway name. Attach the internet gateway to the VPC. Route Tables: Navigate to the "Route Tables" section of the VPC dashboard. Create two route tables, one for each subnet. Associate the public subnet with the default route table. Associate the private subnet with the new route table. Create Security Groups: Navigate to the ...

Integrate Git with jenkins GUi and Pull code from GitHub

Image
 Go to the mobaXterm command prompt, Now Enter the command "yum install git" and press enter Then enter the git --version command for the check git version. Here my version is 2.39.1 which I highlighted. Now, go back into the  Jenkins Gui Now click on first left sidebar highlighted link, then click on the right side highlighted link to install plugins Now, Click on Available Plugins, then search into github. Now you can see this plugin .. select GitHub and Click on Install without restart button. let's complete the installation of all recommendation plugins, Then click go back tot he tope page link Now click on the left corner, New project Link and enter the project name click on free style, and then click on to the Ok button. Now in the next step, you can see Git option in Gui. Now select this Git option and enter your application Url from the GitHub Repository. i will give you here my sample repository link, which you can use it ::  https://github.com/parekhankit3/hell...

DevOps Project: Integrate Jenkins with project ps.

Image
 Click on left top corner New Project link. then, enter the name of project and choose free style. click Ok,  Now, wirte anything in the description box. then choose Execute shell because we are using Linux system Now, Enter the any command like we are entering "echo "hello world"" and "uptime". now click on Apply, then click on Save. project deployed. now click on left side bar link ' Build Now ' and the hilighted tick mark. Now you can see the below screen where ou can read project success. in this image you can read you executed code and uptime output, Now go in MobaXterm and enter command uptime you get same output with real time. like below output.   Thank you, we will see more detail into next part.. please like and comment it.

DevOps Project: Integrate Jenkins with project po.

Image
   Follow these all steps to integrate the sample project with Jenkins. 1) Make the Aws account and then make an Ec2 Instance with the name: Jenkins_Server 2)  open this link in a new tab https://pkg.jenkins.io/redhat-stable/ copy this code and past into MobaXterm and execute. If, you get error after first two code install please run " amazon-linux-extras  install  epel " command and install it. Then, Copy the command  java-openjdk11  and install  jenkins  command in MobaXterm. Check  through run command " amazon-linux-extras ",  epel  and  java-openjdk11  are  Enabled  or not. Once  Enabled , Now install " yum install   jenkins " command. Now check the status of Jenkins via command " service jenkins status " If  Disabled , run the command to start jenkins " service jenkins start " Now wait few minutes, your Jenkins will be start very soon. Now, Open the AWS EC2 --> Jenkins_server inst...