<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Xmen143</title>
    <description>The latest articles on Forem by Xmen143 (@rupeshj845).</description>
    <link>https://forem.com/rupeshj845</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F886747%2F55b4b0e2-6ccf-4c6f-a3c8-9d4e364b25a7.jpeg</url>
      <title>Forem: Xmen143</title>
      <link>https://forem.com/rupeshj845</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/rupeshj845"/>
    <language>en</language>
    <item>
      <title>AWS EKS — DEEP DIVE</title>
      <dc:creator>Xmen143</dc:creator>
      <pubDate>Fri, 15 Jul 2022 12:03:32 +0000</pubDate>
      <link>https://forem.com/rupeshj845/aws-eks-deep-dive-1b81</link>
      <guid>https://forem.com/rupeshj845/aws-eks-deep-dive-1b81</guid>
      <description>&lt;p&gt;⚜️What is Amazon EKS?&lt;/p&gt;

&lt;p&gt;Amazon Elastic Kubernetes Service (Amazon EKS) is a managed service that you can use to run Kubernetes on AWS without needing to install, operate, and maintain your own Kubernetes control plane or nodes. Kubernetes is an open-source system for automating the deployment, scaling, and management of containerized applications. Amazon EKS:&lt;/p&gt;

&lt;p&gt;Automatically scales control plane instances based on load, detects and replaces unhealthy control plane instances, and it provides automated version updates and patching for them.&lt;br&gt;
• Is integrated with many AWS services to provide scalability and security for your applications, including the following capabilities:&lt;br&gt;
• Amazon ECR for container images&lt;br&gt;
• Elastic Load Balancing for load distribution&lt;br&gt;
• IAM for authentication.&lt;/p&gt;

&lt;p&gt;⚜️How does Amazon EKS work?&lt;/p&gt;

&lt;p&gt;⚜️Getting started with Amazon EKS is easy:&lt;/p&gt;

&lt;p&gt;Create an Amazon EKS cluster in the AWS Management Console or with the AWS CLI or one of the AWS SDKs.&lt;br&gt;
Launch managed or self-managed Amazon EC2 nodes, or deploy your workloads to AWS Fargate.&lt;br&gt;
When your cluster is ready, you can configure your favorite Kubernetes tools, such as kubectl, to communicate with your cluster.&lt;br&gt;
Deploy and manage workloads on your Amazon EKS cluster the same way that you would with any other Kubernetes environment.&lt;br&gt;
⚜️Management Console and AWS CLI:&lt;/p&gt;

&lt;p&gt;⚜️To create your cluster&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an Amazon VPC with public and private subnets that meets Amazon EKS requirements.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;aws cloudformation create-stack \&lt;br&gt;
— region ap-south-1 \&lt;br&gt;
— stack-name my-eks-stack \&lt;br&gt;
— template-url &lt;a href="https://s3.us-west-2.amazonaws.com/amazon-eks/"&gt;https://s3.us-west-2.amazonaws.com/amazon-eks/&lt;/a&gt;&lt;br&gt;
cloudformation/2020–10–29/amazon-eks-vpc-private-subnets.yaml&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a cluster IAM role and attach the required Amazon EKS IAM managed policy to it. Kubernetes clusters managed by Amazon EKS make calls to other AWS services on your behalf to manage the resources that you use with the service.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a. Copy the following contents to a file named cluster-role-trust-policy.json.&lt;br&gt;
{&lt;br&gt;
“Version”: “2012–10–17”,&lt;br&gt;
“Statement”: [&lt;br&gt;
{&lt;br&gt;
“Effect”: “Allow”,&lt;br&gt;
“Principal”: {&lt;br&gt;
“Service”: “eks.amazonaws.com”&lt;br&gt;
},&lt;br&gt;
“Action”: “sts:AssumeRole”&lt;br&gt;
}&lt;br&gt;
]&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;b. Create the role.&lt;/p&gt;

&lt;p&gt;aws iam create-role \&lt;br&gt;
— role-name myAmazonEKSClusterRole \&lt;br&gt;
— assume-role-policy-document file://”cluster-role-trust-policy.json”&lt;/p&gt;

&lt;p&gt;c. Attach the required Amazon EKS managed IAM policy to the role.&lt;/p&gt;

&lt;p&gt;aws iam attach-role-policy \&lt;br&gt;
— policy-arn arn:aws:iam::aws:policy/AmazonEKSClusterPolicy \&lt;br&gt;
— role-name myAmazonEKSClusterRole&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Amazon EKS console.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Step 2: Configure cluster communication&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Choose Add cluster, and then choose Create. If you don’t see this option, then choose Clusters in the left navigation pane first.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Configure cluster page, do the following:&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Enter a Name for your cluster, such as my-cluster.&lt;br&gt;
For Cluster Service Role, choose myAmazonEKSClusterRole.&lt;br&gt;
Leave the remaining settings at their default values and choose Next.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;On the Specify networking page, do the following:&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Choose the ID of the VPC that you created in a previous step from the VPC dropdown list. It is something like vpc-00x0000x000x0x000 | my-eks-vpc-stack-VPC.&lt;br&gt;
Leave the remaining settings at their default values and choose Next.&lt;br&gt;
7.On the Configure logging page, choose Next.&lt;/p&gt;

&lt;p&gt;On the Review and create page, choose Create.&lt;/p&gt;

&lt;p&gt;⚜️Step 2: Configure your computer to communicate with your cluster.&lt;/p&gt;

&lt;p&gt;In this section, you create a kubeconfig file for your cluster. The settings in this file enable the kubectl CLI to communicate with your cluster.&lt;br&gt;
To configure your computer to communicate with your cluster.&lt;/p&gt;

&lt;p&gt;Create or update a kubeconfig file for your cluster.&lt;br&gt;
aws eks update-kubeconfig — region ap-south-1 — name my-cluster&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Test your configuration.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;kubectl get svc&lt;/p&gt;

&lt;p&gt;⚜️Create nodes&lt;/p&gt;

&lt;p&gt;Fargate — Linux — Choose this type of node if you want to run Linux applications on AWS Fargate. Fargate is a serverless compute engine that lets you deploy Kubernetes pods without managing Amazon EC2 instances.&lt;/p&gt;

&lt;p&gt;• Managed nodes — Linux — Choose this type of node if you want to run Amazon Linux applications on Amazon EC2 instances.&lt;br&gt;
To create a Fargate profile&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create an IAM role and attach the required Amazon EKS IAM managed policy to it. The Amazon EKS pod execution role provides the IAM permissions to do this.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a. Copy the following contents to a file named pod-execution-role-trustpolicy.json.&lt;/p&gt;

&lt;p&gt;{&lt;br&gt;
“Version”: “2012–10–17”,&lt;br&gt;
“Statement”: [&lt;br&gt;
{&lt;br&gt;
“Effect”: “Allow”,&lt;br&gt;
“Condition”: {&lt;br&gt;
“ArnLike”: {&lt;br&gt;
“aws:SourceArn”: “arn:aws:eks:regioncode:111122223333:fargateprofile/my-cluster/*”&lt;br&gt;
}&lt;br&gt;
},&lt;br&gt;
“Principal”: {&lt;br&gt;
“Service”: “eks-fargate-pods.amazonaws.com”&lt;br&gt;
},&lt;br&gt;
“Action”: “sts:AssumeRole”&lt;br&gt;
}&lt;br&gt;
]&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;b. Create a pod execution IAM role.&lt;/p&gt;

&lt;p&gt;aws iam create-role \&lt;br&gt;
— role-name AmazonEKSFargatePodExecutionRole \&lt;br&gt;
— assume-role-policy-document file://”pod-execution-role-trust-policy.json”&lt;/p&gt;

&lt;p&gt;c. Attach the required Amazon EKS managed IAM policy to the role.&lt;/p&gt;

&lt;p&gt;aws iam attach-role-policy \&lt;br&gt;
— policy-arn arn:aws:iam::aws:policy/AmazonEKSFargatePodExecutionRolePolicy \&lt;br&gt;
— role-name AmazonEKSFargatePodExecutionRole&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Amazon EKS console.&lt;/li&gt;
&lt;li&gt;On the Clusters page, choose the my-cluster cluster.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the my-cluster page, do the following:&lt;br&gt;
a. Choose the Compute tab.&lt;br&gt;
b. Under Fargate Profiles, choose Add Fargate Profile.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Configure Fargate Profile page, do the following:&lt;br&gt;
a. For Name, enter a unique name for your Fargate profile, such as my-profile.&lt;br&gt;
b. For Pod execution role, choose the AmazonEKSFargatePodExecutionRole that you created in a previous step.&lt;br&gt;
c. Choose the Subnets dropdown and deselect any subnet with Public in its name. Only private subnets are supported for pods that are running on Fargate.&lt;br&gt;
d. Choose Next.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Configure pod selection page, do the following:&lt;br&gt;
a. For Namespace, enter default.&lt;br&gt;
b. Choose Next.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;On the Review and create page, review the information for your Fargate profile and choose Create.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;After a few minutes, the Status in the Fargate Profile configuration section will change from Creating to Active. Don’t continue to the next step until the status is Active.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If you plan to deploy all pods to Fargate (none to Amazon EC2 nodes), do the following to create another Fargate profile and run the default name resolver (CoreDNS) on Fargate.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;⚜️Amazon EC2 Linux managed node group&lt;br&gt;
To create your Amazon EC2 Linux managed node group&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create a node IAM role and attach the required Amazon EKS IAM managed policy to it. Nodes receive permissions for these API calls through an IAM instance profile and associated policies.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;a. Copy the following contents to a file named node-role-trust-policy.json.&lt;br&gt;
{&lt;br&gt;
“Version”: “2012–10–17”,&lt;br&gt;
“Statement”: [&lt;br&gt;
{&lt;br&gt;
“Effect”: “Allow”,&lt;br&gt;
“Principal”: {&lt;br&gt;
“Service”: “ec2.amazonaws.com”&lt;br&gt;
},&lt;br&gt;
“Action”: “sts:AssumeRole”&lt;br&gt;
}&lt;br&gt;
]&lt;br&gt;
}&lt;/p&gt;

&lt;p&gt;b. Create the node IAM role.&lt;br&gt;
aws iam create-role \&lt;br&gt;
— role-name myAmazonEKSNodeRole \&lt;br&gt;
— assume-role-policy-document file://”node-role-trust-policy.json”&lt;/p&gt;

&lt;p&gt;c. Attach the required managed IAM policies to the role.&lt;br&gt;
aws iam attach-role-policy \&lt;br&gt;
— policy-arn arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy \&lt;br&gt;
— role-name myAmazonEKSNodeRole&lt;/p&gt;

&lt;p&gt;⚜️&lt;br&gt;
aws iam attach-role-policy \&lt;br&gt;
— policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly \&lt;br&gt;
— role-name myAmazonEKSNodeRole&lt;br&gt;
aws iam attach-role-policy \&lt;br&gt;
— policy-arn arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy \&lt;br&gt;
— role-name myAmazonEKSNodeRole&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open the Amazon EKS console at &lt;a href="https://console.aws.amazon.com/eks/home#/clusters"&gt;https://console.aws.amazon.com/eks/home#/clusters&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Choose the name of the cluster that you created in Step 1: Create your Amazon EKS cluster , such as my-cluster.&lt;/li&gt;
&lt;li&gt;On the my-cluster page, do the following:
a. Choose the Compute tab.
b. Choose Add Node Group.&lt;/li&gt;
&lt;li&gt;On the Configure Node Group page, do the following:
a. For Name, enter a unique name for your managed node group, such as my-nodegroup.
b. For Node IAM role name, choose myAmazonEKSNodeRole role that you created in a previous step. We recommend that each node group use its own unique IAM role.
c. Choose Next.&lt;/li&gt;
&lt;li&gt;On the Set compute and scaling configuration page, accept the default values and choose Next.&lt;/li&gt;
&lt;li&gt;On the Specify networking page, accept the default values and choose Next.&lt;/li&gt;
&lt;li&gt;On the Review and create page, review your managed node group configuration and choose Create.&lt;/li&gt;
&lt;li&gt;After several minutes, the Status in the Node Group configuration section will change from Creating to Active. Don’t continue to the next step until the status is Active.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;THANK YOU !!&lt;/p&gt;

&lt;p&gt;💠Keep Learning Keep Sharing💠&lt;/p&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Amazon - Elastic Container Service(Deep Dive)</title>
      <dc:creator>Xmen143</dc:creator>
      <pubDate>Wed, 06 Jul 2022 13:43:20 +0000</pubDate>
      <link>https://forem.com/rupeshj845/amazon-elastic-container-servicedeep-dive-263p</link>
      <guid>https://forem.com/rupeshj845/amazon-elastic-container-servicedeep-dive-263p</guid>
      <description>&lt;p&gt;❄️Overview&lt;br&gt;
Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service that provides the most secure, reliable and scalable way to run containerized applications.&lt;/p&gt;

&lt;p&gt;Amazon ECS is a highly scalable, fast container management service that makes it easy to run, stop, and manage containers on a cluster. ECS comes with two launch types: EC2 and Fargate. The containers can run on a serverless infrastructure that is managed by AWS Fargate.&lt;/p&gt;

&lt;p&gt;Amazon ECS eliminates the need for you to install and operate your own container orchestration software, manage and scale a cluster of virtual machines, or schedule containers on those virtual machines.&lt;/p&gt;

&lt;p&gt;⚜️Components of Amazon ECS Works and How They Work?&lt;br&gt;
Basic components of Amazon ECS are Docker containers running on EC2 instance or you could go serverless by lounging services and tasks using AWS Fargate. But before we go any further, to fully understand how Amazon ECS works and why it's so powerful, one must first have to understand Docker.&lt;/p&gt;

&lt;p&gt;Docker is a client-server development application that containerized applications in a lightweight environment containing all necessary dependencies that specific applications may need to run. Multiple different containers can be run on a single machine, making Docker very popular with developers when it comes to decoupling applications of running specific job types in batch.&lt;/p&gt;

&lt;p&gt;⚜️AWS ECS -Task Definitions  &lt;br&gt;
To prepare your application to run on Amazon ECS, you need to create a task definition. A task definition is a text file (in JSON format) that describes one or more containers (up to 10) that make up your application. The job definition can specify various parameters for your containerized application. For example, you can use these parameters to indicate which containers to run, which ports should be open, which data volumes should be used, what Docker networking mode to use, and Identity and Access Management (IAM) roles. Almost everything you can run in a command-line Docker command can be defined using ECS task definitions.&lt;/p&gt;

&lt;p&gt;⚜️AWS ECS -Tasks and Scheduling &lt;br&gt;
 A task is an instance of a task definition running in a cluster. After you create a task definition for your application in Amazon ECS, you can specify the number of tasks to run on your cluster. The Amazon ECS Task Scheduler is responsible for placing tasks in a cluster. There are two primary scheduler strategies: The REPLICA strategy places a desired number of tasks in your cluster, and maintains this number of tasks, restoring them if some of them fail. The DAEMON strategy places one task on each active container instance that meets the relevant criteria.&lt;/p&gt;

&lt;p&gt;⚜️AWS ECS -Cluster&lt;br&gt;
An Amazon ECS cluster is a logical grouping of services, each composed of one or more tasks. The first time you use Amazon ECS, a default cluster is created. You can create additional clusters in your account to achieve resource isolation for different workloads or projects. There are two ways to run cluster resources - on EC2 instances or via Amazon Fargate.&lt;/p&gt;

&lt;p&gt;⚜️Container Agent - The container agent runs on each container instance in an Amazon ECS cluster. The agent sends information about currently running tasks, and resource utilization, to Amazon ECS. Amazon ECS can use the agent to start and stop tasks as needed.&lt;br&gt;
AWS ECS Deployment Options: EC2 vs Fargate&lt;/p&gt;

&lt;p&gt;ECS can use Elastic Compute Cloud (EC2) instances to run containers. EC2 instances are deployed as part of the Amazon EC2 service, and "registered" in a defined ECS cluster, meaning that EC2 can use those instances to deploy containers. You can run an ECS cluster within an existing VPC, making it accessible to existing AWS resources running in that VPC. An alternative way to deploy ECS containers is with Amazon Fargate. Fargate removes responsibility for provisioning, configuring, and managing EC2 instances, allowing AWS to manage EC2 instances for you. With Fargate you don't need to manage servers, but you must ensure that task definitions are stateless.&lt;/p&gt;

&lt;p&gt;🔅Common Use Case: Microservices&lt;br&gt;
In order to handle increasing loads and scalability, teams are experimenting with microservice architecture by decoupling their monolithic apps. Thankfully Amazon ECS streamlines this process by providing administrators and engineers container orchestration capabilities to manage and control containerized independent services.&lt;/p&gt;

&lt;p&gt;🔅Common Use Case: Batch Jobs&lt;br&gt;
AWS Batch uses the Amazon ECS Agent to execute and carry out containerized jobs that run specific tasks. AWS Batch enables engineers to easily manage, run, and scale batch operations from tens to hundreds and thousands of containerized compute jobs.&lt;br&gt;
THANK YOU !!&lt;/p&gt;

&lt;p&gt;💠Keep Learning Keep Sharing💠&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ecs</category>
      <category>container</category>
      <category>docker</category>
    </item>
    <item>
      <title>AWS CloudWatch — Use Cases</title>
      <dc:creator>Xmen143</dc:creator>
      <pubDate>Mon, 04 Jul 2022 20:31:38 +0000</pubDate>
      <link>https://forem.com/rupeshj845/aws-cloudwatch-use-cases-ecd</link>
      <guid>https://forem.com/rupeshj845/aws-cloudwatch-use-cases-ecd</guid>
      <description>&lt;p&gt;❄️ AWS CloudWatch&lt;br&gt;
CloudWatch collects monitoring and operational data in the form of logs, metrics, and events, and visualizes it using automated dashboards so you can get a unified view of your AWS resources, applications, and services that run on AWS and on premises.&lt;/p&gt;

&lt;p&gt;📄Overview&lt;br&gt;
⚜️Why AWS CloudWatch?&lt;/p&gt;

&lt;p&gt;Amazon CloudWatch is the component of Amazon Web Services that provides real-time monitoring of AWS resources and customer applications running on Amazon infrastructure.&lt;/p&gt;

&lt;p&gt;The following image shows the different AWS resources monitored by Amazon CloudWatch.&lt;/p&gt;

&lt;p&gt;🔅Uses Cases:&lt;br&gt;
Configure Amazon CloudWatch to send a notification when CPU utilization of an instance is greater than 1%.&lt;/p&gt;

&lt;p&gt;👉Step 1 : Creating a CPU utilization metric&lt;br&gt;
Go to Amazon CloudWatch Management Console and select metrics from the navigation pane.&lt;/p&gt;

&lt;p&gt;👉Step 2 : Click on Metrics — All metrics.&lt;br&gt;
Click on Graphed metrics.&lt;/p&gt;

&lt;p&gt;👉Step 3: Click on Add metrics using browse or query.&lt;br&gt;
Click EC2 -View automatic dashboard&lt;/p&gt;

&lt;p&gt;👉Step 4: Creating an alarm to notify when CPU Utilization metric of the instance is greater than 1%.&lt;br&gt;
Now select the Graphed Metrics option on the same page. Then set the time period according to your need. And choose an alarm icon located beside the selected instance.&lt;/p&gt;

&lt;p&gt;Then create a Alarm.&lt;/p&gt;

&lt;p&gt;Step 5:&lt;/p&gt;

&lt;p&gt;Create new topic if you don’t have any existing topics.&lt;/p&gt;

&lt;p&gt;If you want to Autoscaling according to CPU utilization.&lt;/p&gt;

&lt;p&gt;Click Add Auto Scaling Action.&lt;/p&gt;

&lt;p&gt;👉Step 6: Give your alarm a name and description. Set the Threshold condition.&lt;/p&gt;

&lt;p&gt;👉Step 7:&lt;br&gt;
You want AWS to send you an email notification whenever the alarm condition is satisfied. The notification is sent through Amazon SNS Topic.&lt;/p&gt;

&lt;p&gt;👉Step 8: Congratulations, you have successfully configured Amazon CloudWatch Alarm to monitor your instance. You will receive the notification through an e-mail on the mail-id you have specified when the alarm condition is met.&lt;/p&gt;

&lt;p&gt;🔅Use Case 2: You can log the changes in the state of an Amazon EC2 instance by using CloudWatch Events with the assistance of AWS Lambda function.&lt;/p&gt;

&lt;p&gt;Benefits of Amazon CloudWatch&lt;br&gt;
Amazon CloudWatch allows you to access all your data from a single platform. It is natively integrated with more than 70 AWS services. Vodafone company uses Amazon CloudWatch with Auto Scaling groups to monitor CPU usage and to scale from three Amazon EC2 instances to nine during peak periods automatically.&lt;/p&gt;

&lt;p&gt;Provides real-time insights so that you can optimize operational costs and AWS resources. Kellogg company uses Amazon CloudWatch for monitoring, which helps the company make better decisions around the capacity they need, so that they can avoid wastage.&lt;/p&gt;

&lt;p&gt;THANK YOU !!&lt;/p&gt;

&lt;p&gt;💠Keep Learning Keep Sharing💠&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloudwatch</category>
      <category>ec2</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
