quyennv.com

Senior DevOps Engineer · Healthcare, Singapore

Design and Deploy a CI/CD System with Azure Kubernetes and Azure DevOps – Part 1

#cicd#azure-devops#aks#kubernetes#docker#kaniko

Hi everyone — I’ve been focusing on a concept for CI/CD and self-hosted agents on AKS (Azure Kubernetes Service). This post gives an overview of the design: YAML (which is essential here) and the system architecture.

Architecture overview

Quick reference for abbreviations:

  • Terraform ~ tf
  • Kubernetes ~ K8s

Implementation approach

Technical approach: Because we’re designing and running the system (workload executor) entirely on Kubernetes, we need to check recent Kubernetes releases and choose the right approach to avoid wasting time.

When designing and running CI/CD workloads (agents) on K8s, we often think of DinD (Docker in Docker) — and many people still use it. However, Kubernetes removed support for this from around release v19 and officially in v1.24, specifically the dockershim interface. (Details: Check if dockershim removal affects you.)

In short:

The dockershim component of Kubernetes allows the use of Docker as a Kubernetes’s container runtime. Kubernetes’ built-in dockershim component was removed in release v1.24.

If you still use DinD (it can still work in some setups) to build Docker images, you may see:

can't create unix socket /var/run/docker.sock: is a directory

Also, with DinD you often need root permission for some tasks to work properly.

Quick comparison: DinD vs Kaniko

Feature/AspectDocker-in-Docker (DinD)Kaniko
SecurityRequires privileged access, higher riskNo privileged access, more secure
Resource UsageHigher (full Docker daemon)Lower (no Docker daemon)
CompatibilityFull Docker feature supportMost Docker features, some limitations
Ease of UseFamiliar Docker CLIDifferent workflow
PerformanceGenerally faster with cachingMay be slower, caching varies
CI/CD IntegrationWorks with many CI/CD systemsBest with Kubernetes-native CI/CD
Setup ComplexityHigher (nested containers)Simpler in Kubernetes

The next part will go deeper into self-hosted agents with AKS and Azure DevOps.

← All posts

Comments