Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Running Windows Containers on AWS
Running Windows Containers on AWS

Running Windows Containers on AWS: A complete guide to successfully running Windows containers on Amazon ECS, EKS, and AWS Fargate

eBook
$9.99 $33.99
Paperback
$41.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Table of content icon View table of contents Preview book icon Preview Book

Running Windows Containers on AWS

Windows Container 101

In this chapter, we’re going to cover the foundations of a Windows container and why it is an essential topic for DevOps engineers and solution architects. The chapter will cover the following topics:

  • Why are Windows containers an important topic?
  • How Windows Server exposes container primitives
  • How Windows Server implements resource controls for Windows containers
  • Understanding Windows container base images
  • Delving into Windows container licensing on AWS
  • Summary

Why are Windows containers an important topic?

Have you ever asked yourself, “Why should I care about Windows containers?” Many DevOps engineers and solution architects excel in Linux containerization, helping their companies with re-platforming legacy Linux applications into containers to architect, deploy, and manage complex microservices environments. However, many organizations still run tons of Windows applications, such as ASP.NET websites or .NET Framework applications, which are usually left behind during the modernization journey.

Through many customer engagements I have had in the past, there were two main aspects that meant Windows containers weren’t an option for DevOps engineers and solution architects.

The first was a lack of Windows operational system expertise in the DevOps team. Different system administrators and teams usually manage Windows and Linux, each using the tools that best fit their needs. For instance, a Windows system administrator will prefer System Center Configuration Manager (SCCM) as a Configuration Management solution. In contrast, a Linux system administrator would prefer Ansible.

Another example: a Windows system administrator would prefer System Center Operations Manager (SCOM) for deep insights, monitoring, and logging, whereas a Linux system administrator would prefer Nagios and an ELK stack. With the rapid growth of the Linux ecosystem toward containers, it is a natural and more straightforward career shift that a Linux system administrator needs to take in order to get up to speed as a DevOps engineer, whereas Windows system administrators aren’t exposed to all these tools and evolutions, making it a hard and drastic career shift, where you have to first learn about the Linux operating system (OS) and then the entire ecosystem around it.

The second aspect is the delusion that every .NET Framework application should be refactored to .NET (formerly .NET Core). In almost all engagements where the .NET Framework is a topic, I’ve heard developers talking about the beauty of refactoring their .NET Framework application into .NET and leveraging all the benefits available on a Linux ecosystem, such as ARM processors and the rich Linux tools ecosystem. While they are all 100% technically correct, as solution architects, we need to see the big picture, meaning the business investment behind it. We need to understand how much effort and investment of money will be required to fully refactor the application and its dependencies to move out of Windows, what will happen with the already purchased Windows Server licenses and management tools, and when the investment will break even. Sometimes, the annual IT budget will be better spent on new projects rather than refactoring 10-year-old applications, where the investment breakeven will take 5 or more years to come through, without much innovation on the application itself.

Now that we understand the most common challenges for Windows container adoption and the opportunity in front of us, we’ll dig into the Windows Server primitives for Windows containers, resource controls, and Windows base images.

How does Windows Server expose container primitives?

Containers are kernel primitives responsible for containerization, such as control groups, namespaces, union filesystems, and other OS functionalities. These work together to create process isolation provided through namespace isolation and control groups, which govern the resources of a collection of processes within a namespace.

Namespaces isolate named objects from unauthorized access. A named object provides processes to share object handles. In simple words, when a process needs to share handles, it creates a named event or mutex in the kernel; other processes can use this object name to call functions inside the process, then an object namespace creates the boundary that defines what process or container process can call the named objects.

Control groups or cgroups are a Linux kernel feature that limits and isolates how much CPU, memory, disk I/O, and network a collection of the process can consume. The collection process is the one running in the container:

Figure 1.1 – How a container runtime interacts with the Linux kernel

Figure 1.1 – How a container runtime interacts with the Linux kernel

However, when it relates to the Windows OS, this is an entirely different story; there is no cgroup, pid, net, ipc, mnt, or vfs. Instead, in the Windows world, we call them job objects (the equivalent of cgroups), object namespaces, the registry, and so on. Back in the days when Microsoft planned how they would effectively expose these low-level Windows kernel APIs so that the container runtime could easily consume them, Microsoft decided to create a new management service called the Host Compute Service (HCS). The HCS provides an abstraction to the Windows kernel APIs, making a Windows container a single API call from the container runtime to the kernel:

Figure 1.2 – How a container runtime interacts with the Windows kernel

Figure 1.2 – How a container runtime interacts with the Windows kernel

Working directly with the HCS may be difficult as it exposes a C API. To make it easier for container runtime and orchestrator developers to consume the HCS from higher-level languages such as Go and C#, Microsoft released two wrappers:

  • hcsshim is a Golang interface to launch and manage Windows containers using the HCS
  • dotnet-computevirtualization is a C# class library to launch and manage Windows containers using the HCS

Now that you understand how Windows Server exposes container primitives and how container runtimes such as Docker Engine and containerd interact with the Windows kernel, let’s delve into how Windows Server implements resource controls at the kernel level for Windows containers.

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.

Understanding Windows container base images

When building your Windows application into a Windows container, it is crucial to assess the dependencies it carries, such as Open Database Connectivity (ODBC) drivers, a Dynamic-Link Library (DLL), and additional applications. These entire packages (meaning the application plus dependencies) will dictate which Windows container image must be used.

Microsoft offers four container base images, each exposing a different Windows API set, drastically influencing the final container image size and on-disk footprint:

  • Nano Server is the smallest Windows container base image available, exposing just enough APIs to support .NET Core or other modern open source frameworks. It is a great option for sidecar containers.
  • Server Core is the most common Windows container base image available. It exposes the Windows API set to support the .NET Framework and common Windows Server features, such as IIS.
  • Server is smaller than the Windows image but has the full Windows API set. It fits, in the same use case mentioned previously, applications that require a DirectX graphics API.
  • Windows is the largest image and exposes the full Windows API set. It is usually used for applications that require a DirectX graphics API and frameworks such as DirectML or Unreal Engine. There is a very cool community project specifically for this type of workload, which can be accessed at the following link: https://unrealcontainers.com/.

Important note

The Windows image is not available for Windows Server 2022, as Server is the only option for workloads that require a full Windows API set.

Enumerating the Windows container image sizes

You have probably already heard about how big Windows container images are compared to Linux. While, technically, the differences in sizes are exorbitant, it doesn’t bring any value to the discussion since we won’t address Windows-specific needs with Linux, and vice versa. However, selecting the right Windows container base image directly affects the solution cost, especially regarding the storage usage footprint, drastically influencing the container host storage allocation.

Let’s delve into Windows container image sizes. The values in the following table are based on Windows Server 2022 container images:

Image name

Image size

Extracted on disk

Nano Server

118 MB

296 MB

Server Core

1.4 GB

4.99 GB

Windows Server

3.28 GB

10.8 GB

Table 1.1 – Windows container image sizes

As discussed in the previous section, the difference in size refers to the amount of the Windows API set exposed to the container, addressing different application needs. The Extracted on disk column is crucial information because, on AWS, one of the price compositions for the block storage called Amazon Elastic Block Storage (EBS) is the amount of space provisioned; you pay for what you provision, independent of whether it is used or not, thereby influencing the EBS volume size you will deploy on each container host.

We’ll dive deep into this topic in greater detail in Chapter 14, Implementing a Container Image Cache Strategy.

Delving into Windows container licensing on AWS

In AWS, there are two options to license Windows Server:

  • License included: You pay per second in the Amazon EC2 Windows cost. The Windows Server version is Datacenter, which gives you unlimited containers per host.
  • Bring your own license (BYOL): You bring your existing Windows Server license as long as the licenses were acquired or added as a true-up under an active Enterprise Agreement that was signed prior to October 1, 2019. This option also requires an Amazon EC2 Dedicated Host.

I recommend checking internally in your organization what Windows Server 2019 license options are available and making a decision based on how much money you can save using either BYOL or License included adoption.

Summary

In this chapter, we learned why Windows containers are an essential topic for organizations going through their modernization journey and why it may be a challenge due to a lack of expertise; then, we delved into how Windows Server exposes container primitives through the HCS and how container runtimes interact with the Windows kernel for resource controls. We also delved into the Windows container base images available, image sizing, and licensing.

In a nutshell, the use case for a Windows container is very straightforward; if it can’t be solved with Linux due to incompatibility or application dependencies/requirements, then go with Windows, period. To add more to that, in the same way that we shouldn’t use Windows containers to run a Go application, we shouldn’t even try to use a Linux container to run a .NET Framework application.

In Chapter 2, Amazon Web Services – Breadth and Depth, we will understand why AWS is the best choice for running Windows containers. You will learn how AWS Nitro improves container performance and the information you need to choose what AWS container orchestrator make sense for your use case.

Further reading

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Leverage the most recent best practices to run and manage Windows containers on AWS
  • Learn about AWS tools to containerize and run Windows containers on AWS
  • Deeper understanding on how Amazon ECS, EKS, and Fargate supports Windows containers

Description

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.

Who is this book for?

This book is targeted towards DevOps engineer, SREs, solution architects, or a Windows sysadmin who wants to learn more about running Windows containers on AWS. In order to learn from this book, you should have a basic understanding of containers, Docker, and Kubernetes. The book is also beneficial for Windows application developers who want to explore how to achieve better application scalability using containers as a compute layer.

What you will learn

  • Get acquainted with Windows container basics
  • Run and manage Windows containers on Amazon ECS, EKS, and AWS Fargate
  • Effectively monitor and centralize logs from Windows containers
  • Properly maintain Windows hosts and keep container images up to date
  • Manage ephemeral Windows hosts to reduce operational overhead
  • Work with the container image cache to speed up the container's boot time

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Apr 21, 2023
Length: 212 pages
Edition : 1st
Language : English
ISBN-13 : 9781804617199

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
OR
Modal Close icon
Payment Processing...
tick Completed

Billing Address

Product Details

Publication date : Apr 21, 2023
Length: 212 pages
Edition : 1st
Language : English
ISBN-13 : 9781804617199

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 141.97
Running Windows Containers on AWS
$41.99
Mastering Elastic Kubernetes Service on AWS
$49.99
Terraform Cookbook
$49.99
Total $ 141.97 Stars icon
Banner background image

Table of Contents

21 Chapters
Part 1: Why Windows Containers on Amazon Web Services (AWS)? Chevron down icon Chevron up icon
Chapter 1: Windows Container 101 Chevron down icon Chevron up icon
Chapter 2: Amazon Web Services – Breadth and Depth Chevron down icon Chevron up icon
Part 2: Windows Containers on Amazon Elastic Container Service (ECS) Chevron down icon Chevron up icon
Chapter 3: Amazon ECS – Overview Chevron down icon Chevron up icon
Chapter 4: Deploying a Windows Container Instance Chevron down icon Chevron up icon
Chapter 5: Deploying an EC2 Windows-Based Task Chevron down icon Chevron up icon
Chapter 6: Deploying a Fargate Windows-Based Task Chevron down icon Chevron up icon
Part 3: Windows Containers on Amazon Elastic Kubernetes Service (EKS) Chevron down icon Chevron up icon
Chapter 7: Amazon EKS – Overview Chevron down icon Chevron up icon
Chapter 8: Preparing the Cluster for OS Interoperability Chevron down icon Chevron up icon
Chapter 9: Deploying a Windows Node Group Chevron down icon Chevron up icon
Chapter 10: Managing a Windows Pod Chevron down icon Chevron up icon
Part 4: Operationalizing Windows Containers on AWS Chevron down icon Chevron up icon
Chapter 11: Monitoring and Logging Chevron down icon Chevron up icon
Chapter 12: Managing a Windows Container's Image Life Cycle Chevron down icon Chevron up icon
Chapter 13: Working with Ephemeral Hosts Chevron down icon Chevron up icon
Chapter 14: Implementing a Container Image Cache Strategy Chevron down icon Chevron up icon
Chapter 15: AWS Windows Containers Deployment Tools Chevron down icon Chevron up icon
Index Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(11 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Kenechi Jul 17, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Very detailed book on Windows containers. It is an easy guide through the journey of containerizing your workloads
Amazon Verified review Amazon
Cindy Roe Apr 25, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
"Running Windows Containers on AWS" is an essential resource for any technical expert looking to successfully modernize their legacy infrastructure by deploying and managing Windows containers on Amazon ECS, EKS, and AWS Fargate. This comprehensive guide is the first of its kind, and provides real-world scenarios and code samples.The book covers everything you need to know about container services such as caching strategy, deployment tools, monitoring and logging, and managing the container image life cycle. The author's expertise in the field is evident throughout the book, and the practical advice and real-world examples make it easy to follow and implement.What I appreciate the most about this book is that it's not just a theoretical overview. Instead, it's a practical guide that allows Solution Architects, DevOps engineers, and System Admins to align their technical approach to the tangible business outcomes of reducing cost, modernizing technical infrastructure, and improve operational efficiency.
Amazon Verified review Amazon
Niraj Kumar Jun 01, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Running Windows Containers on AWS is a comprehensive and practical guide for anyone who wants to learn how to run and manage Windows containers on Amazon's cloud platform. The book covers the basics of Windows containers, the architecture and features of Amazon ECS, EKS, and Fargate for Windows containers, and the best practices and tools for deploying, monitoring, and maintaining Windows containers on AWS.The book is well-written and easy to follow, with clear explanations, diagrams, code snippets, and screenshots. The author, Marcio Morales, is a Principal solutions architect at AWS who has extensive experience and expertise in running Windows containers on AWS. He shares his insights and tips from years of customer interactions and real-world scenarios.The book is divided into 14 chapters that cover topics such as Windows container 101, Amazon ECS overview, deploying a Windows container instance, deploying an EC2 Windows-based task, deploying a Fargate Windows-based task, Amazon EKS overview, preparing the cluster for OS interoperability, deploying a Windows node group, managing a Windows pod, monitoring and logging, managing a Windows container's image life cycle, working with ephemeral hosts, implementing a container image cache strategy, and AWS Windows containers deployment tools.The book is suitable for DevOps engineers, SREs, solution architects, or Windows sysadmins who want to learn more about running Windows containers on AWS. It is also beneficial for Windows application developers who want to explore how to achieve better application scalability using containers as a compute layer. The book assumes that the reader has a basic understanding of containers, Docker, and Kubernetes.Running Windows Containers on AWS is a valuable resource for anyone who wants to modernize their Windows applications using containers on AWS. It provides a complete guide to successfully running Windows containers on Amazon ECS, EKS, and AWS Fargate with field-proven expertise and best practices. It is a must-read for anyone who wants to leverage the power and flexibility of AWS for their Windows containers.
Amazon Verified review Amazon
Two G. May 22, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book is a great primer on running Windows Containers on AWS. It gives you not just hands on examples but also it prompts you with the fundamental questions you should ask yourself to understand what technologies you should be using. Whether you are new to containers or a containers expert, there is something in this book for everyone.
Amazon Verified review Amazon
Bpfeiff Apr 21, 2023
Full star icon Full star icon Full star icon Full star icon Full star icon 5
This book does a great job explaining and summarizing running Windows containers on AWS. Instead of focusing on high-level architecture, it dives straight into real-world examples and gives you information on how to get started with running Windows containers on AWS quickly. I enjoyed it covered EKS, ECS, and Fargate compute options as it helps with deciding on which is the best service to use for your application and organizational use case. It was also helpful that important topics like monitoring, logging, storage, and authentication are covered! If you are looking for a guide on how to run Windows containers in production on AWS, this will be a great resource to add to your ramp up!
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.