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
kubectl apply -f kube-manifests/azure-vote.yaml
If successful, you should see output similar to the following:
deployment "azure-vote-back" createdservice "azure-vote-back" createddeployment "azure-vote-front" createdservice "azure-vote-front" created
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
Run the following command:
kubectl get service azure-vote-front --watch
While the application is deploying you may see output similar to the following:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGEazure-vote-front LoadBalancer 10.0.37.27 <pending> 80:30572/TCP 6s
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: