Azure Kubernetes Service (AKS) with Azure DevOps — Part 1

Prerequisite Actions

Continuous Integration (CI)

- Docker Compose (Build services): To read the "Dockerfile" in you connected repository, build a local container image and run an application based on that local container image.- Docker Compose (Push services): After knowing the container image could be build and run, tag the container image and push it to the target ACR.- Copy Files: This is to copy the file "deployment.yml" from connected repository to Azure DevOps space. Notice at this point, the referred image is still the local one.- Publish Artifact: Artifact is another word for whatever you created in the operation process. In this case, the copied file (deployment.yml) would be put in somewhere within Azure DevOps so future operations could use it.

Continuous Deployment (CD)

- Job: Only 1 agent job in this setup. However, you could add as many as needed.- Tasks:
1. Install Kubectl latest: This is pretty self-explanatory, which is installing the latest Kubernetes client command tool in the agent VM.
2. kubectl create: This is the operation to create a new namespace. With more and more deployments in the Kubernetes environment, you would need to separate them with namespaces. It is easy to find and easy to troubleshoot.3. kubectl apply: This is the operation to deploy the actual applications into the AKS cluster, which could include deployments, services, service accounts etc. 4. kubectl set: This is to switch out the image that is being used in the current deployment. We know that local container image works and is uploaded to ACR. Now, we would need to have the application to use the ACR's image instead of the local one. This is to ensure in the future, whenever there is a change in the container image, after the whole CI/CD process, the application would be running in the latest image.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store