- Development Environment Setup
- Containerize the application
- Deploy the application to local Kubernetes Cluster
- Push the image to Azure Container Registry using the Azure CLI
- Create AKS cluster using the Azure CLI
- Deploy the application to AKS Cluster using .yml file
- Scale the application and Kubernetes infrastructure
- Update the application then push the image to ACR and update deployment
Development Environment Setup
- Install Docker
- Enable Kubernetes Cluster on Docker, under Docker -> Settings
- Install Azure CLI and Azure PowerShell modules
Containerize the application
- Clone this repo to a folder
- Open a command prompt and navigate to your project folder.
- Use the following commands to build and run your Docker image:
- View the .Net Core application running from a container by navigating to localhost:8000
Deploy the application to local Kubernetes Cluster
-
Deploy docker image to Kubernetes
-
kubectl
command- to verify the deployment:
kubectl get deployments
- to verify the replicasets:
kubectl get rs
- to verify the Pods:
kubectl get pods
- to verify the deployment:
- Expose the application to outside world, use the following command
- Verify the service
-
Finally access the app using browser: http://localhost:31057
Push the image to Azure Container Registry using the Azure CLI
- Login to Azure
- Create Azure Resource Group
- Create Azure Container Registry
-
- Verify the Azure Container Registry
- Verify the Azure Container Registry
- Push the image to Azure Container Registry
- Login to Azure Container Registry
-
- Tag the docker image prior to push the image to Azure Container Registry
-
- Push the tagged image to Azure Container Registry
-
- Verify the repository in Azure Container Registry
- Create acrID variable
- Create a role assignment with appid and acrID
- Create AKS Cluster
- Get the AKS cluster credentials to update local environment
- Verify the AKS Cluster in Azure Cloud
- Deploy the application to AKS Cluster
- To monitor the service deployment
Scale the application and Kubernetes infrastructure
Scaling Azure Kubernetes Service (AKS) Cluster nodes
- Get the current nodes
- Scaling nodes
- Get the current nodes after scaling
- Verify the current deployment
- Scale the pods to 5
- Verify the current deployment after scale
- Verify the current replicas # of application
-
Create a new image
docker build . -t vvkubeserviceacr.azurecr.io/kubeservice:v2
-
Push the image to Azure Container Registry
- Update the deployment
- To monitor the deployment
- Test the updated application
-
Run the application to see the changes made by navigating to the url: http://137.135.124.83