Hands-On Kubernetes on Windows
eBook - ePub

Hands-On Kubernetes on Windows

Effectively orchestrate Windows container workloads using Kubernetes

  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

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.

Tools to learn more effectively

Saving Books

Saving Books

Keyword Search

Keyword Search

Annotating Text

Annotating Text

Listen to it instead

Listen to it instead

Information

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

  1. Title Page
  2. Copyright and Credits
  3. About Packt
  4. Contributors
  5. Preface
  6. Section 1: Creating and Working with Containers
  7. Creating Containers
  8. Managing State in Containers
  9. Working with Container Images
  10. Section 2: Understanding Kubernetes Fundamentals
  11. Kubernetes Concepts and Windows Support
  12. Kubernetes Networking
  13. Interacting with Kubernetes Clusters
  14. Section 3: Creating Windows Kubernetes Clusters
  15. Deploying a Hybrid On-Premises Kubernetes Cluster
  16. Deploying a Hybrid Azure Kubernetes Service Engine Cluster
  17. Section 4: Orchestrating Windows Containers Using Kubernetes
  18. Deploying Your First Application
  19. Deploying Microsoft SQL Server 2019 and a ASP.NET MVC Application
  20. Configuring Applications to Use Kubernetes Features
  21. Development Workflow with Kubernetes
  22. Securing Kubernetes Clusters and Applications
  23. Monitoring Kubernetes Applications Using Prometheus
  24. Disaster Recovery
  25. Production Considerations for Running Kubernetes
  26. Assessments
  27. Other Books You May Enjoy

Frequently asked questions

Yes, you can cancel anytime from the Subscription tab in your account settings on the Perlego website. Your subscription will stay active until the end of your current billing period. Learn how to cancel your subscription
No, books cannot be downloaded as external files, such as PDFs, for use outside of Perlego. However, you can download books within the Perlego app for offline reading on mobile or tablet. Learn how to download books offline
Perlego offers two plans: Essential and Complete
  • Essential is ideal for learners and professionals who enjoy exploring a wide range of subjects. Access the Essential Library with 800,000+ trusted titles and best-sellers across business, personal growth, and the humanities. Includes unlimited reading time and Standard Read Aloud voice.
  • Complete: Perfect for advanced learners and researchers needing full, unrestricted access. Unlock 1.4M+ books across hundreds of subjects, including academic and specialized titles. The Complete Plan also includes advanced features like Premium Read Aloud and Research Assistant.
Both plans are available with monthly, semester, or annual billing cycles.
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 990+ topics, we’ve got you covered! Learn about our mission
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 about Read Aloud
Yes! You can use the Perlego app on both iOS and Android devices to read anytime, anywhere — even offline. Perfect for commutes or when you’re on the go.
Please note we cannot support devices running on iOS 13 and Android 7 or earlier. Learn more about using the app
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 & Operating Systems. We have over one million books available in our catalogue for you to explore.