DevOps Certification Training
- 58k Enrolled Learners
- Live Class
Its common knowledge that Amazon Web Services(AWS) is a well-known provider of cloud services, while Kubernetes is quickly becoming the standard way to manage application containers in the production environment. While many developers would gladly use Kubernetes, the time-consuming cluster management process can be a turnoff. As a solution, developers can use Amazon Elastic Container Service for Kubernetes (Amazon EKS), which allows them to create Kubernetes clusters in the cloud very quickly and easily.
Let’s take a look at the topics covered in this article:
Though containers have been around since the early days of Linux, Docker introduced the modern version of this technology. Kubernetes is open source software that allows you to deploy and manage containerized applications at scale. It also provides portability and extensibility, enabling you to scale containers seamlessly. But, the downside of Kubernetes is that it takes a lot of time to deploy a cluster with master and worker nodes. A turn around for this is Amazon EKS.
Amazon Elastic Container Service for Kubernetes (Amazon EKS) is a managed service that makes it easy for users to run Kubernetes on AWS without needing to stand up or maintain your own Kubernetes control plane. Since Amazon EKS is a managed service it handles tasks such as provisioning, upgrades, and patching.
Definition aside, let’s take a look at the benefits of Amazon EKS:
You may go through this Kubernetes EKS Tutorial recording where our AWS Training expert has explained how you can launch an application on AWS EKS cluster.
So, the above reasons are convincing enough to start using Amazon EKS. Now, let’s take a look at how Amazon EKS actually works.
Getting started with Amazon EKS is easy fairly easy:
Now, let’s see how to deploy a containerized application onto a Kubernetes cluster using Amazon Elastic Container Service for Kubernetes.
Demo: In this demo, we will see how to launch a simple nginx application on Kubernetes cluster using Amazon EKS. Here are the steps you will follow:
This section will walk you through these steps in detail.
The first step is to create an IAM role that Kubernetes can assume to create AWS resources. To do this:
Amazon EKS also requires a Virtual Private Cloud (VPC) to deploy the cluster. To create this VPC:
At this point, you are ready to create a new Amazon EKS cluster. To do this:
Kubernetes uses a command-line utility called Kubectl for communicating with Kubernetes cluster. Amazon EKS clusters also require the AWS IAM Authenticator for Kubernetes to allow IAM authentication for your Kubernetes cluster. So, install both of these binaries. Instructions for downloading and setup are in the Amazon EKS documentation.
Note: Ensure that you have at least version of the AWS CLI installed and your system’s Python version must be Python 2.7.9 or greater.
Next, you have to create a kubeconfig file for your cluster with the AWS CLI update-kubeconfig command as follows:
Note: Wait for your cluster status to show as ACTIVE
. If you launch your worker nodes before the cluster is active, the worker nodes will fail to register with the cluster and you will have to relaunch them.
Once the control plane of your cluster has been activated, the next step is to add nodes to it. To do this:
Now to enable worker nodes to join Kubernetes cluster follow below steps:
To create an application you need to create a Kubernetes object of type Deployment. On your local system, create a file named nginx.yaml and fill it with the content below.
Now, as a backup for application, you also need to create a Kubernetes object of Service type. A Kubernetes Service is an abstraction which defines a logical set of Pods running somewhere in your cluster, that all provide the same functionality as ones which you created earlier. On your local system, create a file named nginx.yaml and fill it with the content below.
Congratulations! Now you know how to deploy a containerized application onto a Kubernetes cluster using Amazon Elastic Container Service(Amazon EKS).
When you are finished experimenting with your application, you should clean up the resources that you created for it to avoid incurring unnecessary costs. You can do so using the following commands:
I hope now you have a basic idea of what Amazon EKS is and how to use it to create and launch containerized applications on a Kubernetes cluster.
So this is it! I hope this blog was informative and added value to your knowledge. If you are interested to take your knowledge of Amazon Web Services to next level then enroll for the AWS Architect Certification Training course by Edureka.
Got a question for us? Please mention it in the comments section of “AWS Elastic Beanstalk” and we will get back to you as soon as possible.