0%

Book Description

Efficiently deploy and manage Kubernetes clusters on a cloud

Key Features

  • Deploy highly scalable applications with Kubernetes on Azure
  • Leverage AKS to deploy, manage, and operations of Kubernetes
  • Gain best practices from this guide to increase efficiency of container orchestration service on Cloud

Book Description

Microsoft is now one of the most significant contributors to Kubernetes open source projects. Kubernetes helps to create, configure, and manage a cluster of virtual machines that are preconfigured to run containerized applications.

This book will be your resource for achieving successful container orchestration and deployment of Kubernetes clusters on Azure. You will learn how to deploy and manage highly scalable applications, along with how to set up a production-ready Kubernetes cluster on Azure. With this book, you will be able to reduce the complexity and operational overheads of managing a Kubernetes cluster on Azure.

By the end of this book, you will not only be capable of deploying and managing Kubernetes clusters on Azure with ease, but also have the knowledge of industry best practices to work with advanced Azure Kubernetes Services (AKS) concepts for complex systems.

What you will learn

  • Get to grips with Microsoft AKS deployment, management, and operations
  • Learn about the benefits of using Microsoft AKS, as well as the limitations, and avoid potential problems
  • Integrate Microsoft toolchains such as Visual Studio Code, and Git
  • Implement simple and advanced AKS solutions
  • Implement the automated scalability and high reliability of secure deployments with Microsoft AKS
  • Use kubectl commands to monitor applications

Who this book is for

If you're a cloud engineer, cloud solution provider, sysadmin, site reliability engineer, or a developer interested in DevOps and are looking for an extensive guide to running Kubernetes in the Azure environment then, this book is for you.

Though any previous knowledge of Kubernetes is not expected, some experience with Linux and Docker containers would be beneficial.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Hands-On Kubernetes on Azure
  3. Dedication
  4. About Packt
    1. Why subscribe?
    2. Packt.com
  5. Contributors
    1. About the authors
    2. About the reviewer
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Conventions used
    4. Get in touch
      1. Reviews
  7. Section 1: The Basics
  8. Introduction to Docker and Kubernetes
    1. Technical requirements
    2. The foundational technologies that enable AKS
      1. You build it, you run it
      2. Everything is a file
      3. Orchestration
    3. Summary
  9. Kubernetes on Azure (AKS)
    1. Technical requirements
    2. Entering the Azure portal
      1. Creating an Azure portal account
    3. Navigating the Azure portal
      1. Creating your first AKS
      2. Using Azure Cloud Shell
    4. Summary
  10. Section 2: Deploying on AKS
  11. Application Deployment on AKS
    1. Technical requirements
    2. Deploying the sample guestbook application
      1. Introducing the application
      2. Deploying the first master
        1. Examining the deployment
      3. Redis master
    3. Fully deploying of the sample guestbook application
      1. Exposing the Redis master service
      2. Deploying the Redis slaves
      3. Deploying and exposing the frontend
        1. Exposing the frontend service
      4. The guestbook application in action
    4. The helm way of installing complex applications
      1. The helm init command
      2. Installing WordPress
        1. Persistent Volume Claims
        2. Your own WordPress site
    5. Summary
  12. Scaling Your Application to Thousands of Deployments
    1. Technical requirements
    2. Scaling your application
      1. Implementing independent scaling
      2. Scaling the guestbook frontend component
    3. Handling failure in AKS
      1. Node failures
      2. Diagnosing out-of-resource errors
        1. Reducing the number of replicas to the bare minimum
        2. Reducing CPU requirements
        3. Cleanup of the guestbook deployment
      3. Fixing storage mount issues
        1. Starting the WordPress install
        2. Persistent volumes
        3. Handling node failure with PVC involvement
    4. Upgrading your application
      1. kubectl edit
      2. Helm upgrade
    5. Summary
  13. Single Sign-On with Azure AD
    1. Technical requirements
    2. HTTPS support
      1. Installing Ingress
      2. Launching the Guestbook application
      3. Adding Lets Ingress
      4. Adding LetsEncrypt
        1. Installing the certificate manager
        2. Mapping the Azure FQDN to the nginx ingress public IP
        3. Installing the certificate issuer
        4. Creating the SSL certificate
        5. Securing the frontend service connection
    3. Authentication versus authorization 
      1. Authentication and common authN providers
    4. Deploying the oauth2_proxy side car
    5. Summary
  14. Monitoring the AKS Cluster and the Application
    1. Technical requirements
    2. Commands for monitoring applications
      1. kubectl get command
      2. kubectl describe command
    3. Debugging applications
      1. Image Pull errors
      2. Application errors
        1. Scaling down the frontend
        2. Introducing an app "error"
        3. Logs
    4. Metrics reported by Kubernetes
      1. Node status and consumption
    5. Metrics reported from OMS
      1. AKS Insights
        1. Cluster metrics
        2. Container metrics, logs, and environmental variables
      2. Logs
    6. Summary
  15. Operation and Maintenance of AKS Applications
    1. Technical requirements
    2. Service roles in Kubernetes
      1. Deleting any AKS cluster without RBAC
      2. Creating an AKS cluster with the Azure AD RBAC support
        1. Creating the Azure AD server application
          1. Setting the permissions for the application to access user info
          2. Granting the permissions and noting the application ID
        2. Creating the client application
        3. Getting the AAD tenant ID
        4. Deploying the cluster
    3. Attaching service roles to AAD users
      1. Creating users in your Active Directory
        1. Creating a read-only group and adding the user to it
    4. Verifying RBAC
      1. Creating the read-only user role
        1. Creating the cluster-wide, read-only role
        2. Binding the role to the AAD group
      2. The access test
    5. Summary
  16. Section 3: Leveraging Advanced Azure PaaS Services in Combination with AKS
  17. Connecting an App to an Azure Database - Authorization
    1. Technical requirements
    2. Extending an app to connect to an Azure Database
      1. WordPress backed by Azure MySQL
        1. Prerequisites
          1. Helm with RBAC
          2. Deploying the service catalog on the cluster
          3. Deploying Open Service Broker for Azure
          4. Deploying WordPress
      2. Securing MySQL
      3. Running the WordPress sample with MySQL Database
    3. Restoring from backup
      1. Performing a restore
      2. Connecting WordPress to the restored database
        1. Modifying the host setting in WordPress deployment
    4. Reviewing audit logs
      1. Azure Database audits
    5. DR options
      1. Azure SQL HADR options
    6. Summary
  18. Connecting to Other Azure Services (Event Hub)
    1. Technical requirements
    2. Introducing to microservices
      1. Microservices are no free lunch
      2. Kubernetes and microservices
    3. Deploying a set of microservices
      1. Deploying Helm
    4. Using Azure Event Hubs
      1. Creating the Azure Event Hub
      2. Updating the Helm files
    5. Summary
  19. Securing AKS Network Connections
    1. Technical requirements
    2. Setting up secrets management
      1. Creating your own secrets
        1. Creating secrets from files
        2. Creating secrets manually using files
        3. Creating generic secrets using literals
        4. Creating the Docker registry key
        5. Creating the tls secret
      2. Using your secrets
        1. Secrets as environment variables
        2. Secrets as files
    3. The Istio service mesh at your service
      1. Installing Istio
      2. Injecting Istio as a sidecar automatically
      3. Enforcing mutual TLS
        1. Deploying sample services
        2. Globally enabling mutual TLS
    4. Summary
  20. Serverless Functions
    1. Technical requirements
    2. Kubeless services
      1. Installing Kubeless
        1. Install Kubeless binary
      2. The hello world serverless function
    3. Events and serverless functions
      1. Creating and configuring Azure Functions
      2. Integrating Kubeless with Azure Event Hubs via Azure Functions
    4. Summary
  21. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think