Book Image

Hands-On Kubernetes on Azure - Second Edition

By : Nills Franssens, Shivakumar Gopalakrishnan, Gunther Lenz
Book Image

Hands-On Kubernetes on Azure - Second Edition

By: Nills Franssens, Shivakumar Gopalakrishnan, Gunther Lenz

Overview of this book

From managing versioning efficiently to improving security and portability, technologies such as Kubernetes and Docker have greatly helped cloud deployments and application development. Starting with an introduction to Docker, Kubernetes, and Azure Kubernetes Service (AKS), this book will guide you through deploying an AKS cluster in different ways. You’ll then explore the Azure portal by deploying a sample guestbook application on AKS and installing complex Kubernetes apps using Helm. With the help of real-world examples, you'll also get to grips with scaling your application and cluster. As you advance, you'll understand how to overcome common challenges in AKS and secure your application with HTTPS and Azure AD (Active Directory). Finally, you’ll explore serverless functions such as HTTP triggered Azure functions and queue triggered functions. By the end of this Kubernetes book, you’ll be well-versed with the fundamentals of Azure Kubernetes Service and be able to deploy containerized workloads on Microsoft Azure with minimal management overhead.
Table of Contents (16 chapters)
1
Section 1: The Basics
4
Section 2: Deploying on AKS
10
Section 3: Leveraging advanced Azure PaaS services
15
Index

Handling node failures

Intentionally (to save costs) or unintentionally, nodes can go down. When that happens, you don't want to get the proverbial 3 a.m. call that your system is down. Kubernetes can handle moving workloads on failed nodes automatically for you instead. In this exercise, we are going to deploy the guestbook application and are going to bring a node down in our cluster and see what Kubernetes does in response:

  1. Ensure that your cluster has at least two nodes:
    kubectl get nodes

    This should generate an output as shown in Figure 5.1:

    Executing the kubectl get nodes command displays an output withtwo nodes. The status of these two nodes is Ready.
    Figure 5.1: Ensure you have two nodes running in your cluster

    If you don't have two nodes in your cluster, look for your cluster in the Azure portal, navigate to Node pools, and click on Node count. You can scale this to 2 nodes as shown in Figure 5.2:

    Click on the Node pools tab in the Navigation pane located on the left side of the Azure portal. This will open show you several options. Go to the Node count option. Click on it to scale this count to two nodes.
    Figure 5.2: Scaling the cluster
  2. As an example application in this chapter, we will work with the guestbook application. The YAML file to deploy this has been provided in the...