Book Image

Running Windows Containers on AWS

By : Marcio Morales
Book Image

Running Windows Containers on AWS

By: Marcio Morales

Overview of this book

Windows applications are everywhere, from basic intranet applications to high-traffic public APIs. Their prevalence underscores the importance of combining the same tools and experience for managing a modern containerized application with existing critical Windows applications to reduce costs, achieve outstanding operational excellence, and modernize quickly. This comprehensive guide to running and managing Windows containers on AWS looks at the best practices from years of customer interactions to help you stay ahead of the curve. Starting with Windows containers basics, you’ll learn about the architecture design that powers Amazon ECS, EKS, and AWS Fargate for Windows containers. With the help of examples and best practices, you’ll explore in depth how to successfully run and manage Amazon ECS, EKS, and AWS Fargate clusters with Windows containers support. Next, the book covers day 2 operations in detail, from logging and monitoring to using ancillary AWS tools that fully containerize existing legacy .NET Framework applications into containers without any code changes. The book also covers the most common Windows container operations, such as image lifecycle and working with ephemeral hosts. By the end of this book, you’ll have mastered how to run Windows containers on AWS and be ready to start your modernization journey confidently.
Table of Contents (22 chapters)
1
Part 1: Why Windows Containers on Amazon Web Services (AWS)?
4
Part 2: Windows Containers on Amazon Elastic Container Service (ECS)
9
Part 3: Windows Containers on Amazon Elastic Kubernetes Service (EKS)
14
Part 4: Operationalizing Windows Containers on AWS

How Windows Server implements resource controls for Windows containers

In order to understand how Windows Server implements resource controls for Windows containers, we first need to understand what a job object is. In the Windows kernel, a job object allows groups of processes to be managed as a unit, and Windows containers utilize job objects to group and track processes associated with each container.

Resource controls are enforced on the parent job object associated with the container. When you are running the Docker command to execute memory, CPU count, or CPU percentage limits, under the hood, you are asking the HCS to set these resource controls in the parent job object directly:

Figure 1.3 – Internal container runtime process to set resource controls

Figure 1.3 – Internal container runtime process to set resource controls

Resources that can be controlled include the following:

  • The CPU/processor
  • Memory/RAM
  • Disk/storage
  • Networking/throughput

The previous two topics gave us an understanding of how Windows Server exposes container primitives and how container runtimes such as Docker Engine and containerd interact with the Windows kernel. However, you shouldn’t worry too much about this. As a DevOps engineer and solution architect, it is essential to understand the concept and how it differs from Linux, but you will rarely work at the Windows kernel level when running Windows containers. The container runtime will take care of it for you.