This contains my demo for the MLSA Azure Episodes.
In the demo, I will walk through the following:
- creating a docker image,
- pushing the image to Azure Container Registry
- deploying the image to Azure Kubernetes serices.
- Test the app locally
$ python main.py
- Create a Docker image
$ docker login
$ docker build -t hub-username/image-name .
- Push the image to Azure Container Registry
$ az group create --name myResourceGroup --location eastus
$ az acr create --resource-group myResourceGroup --name <acrName> --sku Basic
$ az acr login --name <acrName>
$ docker tag docker-image:tag <acrLoginServer>/image-name:tag
$ docker images
$ docker push <acrLoginServer>/image-name:tag
- Get your image name and tag
$ az acr repository list --name <ACRname>
$ az acr repository show-tags --name <ACRname> --repository <repo> --output table
$ az aks install-cli
$ az account set --subscription xxxx-xxx-xx-xx-xxxx
$ az aks get-credentials --resource-group myResourceGroup --name myAKSCluster
$ kubectl get nodes
- Create a K8s cluster and deployment files.
$ kubectl apply -f aks/demo-ip.yml
$ kubectl apply -f aks/demo-service.yml
$ kubectl get service
Navigate to the IP provided under External-IP
$ kubectl get pods
$ kubectl get logs <pod-name>
$ kubectl describe pod <pod-name>
$ kubectl describe service <service-name>
$ kubectl describe deployment <deployment>
$ az group delete --name myResourceGroup --yes --no-wait