Book Image

Hands-On Kubernetes on Windows

By : Piotr Tylenda
Book Image

Hands-On Kubernetes on Windows

By: Piotr Tylenda

Overview of this book

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.
Table of Contents (23 chapters)
1
Section 1: Creating and Working with Containers
5
Section 2: Understanding Kubernetes Fundamentals
9
Section 3: Creating Windows Kubernetes Clusters
12
Section 4: Orchestrating Windows Containers Using Kubernetes

What this book covers

Chapter 1, Creating Containers, describes different container types that are currently used, in particular, across the Linux and Windows operating systems. The main objective of this chapter is demonstrating how to build a sample Windows container, run it, and perform basic operations.

Chapter 2, Managing State in Containers, discusses the possible approaches for managing and persisting state in containerized applications and explains how to mount local and cloud storage volumes (Azure Files SMB share) on containers in order to run clustered database engines such as MongoDB using Windows containers.

Chapter 3, Working with Container Images, focuses on container images, which are the standard way of distributing containerized applications. The objective of this chapter is to demonstrate how to use Docker Hub and Azure Container Registry and how to deliver container images safely in deployment pipelines.

Chapter 4, Kubernetes Concepts and Windows Support, familiarizes you with core Kubernetes services such as kubelet, kube-proxy, and kube-apiserver, as well as the most commonly used Kubernetes objects, such as Pod, Service, Deployment, and DaemonSet. You will learn why Windows support in Kubernetes is important and what the current limitations are as regards Windows containers and Windows nodes. We will also focus on creating simple development Kubernetes clusters for different use cases.

Chapter 5, Kubernetes Networking, describes the networking model of Kubernetes and available Pod network solutions. You will learn how to choose the most suitable networking mode for Kubernetes clusters with Windows nodes.

Chapter 6, Interacting with Kubernetes Clusters, shows how to interact and access Kubernetes clusters from a Windows machine using kubectl. As an example, we will show how to work with local development clusters and what the most common and useful kubectl commands are.

Chapter 7, Deploying Hybrid On-Premises Kubernetes Clusters, demonstrates how to approach the provisioning of VMs and the deployment of hybrid Windows/Linux Kubernetes clusters with Linux master/nodes and Windows nodes. On-premises deployment is the most universal type of deployment as it can be performed using any cloud service provider or in a private data center.

Chapter 8, Deploying Hybrid Azure Kubernetes Service Engine Clusters, provides an overview of how to approach the deployment of a hybrid Windows/Linux Kubernetes cluster using AKS Engine and demonstrates an example deployment of a sample Microsoft IIS application.

Chapter 9, Deploying Your First Application, demonstrates how to deploy a simple web application to Kubernetes imperatively and declaratively and discusses the recommended way to manage applications running in Kubernetes. We will also cover scheduling Pods on Windows nodes exclusively and how to scale Windows applications running on Kubernetes.

Chapter 10, Deploying a Microsoft SQL Server 2019 and ASP.NET MVC Application, describes how to deploy a sample voting application implemented in ASP.NET MVC (running in Windows containers) to an AKS Engine cluster, together with Microsoft SQL Server 2019 (running in Linux containers). You will also learn how you can debug .NET applications running in Kubernetes using Visual Studio Remote Debugger.

Chapter 11, Configuring Applications to Use Kubernetes Features, describes how to implement and configure more advanced features of Kubernetes, including namespaces, ConfigMaps and Secrets, persistent storage, health and readiness checking, autoscaling, and rolling deployments. This chapter also shows how role-based access control (RBAC) works in Kubernetes.

Chapter 12, Development Workflow with Kubernetes, shows how to use Kubernetes as a platform for microservices development. You will learn how to package applications using Helm and how to improve your development experience using Azure Dev Spaces. Additionally, the chapter describes how to use Azure Application Insights and Snapshot Debugger for your containerized application running in Kubernetes.

Chapter 13, Securing Kubernetes Clusters and Applications, covers the security of Kubernetes clusters and containerized applications. We will discuss the general recommended security practices for Kubernetes and Windows-specific considerations.

Chapter 14, Monitoring Kubernetes Applications Using Prometheus, focuses on how to approach the monitoring of Kubernetes clusters, especially Windows nodes and .NET applications running on Windows nodes. You will learn how to deploy a full monitoring solution using a Prometheus Helm chart and how to configure it to monitor your applications.

Chapter 15, Disaster Recovery, discusses backing up a Kubernetes cluster and disaster recovery strategies. The main focus is to show what components require backups in order to restore the cluster safely and how to automate this process.

Chapter 16, Production Considerations for Running Kubernetes, is a set of general recommendations for running Kubernetes in production environments.