Deploy an application

Kubernetes manifest

We will deploy our sample application using a Kubernetes manifest file. A sample file named azure-vote.yaml is provided for your convenience in the repository. The manifest includes two Kubernetes deployments: one for a sample Azure Vote Python application and the other for a Redis instance. Two Kubernetes services are also created: one is an internal service for the Redis instance and the other is an external service to allow access to the application from the internet.
If you have cloned the repository and are working from the local directory, run the following command to deploy the application from the YAML manifest:
1
kubectl apply -f kube-manifests/azure-vote.yaml
Copied!
If successful, you should see output similar to the following:
1
deployment "azure-vote-back" created
2
service "azure-vote-back" created
3
deployment "azure-vote-front" created
4
service "azure-vote-front" created
Copied!

Test the application

We will invoke the kubectl get service from our CLI with the --watch argument to monitor the application deployment and obtain the EXTERNAL-IP of the LoadBalancer.
Run the following command:
1
kubectl get service azure-vote-front --watch
Copied!
While the application is deploying you may see output similar to the following:
1
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
2
azure-vote-front LoadBalancer 10.0.37.27 <pending> 80:30572/TCP 6s
Copied!
Note that EXTERNAL-IP displays a status of pending. Wait until this displays a valid public IP address then copy and paste this value into your web browser.
Your browser should resolve and display the following:
Last modified 2d ago
Export as PDF
Copy link
Edit on GitHub