# azure/aks-engine architecture

> Architecture diagram of the GitHub repository azure/aks-engine, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/azure/aks-engine
- Repository: https://github.com/azure/aks-engine

## Overview

AKS Engine is a CLI for provisioning and operating self-managed Kubernetes clusters on Azure (with Azure Stack support noted in the repository status). Its user-facing commands cover deployment, scaling, upgrades, and certificate rotation; internally, API models and the template engine describe clusters and Azure resources, while ARM and Kubernetes clients support cluster operations. The sampled files show the CLI entry point, template-generation code, storage-resource construction, and parts of certificate rotation and upgrade behavior. Several command-to-subsystem links are therefore shown as unverified rather than asserted as inspected calls.

Main entry points: [`cmd/root.go`](https://github.com/azure/aks-engine/blob/master/cmd/root.go) (Command dispatch), [`pkg/api/types.go`](https://github.com/azure/aks-engine/blob/master/pkg/api/types.go) (Cluster API model), [`cmd/deploy.go`](https://github.com/azure/aks-engine/blob/master/cmd/deploy.go) (Deploy cluster), [`cmd/rotate_certs.go`](https://github.com/azure/aks-engine/blob/master/cmd/rotate_certs.go) (Rotate certificates)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_cli["CLI commands"]
  node_main["CLI entry<br/>[main.go]"]
  node_commands["Command dispatch<br/>[root.go]"]
  node_deploy["Deploy cluster<br/>[deploy.go]"]
  node_scale["Scale pool<br/>[scale.go]"]
  node_upgrade["Upgrade cluster<br/>[upgrade.go]"]
  node_rotate["Rotate certificates<br/>[rotate_certs.go]"]
end

subgraph group_model["Cluster model"]
  node_api["Cluster API model<br/>[types.go]"]
  node_orchestrators["Orchestrator versions<br/>[orchestrators.go]"]
  node_defaults["Kubernetes defaults"]
end

subgraph group_provision["Provisioning"]
  node_engine["Template engine<br/>[engine.go]"]
  node_armresources["ARM resource templates<br/>[storageaccounts.go]"]
  node_transform["Model transformation<br/>[transform.go]"]
end

subgraph group_operations["Cluster operations"]
  node_rotateops["Rotation operations<br/>[operations.go]"]
  node_rotatewait["Rotation wait<br/>[wait.go]"]
  node_upgradeflow["Upgrade workflow<br/>[upgrader.go]"]
  node_upgradecluster["Cluster upgrade<br/>[upgradecluster.go]"]
  node_vmops["VM operations<br/>[deletevm.go]"]
end

subgraph group_clients["Cloud clients"]
  node_arm["Azure resource client<br/>[azureclient.go]"]
  node_stackarm["Azure Stack client<br/>[azureclient.go]"]
  node_kubeclient["Kubernetes client<br/>[client.go]"]
  node_composite["Composite client"]
end

node_user(("Operator"))

node_user -->|"runs"| node_main
node_main -->|"executes"| node_commands
node_commands -.->|"dispatches"| node_deploy
node_commands -.->|"dispatches"| node_scale
node_commands -.->|"dispatches"| node_upgrade
node_commands -.->|"dispatches"| node_rotate
node_deploy -.->|"loads model"| node_api
node_deploy -.->|"generates templates"| node_engine
node_deploy -.->|"deploys resources"| node_arm
node_scale -.->|"builds resources"| node_engine
node_scale -.->|"operates VMs"| node_vmops
node_upgrade -.->|"starts upgrade"| node_upgradeflow
node_upgradeflow -.->|"coordinates"| node_upgradecluster
node_upgradeflow -.->|"uses"| node_kubeclient
node_upgradeflow -.->|"uses"| node_arm
node_rotate -.->|"coordinates"| node_rotateops
node_rotate -.->|"waits via"| node_rotatewait
node_rotate -.->|"accesses cluster"| node_kubeclient
node_api -.->|"applies defaults"| node_defaults
node_orchestrators -.->|"provides versions"| node_api
node_engine -.->|"creates resources"| node_armresources
node_engine -.->|"consumes model"| node_api
node_transform -.->|"transforms model"| node_api
node_arm -.->|"has Stack variant"| node_stackarm
node_composite -.->|"wraps clients"| node_kubeclient

click node_main "https://github.com/azure/aks-engine/blob/master/main.go"
click node_commands "https://github.com/azure/aks-engine/blob/master/cmd/root.go"
click node_deploy "https://github.com/azure/aks-engine/blob/master/cmd/deploy.go"
click node_scale "https://github.com/azure/aks-engine/blob/master/cmd/scale.go"
click node_upgrade "https://github.com/azure/aks-engine/blob/master/cmd/upgrade.go"
click node_rotate "https://github.com/azure/aks-engine/blob/master/cmd/rotate_certs.go"
click node_rotateops "https://github.com/azure/aks-engine/blob/master/cmd/rotatecerts/operations.go"
click node_rotatewait "https://github.com/azure/aks-engine/blob/master/cmd/rotatecerts/wait.go"
click node_api "https://github.com/azure/aks-engine/blob/master/pkg/api/types.go"
click node_orchestrators "https://github.com/azure/aks-engine/blob/master/pkg/api/orchestrators.go"
click node_defaults "https://github.com/azure/aks-engine/blob/master/pkg/api/defaults-controller-manager.go"
click node_engine "https://github.com/azure/aks-engine/blob/master/pkg/engine/engine.go"
click node_armresources "https://github.com/azure/aks-engine/blob/master/pkg/engine/storageaccounts.go"
click node_transform "https://github.com/azure/aks-engine/blob/master/pkg/engine/transform/transform.go"
click node_arm "https://github.com/azure/aks-engine/blob/master/pkg/armhelpers/azureclient.go"
click node_stackarm "https://github.com/azure/aks-engine/blob/master/pkg/armhelpers/azurestack/azureclient.go"
click node_kubeclient "https://github.com/azure/aks-engine/blob/master/pkg/kubernetes/client.go"
click node_composite "https://github.com/azure/aks-engine/blob/master/pkg/kubernetes/composite_client.go"
click node_upgradeflow "https://github.com/azure/aks-engine/blob/master/pkg/operations/kubernetesupgrade/upgrader.go"
click node_upgradecluster "https://github.com/azure/aks-engine/blob/master/pkg/operations/kubernetesupgrade/upgradecluster.go"
click node_vmops "https://github.com/azure/aks-engine/blob/master/pkg/operations/deletevm.go"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_commands,node_deploy,node_scale,node_upgrade,node_rotate toneBlue
class node_api,node_orchestrators,node_defaults toneAmber
class node_engine,node_armresources,node_transform toneMint
class node_rotateops,node_rotatewait,node_upgradeflow,node_upgradecluster,node_vmops toneRose
class node_arm,node_stackarm,node_kubeclient,node_composite,node_user toneIndigo
```

## Components

### CLI commands

- [CLI entry](https://github.com/azure/aks-engine/blob/master/main.go): `main.go`
- [Command dispatch](https://github.com/azure/aks-engine/blob/master/cmd/root.go): `cmd/root.go`
- [Deploy cluster](https://github.com/azure/aks-engine/blob/master/cmd/deploy.go): `cmd/deploy.go`
- [Scale pool](https://github.com/azure/aks-engine/blob/master/cmd/scale.go): `cmd/scale.go`
- [Upgrade cluster](https://github.com/azure/aks-engine/blob/master/cmd/upgrade.go): `cmd/upgrade.go`
- [Rotate certificates](https://github.com/azure/aks-engine/blob/master/cmd/rotate_certs.go): `cmd/rotate_certs.go`

### Cluster model

- [Cluster API model](https://github.com/azure/aks-engine/blob/master/pkg/api/types.go): `pkg/api/types.go`
- [Orchestrator versions](https://github.com/azure/aks-engine/blob/master/pkg/api/orchestrators.go): `pkg/api/orchestrators.go`
- [Kubernetes defaults](https://github.com/azure/aks-engine/blob/master/pkg/api/defaults-controller-manager.go): `pkg/api/defaults-controller-manager.go`

### Provisioning

- [Template engine](https://github.com/azure/aks-engine/blob/master/pkg/engine/engine.go): `pkg/engine/engine.go`
- [ARM resource templates](https://github.com/azure/aks-engine/blob/master/pkg/engine/storageaccounts.go): `pkg/engine/storageaccounts.go`
- [Model transformation](https://github.com/azure/aks-engine/blob/master/pkg/engine/transform/transform.go): `pkg/engine/transform/transform.go`

### Cluster operations

- [Rotation operations](https://github.com/azure/aks-engine/blob/master/cmd/rotatecerts/operations.go): `cmd/rotatecerts/operations.go`
- [Rotation wait](https://github.com/azure/aks-engine/blob/master/cmd/rotatecerts/wait.go): `cmd/rotatecerts/wait.go`
- [Upgrade workflow](https://github.com/azure/aks-engine/blob/master/pkg/operations/kubernetesupgrade/upgrader.go): `pkg/operations/kubernetesupgrade/upgrader.go`
- [Cluster upgrade](https://github.com/azure/aks-engine/blob/master/pkg/operations/kubernetesupgrade/upgradecluster.go): `pkg/operations/kubernetesupgrade/upgradecluster.go`
- [VM operations](https://github.com/azure/aks-engine/blob/master/pkg/operations/deletevm.go): `pkg/operations/deletevm.go`

### Cloud clients

- [Azure resource client](https://github.com/azure/aks-engine/blob/master/pkg/armhelpers/azureclient.go): `pkg/armhelpers/azureclient.go`
- [Azure Stack client](https://github.com/azure/aks-engine/blob/master/pkg/armhelpers/azurestack/azureclient.go): `pkg/armhelpers/azurestack/azureclient.go`
- [Kubernetes client](https://github.com/azure/aks-engine/blob/master/pkg/kubernetes/client.go): `pkg/kubernetes/client.go`
- [Composite client](https://github.com/azure/aks-engine/blob/master/pkg/kubernetes/composite_client.go): `pkg/kubernetes/composite_client.go`

### Other components

- **Operator**

## Connections

- Operator → CLI entry: runs (evidence: `main.go`)
- CLI entry → Command dispatch: executes (evidence: `main.go`)
- Command dispatch → Deploy cluster: dispatches
- Command dispatch → Scale pool: dispatches
- Command dispatch → Upgrade cluster: dispatches
- Command dispatch → Rotate certificates: dispatches
- Deploy cluster → Cluster API model: loads model
- Deploy cluster → Template engine: generates templates
- Deploy cluster → Azure resource client: deploys resources
- Scale pool → Template engine: builds resources
- Scale pool → VM operations: operates VMs
- Upgrade cluster → Upgrade workflow: starts upgrade
- Upgrade workflow → Cluster upgrade: coordinates
- Upgrade workflow → Kubernetes client: uses
- Upgrade workflow → Azure resource client: uses
- Rotate certificates → Rotation operations: coordinates
- Rotate certificates → Rotation wait: waits via
- Rotate certificates → Kubernetes client: accesses cluster
- Cluster API model → Kubernetes defaults: applies defaults
- Orchestrator versions → Cluster API model: provides versions
- Template engine → ARM resource templates: creates resources
- Template engine → Cluster API model: consumes model
- Model transformation → Cluster API model: transforms model
- Azure resource client → Azure Stack client: has Stack variant
- Composite client → Kubernetes client: wraps clients
