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

Deploying WordPress

The following are the steps to deploy WordPress:

  1. Run the following command to install WordPress:
    kubectl create ns wordpress
    helm install wp azure/wordpress --namespace wordpress --set replicaCount=1 --set externalDatabase.azure.location=<your Azure region>
  2. To verify the status of the WordPress Pod, run the following command:
    kubectl get pods -n wordpress

    This should show the status of a single WordPress Pod as displayed in Figure 8.8. In our previous WordPress examples, we always had two Pods running, but we were able to offload the database functionality to Azure here:

    This image shows that the wordpress deployment only creates a single pod. You will see the name of the pod and whetherit is in the Ready state. It also shows the status ofContainerCreating, the number of times it restarted, and the time taken to obtain this status.
    Figure 8.8: Output displaying only one WordPress Pod and no database on our cluster
  3. While the WordPress Pod is being created, we can check on the status of the database as well. We can use two tools to get this status, either svcat or kubectl:
    ./svcat get instances -n wordpress

    This will generate the output shown in Figure 8.9:

    Using the ./svcat get instances -n wordpress command you can get your MySQL instance. You will see the name, namespace, class, plan, and status.
    Figure 8.9: Output displaying the use of svcat to get...