
3. Application deployment on AKS
In this chapter, we will deploy two applications on Azure Kubernetes Service (AKS). An application consists of multiple parts, and you will build the applications one step at a time while the conceptual model behind them is explained. You will be able to easily adapt the steps in this chapter to deploy any other application on AKS.
To deploy the applications and make changes to them, you will be using YAML files. YAML is the acronym for YAML Ain't Markup Language. YAML is a language that is used to create configuration files to deploy to Kubernetes. Although you can use either JSON or YAML files to deploy applications to Kubernetes, YAML is the most commonly used language to do so. YAML became popular because it is easier for a human to read when compared to JSON or XML. You will see multiple examples of YAML files throughout this chapter and throughout the book.
During the deployment of the sample guestbook application, you will see Kubernetes concepts in action. You will see how a deployment is linked to a ReplicaSet, and how that is linked to the Pods that are deployed. A Deployment is an object in Kubernetes that is used to define the desired state of an application. A deployment will create a ReplicaSet. A ReplicaSet is an object in Kubernetes that guarantees that a certain number of Pods will always be available. Hence, a ReplicaSet will create one or more Pods. A Pod is an object in Kubernetes that is a group of one or more containers. Let's revisit the relationship between Deployment, ReplicaSet, and Pods:

Figure 3.1: Relationship between a Deployment, a ReplicaSet, and Pods
While deploying the sample applications, you will use the service object to connect to the application. A service in Kubernetes is an object that is used to provide a static IP address and DNS name to an application. Since a Pod can be killed and moved to different nodes in the cluster, a service ensures you can connect to a static endpoint for your application.
You will also edit the sample applications to provide configuration details using a ConfigMap. A ConfigMap is an object that is used to provide configuration details to Pods. It allows you to keep configuration settings outside of the actual container. You can then provide these configuration details to your application by connecting the ConfigMap to your deployment.
Finally, you will be introduced to Helm. Helm is a package manager for Kubernetes that helps to streamline the deployment process. You will deploy a WordPress site using Helm and gain an understanding of the value Helm brings to Kubernetes. WordPress installation makes use of persistent storage in Kubernetes. You will learn how persistent storage in AKS is set up.
The following topics will be covered in this chapter:
- Deploying the sample guestbook application
- Full deployment of the sample guestbook application
- Using Helm to install complex Kubernetes applications
We'll begin with the sample guestbook application.