Hands-On Kubernetes on Windows
eBook - ePub

Hands-On Kubernetes on Windows

Effectively orchestrate Windows container workloads using Kubernetes

Piotr Tylenda

Share book
  1. 592 pages
  2. English
  3. ePUB (mobile friendly)
  4. Available on iOS & Android
eBook - ePub

Hands-On Kubernetes on Windows

Effectively orchestrate Windows container workloads using Kubernetes

Piotr Tylenda

Book details
Book preview
Table of contents
Citations

About This Book

Build and deploy scalable cloud applications using Windows containers and Kubernetes

Key Features

  • Run, deploy, and orchestrate containers on the Windows platform with this Kubernetes book
  • Use Microsoft SQL Server 2019 as a data store to deploy Kubernetes applications written in.NET Framework
  • Set up a Kubernetes development environment and deploy clusters with Windows Server 2019 nodes

Book Description

With the adoption of Windows containers in Kubernetes, you can now fully leverage the flexibility and robustness of the Kubernetes container orchestration system in the Windows ecosystem. This support will enable you to create new Windows applications and migrate existing ones to the cloud-native stack with the same ease as for Linux-oriented cloud applications.

This practical guide takes you through the key concepts involved in packaging Windows-distributed applications into containers and orchestrating these using Kubernetes. You'll also understand the current limitations of Windows support in Kubernetes. As you advance, you'll gain hands-on experience deploying a fully functional hybrid Linux/Windows Kubernetes cluster for development, and explore production scenarios in on-premises and cloud environments, such as Microsoft Azure Kubernetes Service.

By the end of this book, you'll be well-versed with containerization, microservices architecture, and the critical considerations for running Kubernetes in production environments successfully.

What you will learn

  • Understand containerization as a packaging format for applications
  • Create a development environment for Kubernetes on Windows
  • Grasp the key architectural concepts in Kubernetes
  • Discover the current limitations of Kubernetes on the Windows platform
  • Provision and interact with a Kubernetes cluster from a Windows machine
  • Create hybrid Windows Kubernetes clusters in on-premises and cloud environments

Who this book is for

This book is for software developers, system administrators, DevOps engineers, and architects working with Kubernetes on Windows, Windows Server 2019, and Windows containers. Knowledge of Kubernetes as well as the Linux environment will help you get the most out of this book.

Frequently asked questions

How do I cancel my subscription?
Simply head over to the account section in settings and click on ā€œCancel Subscriptionā€ - itā€™s as simple as that. After you cancel, your membership will stay active for the remainder of the time youā€™ve paid for. Learn more here.
Can/how do I download books?
At the moment all of our mobile-responsive ePub books are available to download via the app. Most of our PDFs are also available to download and we're working on making the final remaining ones downloadable now. Learn more here.
What is the difference between the pricing plans?
Both plans give you full access to the library and all of Perlegoā€™s features. The only differences are the price and subscription period: With the annual plan youā€™ll save around 30% compared to 12 months on the monthly plan.
What is Perlego?
We are an online textbook subscription service, where you can get access to an entire online library for less than the price of a single book per month. With over 1 million books across 1000+ topics, weā€™ve got you covered! Learn more here.
Do you support text-to-speech?
Look out for the read-aloud symbol on your next book to see if you can listen to it. The read-aloud tool reads text aloud for you, highlighting the text as it is being read. You can pause it, speed it up and slow it down. Learn more here.
Is Hands-On Kubernetes on Windows an online PDF/ePUB?
Yes, you can access Hands-On Kubernetes on Windows by Piotr Tylenda in PDF and/or ePUB format, as well as other popular books in Computer Science & System Administration. We have over one million books available in our catalogue for you to explore.

Information

Year
2020
ISBN
9781838825997
Edition
1

Section 1: Creating and Working with Containers

The objective of this section is to present different containerization technologies and the benefits of choosing one variant over another. You will see how to containerize an application on Windows and understand the key steps involved in creating and maintaining the images.
This section contains the following chapters:
  • Chapter 1, Creating Containers
  • Chapter 2, Managing State in Containers
  • Chapter 3, Working with Container Images

Creating Containers

The concepts of containers and OS-level virtualization have their roots in the chroot system call in Unix V7 operating systems (OSes), which date back to the late 1970s. Starting with a simple concept of process isolation and chroot jails, where the process is running in an apparently isolated root directory, containerization has undergone rapid evolution and became a mainstream technology in the 2010s with the advent of Linux Containers (LXC) and Docker. In 2014, Microsoft announced support for Docker Engine in the incoming release of Windows Server 2016. This is where the story of Windows containers and Kubernetes on Windows begins.
In this chapter, we will provide you with a better understanding of containers for the Windows OS by highlighting important differences between containerization on Linux and Windows and container runtime types on Windows, namely Windows Server Containers (or process isolation) and Hyper-V isolation. We will also learn how to install Docker Desktop for Windows 10 for development scenarios and create our first example container running on your machine.
This chapter will cover the following topics:
  • Linux versus Windows containers
  • Understanding Windows container variants
  • Installing Docker Desktop for Windows tooling
  • Building your first container

Technical requirements

The requirements for this chapter are as follows:
  • Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) technology features enabled in the BIOS
  • A minimum of 4 GB of RAM
  • Windows 10 Pro, Enterprise, or Education (version 1903 or later, 64-bit) installed
  • Visual Studio Code
For more information regarding the hardware requirements for running Docker and containers on Windows, please refer to https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/system-requirements.
Windows 10 versions starting with Anniversary Update (version 1607, build 14393) are supported, but version 1903 is recommended for the best experience since it comes with all the necessary features. For more details regarding Windows 10 versions and container runtimes compatibility, please refer to https://docs.microsoft.com/en-us/virtualization/windowscontainers/deploy-containers/version-compatibility.
Visual Studio Code can be downloaded for free from the official web page at: https://code.visualstudio.com/.
You can download the latest code samples for this chapter from this book's official GitHub repository at: https://github.com/PacktPublishing/Hands-On-Kubernetes-on-Windows/tree/master/Chapter01.

Linux versus Windows containers

Containerization on both Linux and Windows aims to achieve the same goal ā€“ creating predictable and lightweight environments that are isolated from other applications. For Linux, a classic example of container usage can be running a Python RESTful API written in Flask, without worrying about conflicts between Python modules that are required by other applications. Similarly, for Windows, the containers can be used to host an Internet Information Services (IIS) web server that's entirely isolated from other workloads running on the same machine.
Compared to traditional hardware virtualization, containerization comes at the cost of being tightly coupled with the host OS since it uses the same kernel to provide multiple isolated user spaces. This means that running Windows containers on the Linux OS or running Linux containers on the Windows OS is not possible natively without the additional help of traditional hardware virtualization techniques.
In this book, we will focus on the Docker container platform, which is required for running containers on Windows. Now, let's summarize the current state of containerization support on Linux and Windows that's provided by Docker Engine and what the possible solutions are when it comes to development and production scenarios.

Docker containerization on Linux

Originally, Docker Engine was developed primarily for the Linux OS, which provides the following kernel features for the Docker runtime:
  • Kernel namespaces: This is the core concept for containers and makes it possible to create isolated process workspaces. Namespaces partition kernel resources (such as network stacks, mount points, and so on) so that each process workspace can access its own set of resources and ensures they can't be accessed by processes from other workspaces. This is what ensures the isolation of containers.
  • Control groups: Resource usage limits and isolation is a secondary core concept in containerization. On Linux, this feature is provided by cgroups, which enables resource limiting (CPU usage, RAM usage, and so on) and priority access to resources for one process or a group of processes.
  • Layer filesystem capabilities: On Linux, UnionFS is one of the many implementations of union mount ā€“ a file system service that allows files and directories coming from separate filesystems to be unified into one transparent, coherent filesystem. This feature is crucial for Docker container images that consist of immutable layers. During the container runtime, the read-only layers are transparently overlaid together with a writable container layer.
Docker Engine is responsible for providing a basic runtime for containers, abstracting container management, and exposing functionalities using the REST API to the client layer, such as the Docker ...

Table of contents