Hands-On Kubernetes on Azure - Second Edition

Book description

Kick-start your DevOps career by learning how to effectively deploy Kubernetes on Azure in an easy, comprehensive, and fun way with hands-on coding tasks

Key Features

  • Understand the fundamentals of Docker and Kubernetes
  • Learn to implement microservices architecture using the Kubernetes platform
  • Discover how you can scale your application workloads in Azure Kubernetes Service (AKS)

Book Description

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.

What you will learn

  • Plan, configure, and run containerized applications in production
  • Use Docker to build apps in containers and deploy them on Kubernetes
  • Improve the configuration and deployment of apps on the Azure Cloud
  • Store your container images securely with Azure Container Registry
  • Install complex Kubernetes applications using Helm
  • Integrate Kubernetes with multiple Azure PaaS services, such as databases, Event Hubs and Functions.

Who this book is for

This book is for aspiring DevOps professionals, system administrators, developers, and site reliability engineers looking to understand test and deployment processes and improve their efficiency. If you're new to working with containers and orchestration, you'll find this book useful.

Publisher resources

Download Example Code

Table of contents

  1. Preface
    1. About Hands-On Kubernetes on Azure, Second Edition
      1. About the authors
      2. Learning Objectives
      3. Audience
      4. Approach
      5. Software Requirements
      6. Conventions
      7. Download Resources
  2. Section 1: The Basics
  3. 1. Introduction to Docker and Kubernetes
    1. The software evolution that brought us here
      1. Microservices
      2. DevOps
    2. Fundamentals of Docker containers
      1. Docker images
    3. Kubernetes as a container orchestration platform
      1. Pods in Kubernetes
      2. Deployments in Kubernetes
      3. Services in Kubernetes
    4. Azure Kubernetes Service
    5. Summary
  4. 2. Kubernetes on Azure (AKS)
    1. Different ways to deploy an AKS cluster
    2. Getting started with the Azure portal
      1. Creating your first AKS cluster
      2. A quick overview of your cluster in the Azure portal
      3. Accessing your cluster using Azure Cloud Shell
      4. Deploying your first demo application
    3. Summary
  5. Section 2: Deploying on AKS
  6. 3. Application deployment on AKS
    1. Deploying the sample guestbook application
      1. Introducing the application
      2. Deploying the Redis master
      3. Redis master with a ConfigMap
    2. Complete deployment of the sample guestbook application
      1. Exposing the Redis master service
      2. Deploying the Redis slaves
      3. Deploying and exposing the front end
      4. The guestbook application in action
    3. Installing complex Kubernetes applications using Helm
      1. Installing WordPress using Helm
    4. Summary
  7. 4. Building scalable applications
    1. Scaling your application
      1. Implementing scaling of your application
      2. Scaling the guestbook front-end component
      3. Using the HPA
    2. Scaling your cluster
      1. Manually scaling your cluster
      2. Scaling your cluster using the cluster autoscaler
    3. Upgrading your application
      1. Upgrading by changing YAML files
      2. Upgrading an application using kubectl edit
      3. Upgrading an application using kubectl patch
      4. Upgrading applications using Helm
    4. Summary
  8. 5. Handling common failures in AKS
    1. Handling node failures
    2. Solving out-of-resource failures
    3. Fixing storage mount issues
      1. Starting the WordPress installation
      2. Using persistent volumes to avoid data loss
    4. Summary
  9. 6. Securing your application with HTTPS and Azure AD
    1. HTTPS support
      1. Installing an Ingress controller
      2. Adding an Ingress rule for the guestbook application
      3. Getting a certificate from Let's Encrypt
    2. Authentication versus authorization
      1. Authentication and common authN providers
      2. Deploying the oauth2_proxy proxy
    3. Summary
  10. 7. Monitoring the AKS cluster and the application
    1. Commands for monitoring applications
      1. The kubectl get command
      2. The kubectl describe command
      3. Debugging applications
      4. Logs
    2. Readiness and liveness probes
      1. Building two web containers
      2. Experimenting with liveness and readiness probes
    3. Metrics reported by Kubernetes
      1. Node status and consumption
      2. Pod consumption
    4. Metrics reported from Azure Monitor
      1. AKS Insights
    5. Summary
  11. Section 3: Leveraging advanced Azure PaaS services
  12. 8. Connecting an app to an Azure database
    1. Setting up OSBA
      1. The benefits of using a managed database service
      2. What is OSBA?
      3. Installing OSBA on the cluster
      4. Deploying OSBA
    2. Deploying WordPress
      1. Securing MySQL
      2. Connecting to the WordPress site
    3. Exploring advanced database operations
      1. Restoring from a backup
      2. Disaster Recovery (DR) options
      3. Reviewing audit logs
    4. Summary
  13. 9. Connecting to Azure Event Hubs
    1. Deploying a set of microservices
      1. Deploying the application using Helm
    2. Using Azure Event Hubs
      1. Creating the event hub
      2. Modifying the Helm files
    3. Summary
  14. 10. Securing your AKS cluster
    1. Role-based access control
      1. Creating a new cluster with Azure AD integration
      2. Creating users and groups in Azure AD
      3. Configuring RBAC in AKS
      4. Verifying RBAC
    2. Setting up secrets management
      1. Creating your own secrets
      2. Creating the Docker registry key
      3. Creating the TLS secret
      4. Using your secrets
      5. Secrets as environment variables
      6. Secrets as files
      7. Why secrets as files is the best method
    3. Using secrets stored in Key Vault
      1. Creating a Key Vault
      2. Setting up Key Vault FlexVolume
      3. Using Key Vault FlexVolume to mount a secret in a Pod
    4. The Istio service mesh at your service
      1. Describing the Istio service mesh
      2. Installing Istio
      3. Injecting Envoy as a sidecar automatically
      4. Enforcing mutual TLS
      5. Globally enabling mTLS
    5. Summary
  15. 11. Serverless functions
    1. Multiple functions platforms
    2. Setting up prerequisites
      1. Azure Container Registry
      2. Creating a development machine
    3. Creating an HTTP-triggered Azure function
    4. Creating a queue-triggered function
      1. Creating a queue
      2. Creating a queue-triggered function
      3. Scale testing functions
    5. Summary
  16. Index

Product information

  • Title: Hands-On Kubernetes on Azure - Second Edition
  • Author(s): Nills Franssens, Shivakumar Gopalakrishnan, Gunther Lenz
  • Release date: May 2020
  • Publisher(s): Packt Publishing
  • ISBN: 9781800209671