Webinar Alert : Mastering  Manual and Automation Testing! - Reserve Your Free Seat Now

- AWS Blogs -

How To Use Amazon EKS And Deploy A Kubernetes Application With It?

Today everyone knows that Amazon Web Services(AWS) is a leading global provider of cloud services, and Kubernetes is gaining attention as a powerful tool to deploy and maintain containers in production environments. Many people love to use Kubernetes, but the hard part of cluster management can be a drawback to it, to cater to this issue we have the solution in the form of Amazon EKS (Amazon Elastic Kubernetes Service ) which helps in making Kubernetes clusters in a fast and easy way.

Many big companies like AWS, Oracle, Microsoft, VMware have been linked to CNCF and adopted the use of Kubernetes, and this has led to a rise in its use and popularity exponentially.

Although the latest versions of Kubernetes made the deployment of clusters an easy process there are still some challenges to its widespread popularity. Although you could get used to with the use of pods, containers, services and replication controllers, concepts like networking, load balancing, and monitoring are a big challenge to understand and manage.

What is Amazon EKS?

As we know that containers were always there, we call them Docker in the current time. Amazon Elastic Kubernetes Service has simplified the use of Kubernetes on AWS/Cloud hence removing the effort of setting it up on a personal control-plane. It takes care of upgrades & patching.

EKS - Cloud Trail are together used to track user and cluster activity.  Cloud Trail captures the API calls coming to EKS.

Logs for K8s can be seen in Amazon CloudWatch.

Running clusters can be updated without removing old clusters or creating new clusters. It offers compatibility with add-ons like CoreDNS used to create DNS service, web-based UI called Kubernetes Dashboard and kubectl a utility used to access and manage clusters. Control plane in K8s knows how talking happens between K8s and cluster:

  • Start-stopcontainers
  • Schedulingofcontainers.
  • Checkinghealthofcontainers
  • Managingdifferenttasksrelatedtocontainers.

Benefits of EKS 

  • EKSisuseful in running K8s infrastructure in different AZ, hence engineers do not have to worry about the control plane.
  • Further security is added with the communication channel being encrypted.
  • AWS and K8s community also work together for upgrading codebase.
  • EKS - K8s applications are compatible.
  • Worker nodes are deployed using the AMIs and Cloud Formation.

What is Kubernetes?

It is a software using which we can perform deployment and management of containers. Kubernetes provides features like scalability using which we can extend containers as we want.

But, it also has some drawbacks such as too much time is consumed in cluster deployment using master and worker nodes. The solution to this is Amazon EKS.

K8s word is a Greek word, which means a pilot. It was open-sourced in 2014. It is built upon google long term experience. Containers help to bundle and run code. We need to control containers that have applications in them. If a container crashes another container takes its place. This thing can be controlled as well. K8s is the answer to this.

Benefits like scaling containers are provided using this.

Use of Kubernetes? 

  • Load Balancing: Containers can be exposed using DNS and IP address. The load balancer shares the traffic going to containers.
  • Storage orchestration: It helps to mount a storage system, such as local storage, public cloud providers.
  • Cost Reductions: Containers share OS and Network of the Host machine. This comes under resource utilization as compared to create a VM. They are light in weight and use fewer resources hence cost-efficient.
  • Easy to use: Containers help to run the same application across clouds.
  • Global support: K8s popularity is so high that it is considered best among all orchestration tools. It has many active developers. Many market leaders have adopted to K8s. 

How Amazon EKS works?

Let us understand the working of EKS using below steps. Trust me they are easy :)

Read: How to Create Amazon Chatbot & Integrate with Facebook?
  • Create an Amazon EKS cluster using – AWS Console, AWS CLI or AWS SDK.
  • Setup a few worker nodes. Make sure they can communicate with the Amazon EKS cluster.
  • Kubectl – configure it on cluster so that you can talk to your cluster.

Demo: Nginx Deployment

Let’s deploy an Nginx application on Kubernetes with the help of Amazon EKS.

1). AWS IAM service role and a VPC

Create an IAM role for Kubernetes to use AWS resources

  • Go to AWS IAM Console >> Roles >> Create role
  • AWS service >> EKS as the service
  • Name of the role >> Create a role

Create a Virtual Private Cloud (VPC) for cluster deployment.

  • AWS CloudFormation console >> Create Stack.
  • Specify Template >> Amazon S3 URL, paste the below URL

URL: https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-10-08/amazon-eks-vpc-sample.yaml

  • Enter details >> Create

2). Create an Amazon EKS cluster 

  • Amazon EKS >> Create Cluster [ Select the Role we created in IAM]

3). Setup Kubectl

Kubectl is a utility used to talk to clusters.

kubectl package comes in built-in most of OS packages hence easy in installation.

You can use the link to download and install kubectl.

Have the latest version of the AWS CLI installed?

Configure Kubectl to talk to your cluster

  1. Configure a user that can access to this cluster. 

4). Launch and configure Amazon EKS worker nodes

Read: How to Delete AWS Account?

Launch worker nodes only when the cluster is ACTIVE. Launching them before the cluster is up will not allow them to register with the cluster. Let’s join worker nodes to K8s cluster by the below steps:

  • Go to AWS Cloud Formation console >> Create stack

URL : https://amazon-eks.s3-us-west-2.amazonaws.com/cloudformation/2019-10-08/amazon-eks-nodegroup.yaml 

 Press Next

On Next page, press Next

  • When stack is completed, in the “Output” section of the stack. Make a note of Role ARN 

Let’s join worker nodes to Kubernetes cluster by below steps:

  • Create a file named aws-auth-cm.yamland use the below data. Replace the AWS-ARN with the node instance role that you copied from the stack output earlier. 
  • Apply the changes in this file.

kubectl apply –f aws-auth-cm.yaml  

  • Once done check the status of worker nodes. They should be in Readystate

kubectl get nodes 

Nodes should be visible in Ready state.

5). Launch a simple Nginx application

  • Create a Kubernetes object - type

Create a file nginx.yaml and populate the details below: 

  • Create a Kubernetes object of Service type. Service tells us about the logical set of Pods.

 Create a file nginx-svc.yaml and populate details below: 

Read: AWS Tutorial for Beginners - Your Pathway to AWS Cloud Computing
  • Deploy the Nginx application

kubectl create –f nginx.yaml

  • Deploy the Nginx service

kubectl create –f nginx-svc.yaml

  • Find running service, ports and external ip.

kubectl get services –o wide

kubectl describe svc nginx  ## LoadBalancer Ingress will be the ip to get the landing page of Nginx.

  • Try to open the Nginx application using the this IP and port. 

Useful Kubernetes tools.

Finally – some cherry on the cake.

Some useful tools used with Kubernetes.

Kube Cluster Deployment Tools

  • Kubespray
  • Minikube
  • Kubeadm
  • Kops
  • Kubernetes on AWS (Kube-AWS)

Monitoring Tools

  1. Kubebox
  2. Kubetail
  3. Kubewatch
  4. Prometheus
  5. Searchlight
  6. cAdvisor
  7. Sumo Logic App
  8. Dynatrace

Testing

  1. Kube-monkey
  2. Test-infra
  3. Sonobuoy

Security

  1. Trireme
  2. Aporeto
  3. Twistlock
  4. Falco
  5. io

Helpful CLI Tools

  1. Cabin
  2. Kubectx/Kubens
  3. Kube-shell
  4. Kail

With this write-up, you have learned fundamentals of Amazon EKS and some amazing practices of it. If you have any further queries related to it then drop your query in the comment below. Happy learning!

Read: AWS vs. OpenStack vs. SoftLayer - Which One is the Best?


fbicons FaceBook twitterTwitter lingedinLinkedIn pinterest Pinterest emailEmail

     Logo

    JanBask Training

    A dynamic, highly professional, and a global online training course provider committed to propelling the next generation of technology learners with a whole new way of training experience.


  • fb-15
  • twitter-15
  • linkedin-15

Comments

Trending Courses

Cyber Security Course

Cyber Security

  • Introduction to cybersecurity
  • Cryptography and Secure Communication 
  • Cloud Computing Architectural Framework
  • Security Architectures and Models
Cyber Security Course

Upcoming Class

-1 day 14 Oct 2024

QA Course

QA

  • Introduction and Software Testing
  • Software Test Life Cycle
  • Automation Testing and API Testing
  • Selenium framework development using Testing
QA Course

Upcoming Class

-1 day 14 Oct 2024

Salesforce Course

Salesforce

  • Salesforce Configuration Introduction
  • Security & Automation Process
  • Sales & Service Cloud
  • Apex Programming, SOQL & SOSL
Salesforce Course

Upcoming Class

3 days 18 Oct 2024

Business Analyst Course

Business Analyst

  • BA & Stakeholders Overview
  • BPMN, Requirement Elicitation
  • BA Tools & Design Documents
  • Enterprise Analysis, Agile & Scrum
Business Analyst Course

Upcoming Class

3 days 18 Oct 2024

MS SQL Server Course

MS SQL Server

  • Introduction & Database Query
  • Programming, Indexes & System Functions
  • SSIS Package Development Procedures
  • SSRS Report Design
MS SQL Server Course

Upcoming Class

3 days 18 Oct 2024

Data Science Course

Data Science

  • Data Science Introduction
  • Hadoop and Spark Overview
  • Python & Intro to R Programming
  • Machine Learning
Data Science Course

Upcoming Class

10 days 25 Oct 2024

DevOps Course

DevOps

  • Intro to DevOps
  • GIT and Maven
  • Jenkins & Ansible
  • Docker and Cloud Computing
DevOps Course

Upcoming Class

3 days 18 Oct 2024

Hadoop Course

Hadoop

  • Architecture, HDFS & MapReduce
  • Unix Shell & Apache Pig Installation
  • HIVE Installation & User-Defined Functions
  • SQOOP & Hbase Installation
Hadoop Course

Upcoming Class

10 days 25 Oct 2024

Python Course

Python

  • Features of Python
  • Python Editors and IDEs
  • Data types and Variables
  • Python File Operation
Python Course

Upcoming Class

4 days 19 Oct 2024

Artificial Intelligence Course

Artificial Intelligence

  • Components of AI
  • Categories of Machine Learning
  • Recurrent Neural Networks
  • Recurrent Neural Networks
Artificial Intelligence Course

Upcoming Class

18 days 02 Nov 2024

Machine Learning Course

Machine Learning

  • Introduction to Machine Learning & Python
  • Machine Learning: Supervised Learning
  • Machine Learning: Unsupervised Learning
Machine Learning Course

Upcoming Class

31 days 15 Nov 2024

 Tableau Course

Tableau

  • Introduction to Tableau Desktop
  • Data Transformation Methods
  • Configuring tableau server
  • Integration with R & Hadoop
 Tableau Course

Upcoming Class

10 days 25 Oct 2024

Search Posts

Reset

Receive Latest Materials and Offers on AWS Course

Interviews