Book Image

Mastering Elastic Kubernetes Service on AWS

By : Malcolm Orr, Yang-Xin Cao (Eason)
5 (1)
Book Image

Mastering Elastic Kubernetes Service on AWS

5 (1)
By: Malcolm Orr, Yang-Xin Cao (Eason)

Overview of this book

Kubernetes has emerged as the de facto standard for container orchestration, with recent developments making it easy to deploy and handle a Kubernetes cluster. However, a few challenges such as networking, load balancing, monitoring, and security remain. To address these issues, Amazon EKS offers a managed Kubernetes service to improve the performance, scalability, reliability, and availability of AWS infrastructure and integrate with AWS networking and security services with ease. You’ll begin by exploring the fundamentals of Docker, Kubernetes, Amazon EKS, and its architecture along with different ways to set up EKS. Next, you’ll find out how to manage Amazon EKS, encompassing security, cluster authentication, networking, and cluster version upgrades. As you advance, you’ll discover best practices and learn to deploy applications on Amazon EKS through different use cases, including pushing images to ECR and setting up storage and load balancing. With the help of several actionable practices and scenarios, you’ll gain the know-how to resolve scaling and monitoring issues. Finally, you will overcome the challenges in EKS by developing the right skill set to troubleshoot common issues with the right logic. By the end of this Kubernetes book, you’ll be able to effectively manage your own Kubernetes clusters and other components on AWS.
Table of Contents (28 chapters)
1
Part 1: Getting Started with Amazon EKS
7
Part 2: Deep Dive into EKS
13
Part 3: Deploying an Application on EKS
20
Part 4: Advanced EKS Service Mesh and Scaling
24
Part 5: Overcoming Common EKS Challenges

Scaling EC2 ASGs with Cluster Autoscaler

Kubernetes CA is a core part of the K8s ecosystem and is used to scale worker nodes in or out based on two main conditions:

  • If there is a Pod in the Kubernetes cluster in the Pending state due to an insufficient resources error
  • If there is a worker node in the Kubernetes cluster that is identified as underutilized by Kubernetes CA

The following diagram illustrates the basic flow of a scale-out operation to support a single pod being placed in the Pending state and not being scheduled.

Figure 18.3 – High-level Cluster AutoScaler flow

Figure 18.3 – High-level Cluster AutoScaler flow

In the preceding diagram, we can see the following:

  1. The CA is actively looking for pods that cannot be scheduled for resource reasons and are in the Pending state.
  2. The CA makes calls to the EC2 ASG API to increase the desired capacity, which in turn will add a new node to the ASG. A key aspect to note is that the nodes need tagging with k8s.io/cluster...