Deploy Application on Kubernetes Using Jenkins Multicloud-AWS Infra
Organizations can escape being reliant on a single cloud vendor by adopting a multi-cloud strategy. It also makes it easier for customers to negotiate with service providers for better rates and service level agreements. Data centers for various cloud service companies are spread across various regions. Through the use of a multi-cloud approach, businesses can split up their tasks among various service providers, cutting down on latency and enhancing the user experience for clients in various geographies.
In this Architecture, we’ve specified how quickly we can deploy our application to multiple clouds using Jenkins, and today’s businesses are switching from monolithic to microservice architectures to improve their operations.
High-level Steps
- AWS and GCP infra by Aniketkumavat
- EKS creation and Jenkins pipeline setup in AWS by Bhavesh Dhande (here)
- Jenkins pipeline setup in GCP by Siddhesh Patil (here)
- GKE creation and Route traffic using Route53 GKE and EKS by Rushabh Mahale
Note- Beginning with step number 1, I’ll create a Infrastructure in AWS .
Prerequisites -
- Need AWS account to achieve this task.
- Basic knowledge of AWS and Linux.
AWS Infrastructure
In our project, we are going to set up a suitable environment which includes a VPC, an EC2 instance, and many more applications.
What is a Virtual Private Cloud Network (VPC) ?
The Virtual Private Network (VPC) is an isolated or private cloud computing environment within a public cloud. VPC provides networking for your cloud-based resources and services that are global, scalable, and flexible.
For more information on VPC and related topics, refer to this link .
In this first step, we will establish Eks-vpc in mumbai-ap-south1 region with a specific private CIDR.
What is subnet in aws ?
Subnet is a range of IP addresses in your VPC. You can create AWS resources, such as EC2 instances, in specific subnets. Each subnet must be completely contained inside a single availability zone (AZ) and cannot span zones. You can protect your applications from a single Availability Zone failure by launching Amazon services in separate Availability Zones. For more information, refer to the link.
Now create Eks-subnet and jenkins-subnet in different zones with specific CIDR.
What is the Internet Gateway ?
An internet gateway is a horizontally scaled, redundant, and highly available VPC component that allows communication between your VPC and the internet. It supports IPv4 and IPv6 traffic. It does not cause availability risks or bandwidth constraints on your network traffic.
Create an Eks-vpc internet gateway for communication with the internet, which is also attached to Eks-vpc.
Create an Eks-vpc route table that determines where network traffic from your subnet or gateway is directed and associates both subnets with the route table.
Below figure shows the road map of Eks-vpc.
Go and create EC2 instances.
What is EC2 Instance?
Elastic Cloud Computing is a fundamental service in AWS which offer virtual machine auto-scaling, storage, and storing data in virtual drives. This is IAAS.
Refer this document:- link
After setting up Eks-vpc, we will now create two EC2 instances, Eks-master-vm and jenkins-master-vm, in the Eks-vpc network.
Install required packages that need to run our applications
- Docker
- Java
- Jenkins
- Git
After installation of Jenkins packages, hit the public IP along with the 8080 port, and then install the suggested packages in Jenkins.
In Eks-master-vm we are going to use configuration files through aws cli and kubectl.
What is Jenkins?
Jenkins is an open-source continuous integration/continuous delivery, and continuous deployment (CI/CD) automation software DevOps tool written in the Java programming language.
After installation of Jenkins plugins the dashboard look like this
CONCLUSION -
To build an isolated environment and increase application security, use a custom virtual private network (VPC) to create on-demand intercloud apps. Overall, configuring a VPC and running Docker and Jenkins on an EC2 instance can assist you in automating your software development and deployment processes, improving security, and increasing scalability.
In case you have any questions regarding this article, please feel free to comment in the comments section or contact me via LinkedIn.
I’d like to give a shout-out to my team at Guysinthecloud for all the support.
Thank You