Following my previous articles about Azure Kubernetes Cluster (AKS) today, I will show you how I deploy a web application to AKS using a .YAML file.
About AKS
Released a few weeks ago and currently, in public preview, AKS offers a managed Kubernetes cluster that can be scaled up and on-demand without needing to configure Containers, host, storage networks, etc.
Requirements
To get the Web App running in AKS you will a running AKS cluster with minimum one Node.
For setup instructions visit my article about Deploying AKS in Azure.
Get Started
In this post, I will be using the Kubernetes Web UI (Dashboard) which comes with AKS to deploy the application and below I will connect to my AKS dashboard.
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli1.png)
Once connected to the Dashboard I will click on create
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli2.png)
In the create from text Input screen, I will paste my .YAML file content (the file is a basic voting app released by Microsoft)
kind: Deployment
metadata:
apiVersion: apps/v1beta1
name: azure-vote-back
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-back
spec:
containers:
– name: azure-vote-back
image: redis
ports:
– containerPort: 6379
name: redis
—
apiVersion: v1
kind: Service
metadata:
name: azure-vote-back
spec:
ports:
– port: 6379
selector:
app: azure-vote-back
—
apiVersion: apps/v1beta1
kind: Deployment
metadata:
name: azure-vote-front
spec:
replicas: 1
template:
metadata:
labels:
app: azure-vote-front
spec:
containers:
– name: azure-vote-front
image: microsoft/azure-vote-front:v1
ports:
– containerPort: 80
env:
– name: REDIS
value: “azure-vote-back”
—
apiVersion: v1
kind: Service
metadata:
name: azure-vote-front
spec:
type: LoadBalancer
ports:
– port: 80
selector:
app: azure-vote-front
Once the file was paste I will click on Upload
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli3.png)
Once deployed AKS will deploy the application to the Cluster
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli4.png)
Access the application
To access the application I will click on the Services button and I will see my application (Azure-vote-front) and a direct IP address to it.
All I need to do now is click on the link and see if the app is working.
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli5.png)
As you can see the link is working and the MS Azure Voting app is live
![](https://ntweekly-3e2e1f4957bdf35452c0-endpoint.azureedge.net/blobntweekly18036ad1fb/wp-content/uploads/2019/09/092019_0612_DeployAppli6.png)
You can download the entire Azure voting app from Github