Setup CI on Azure Kubernetes Service (AKS) with Azure DevOps, Docker Compose and Helm

  1. New build pipeline

    New Build Pipeline

  2. Select source control – every check-in to that branch will trigger the build process

    Select Source Control

    NOTE: My demo code is not ready yet, I will push to github when ready

  3. Start with an Empty job

    Empty Job

  4. Choose Ubuntu as agent pool to build Linux images

    Build Agent

  5. Add Docker Compose task to build images

    Docker Compose

    • Fill in Azure Subscription and Container Registry

      It will authorize build agent to access to Azure and Container Registry Service (e.g. Azure Container Registry or Docker Hub)

    • Select docker-compose files from source control

      Docker command will be generated based on Docker Compose File and Additional Docker Compose Files e.g.

        docker-compose -f docker-compose.yml -f docker-compose.production.yml build
      
    • Select “Build service images” in Action dropdown

      Build Service Images 1

      Build Service Images 2

  6. Clone the #5 task to push images to ACR

    Just change Action to “Push service images”

    Push Service Images

  7. Clone the #5 task to lock images

    Just change Action to “Lock service images”

    Lock Service Images

  8. Add “Copy Files” task to copy environment configuration yaml files e.g. values.Production.yaml

    Copy Docker Files

  9. Install helm client

    • Fill in Azure Subscription, Resource group and Kubernetes group
    • Select “init” in Command dropdown
    • Set Arguments as “–client-only” to install helm client to package helm charts

    Install Helm Client 1

    Install Helm Client 2

  10. Package helm charts

    • Select “package” in Command dropdown
    • Set Destination for the package to be saved in artifact

    Package Helm Charts

  11. Publish Build Artifacts

    Publish Artifacts