# Kubernetes on Azure (AKS) – Only Demo Purposes

Whether you're a student, developer, or DevOps engineer preparing for a demo, this guide walks you through setting up **AKS for demo purposes** quickly and efficiently.

Let’s get started!

## Prerequisites

* An Azure Account: [Sign up here](https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account?icid=azurefreeaccount)
    
* Azure CLI: [Install Guide](https://learn.microsoft.com/en-us/cli/azure/install-azure-cli?view=azure-cli-latest)
    
* kubectl: [Install Guide](https://kubernetes.io/docs/tasks/tools/)
    

## Creating Kubernetes cluster

Visit [Azure portal](https://portal.azure.com) and log in with your Azure account. On the top search bar, type `Kubernetes services` and select it. Click the **"+ Create"** button and choose **"Create Kubernetes cluster"**.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747640374703/fa534d75-1330-4fad-8e70-aa731d59e467.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747640491940/90b4e3b3-7508-459e-9d23-05034b880283.png align="center")

**Configure the basic settings** according to your needs. The image below shows an example configuration for demo purposes only.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747640609585/6b2325d6-1c53-4929-8e32-3889c7615840.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747640755673/6e7daa9f-ac67-444c-893c-f5e6c388e86e.png align="center")

Once your AKS cluster is ready, follow the **connection instructions** provided under the **"Connect"** section in the Azure Portal to configure `kubectl` access.

> *Note: In the screenshot, I skipped the* `az login` step because I was already logged in.

```plaintext
az login
az account set --subcription <subcription-id>
az aks get-credentials --resource-group <resource-group-name> --name <k8s-cluster-name> --overwrite-existing
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747641150380/29af36df-c619-4bf2-bcd7-de2cc4c98b15.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747641164041/1fca005b-ca15-4e86-9ae8-84779825fb4c.png align="center")

To verify your connection to the cluster, run:

```plaintext
kubectl get svc
```

You should see the default Kubernetes services listed, confirming the connection.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747641283368/b687015f-2570-42fd-97bc-389256a09449.png align="center")

Below is the **architecture**, along with the **deployment** and **service** configuration files used in this demo.

> **Disclaimer:** These files are originally created by **KodeKloud**. I'm using them solely for demonstration purposes. You can fork the original files from their [public repository](https://github.com/kodekloudhub/example-voting-app/tree/master/k8s-specifications).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747641457830/39b7bb04-2a5e-4560-ab73-c37e95e8e0e7.png align="center")

I made a small modification:  
Changed the **service type** to `LoadBalancer` for both `vote-service` and `result-service` (the frontends) to allow external access.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747641571211/72a2c03b-1a77-4a5e-b934-715205eac341.png align="center")

## Let’s Deploy

As you can see in the screenshot, I have these manifest files (`vote-deployment.yaml`, `vote-service.yaml`, `result-deployment.yaml`, `result-service.yaml`, `db-deployment.yaml`, `db-service.yaml`, `redis-deployment.yaml`, `redis-service.yaml`, `worker-deployment.yaml`).

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642362571/03cb2aa0-ee46-4845-8054-127fdd343199.png align="center")

To deploy the applications to your AKS cluster, use the `kubectl apply` command, specifying the `-f` flag followed by the name of each manifest file:

```plaintext
kubectl apply -f vote-deployment.yaml
kubectl apply -f vote-service.yaml
kubectl apply -f result-deployment.yaml
kubectl apply -f result-service.yaml
kubectl apply -f db-deployment.yaml
kubectl apply -f db-service.yaml
kubectl apply -f redis-deployment.yaml
kubectl apply -f redis-service.yaml
kubectl apply -f worker-deployment.yaml
```

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642176591/7e2373b7-49b3-49a4-9fda-490ddb64826c.png align="center")

As shown in the screenshot, each `kubectl apply` command will create the corresponding deployment and service in your AKS cluster.

To verify that the deployments and services have been created successfully, you can use the `kubectl get deployments,svc` command:

```plaintext
kubectl get deployments,svc
```

The output, as seen in the screenshot, will display the list of deployments and services along with their current status, the number of ready replicas, their age, and for services, their type, cluster IP, external IP, and exposed ports.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642240530/89763829-f587-4fb7-be23-adf429c964f1.png align="center")

Similarly, the services (`service/vote`, `service/result`, `service/db`, `service/redis`) will be listed with their respective details in Azure portal. Notice that the `vote` and `result` services are of type `LoadBalancer`, which means Azure Kubernetes Service has provisioned external load balancers to make these applications accessible from outside the cluster. You can see their external IPs listed in the "EXTERNAL-IP" column.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642732938/0f265a81-3280-46b0-a579-952335957fc5.png align="center")

You can now access the voting application and the results application using the external IPs provided for the `vote` and `result` services, respectively, in your web browser.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642792327/8ba7a62b-2d40-4c0a-82fc-52632af2a18e.png align="center")

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642800183/48b817af-03f1-4f93-8951-c2b2b34b1664.png align="center")

Congratulations! You have successfully deployed a multi-tier application to your Azure Kubernetes Service cluster using `kubectl`. This demonstrates the basic steps involved in deploying and managing applications on AKS.

> Don’t forget to delete the resources to avoid extra charges.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1747642982506/efc533d1-db32-4271-8148-77b8c567df56.png align="center")

**Thanks for reading!**
