This is a simple deployment of Azure Kubernetes Service with ingress Application Gateway, with all required components. In addition, the deployment builds an image, pushes it to Azure Container Registry, and deploys it to Azure Kubernetes Service.
This is NOT production-ready, and should only be used for testing purposes.
- Azure Container Registry already provisioned
- Service Principal or Token with push access to the Container Registry
- Azure Subscription with an Azure Resource Group provisioned
- Service Principal with Owner access to the Resource Group
- Create GitHub Action Secrets
ACR_URIACR endpoint (e.g.akspoc.azurecr.io)ACR_USERusername if token auth or appid if SP authACR_PWDpassword for token or SPSSH_PUBLICSSH Public keyAZURE_SUBSCRIPTIONAzure Subscription IDAZURE_RGAzure Resource Group nameAZURE_CREDENTIALSJSON representation of SP credentials for authentication to ARM:{ "clientId": "<GUID>", "clientSecret": "<GUID>", "subscriptionId": "<GUID>", "tenantId": "<GUID>" }
- Change line 49 in
aks/deployment.yamlwith your ACR repo endpoint - (Optional) Change the CIDR variables and configurations in the vnet resource in
bicep/main.bicepif you want a larger address space, or don't want overlap with your existing network - Rename the
githubfolder to.github - Trigger the Bicep GitHub Actions by doing a change in the
bicepfolder- Wait for workflow to complete
- Trigger the AKS GitHub Actions by doing a change in the
aksordockerfolder- Wait for workflow to complete
- Browse to
http://<your-application-gateway-public-ip>/akspoc
Simplified architecture for the network flow and the GitHub Actions pipelines.
graph LR
a1[User]-->|http://`appgwpip`/akspoc|appgw
subgraph Virtual Network
subgraph AppGW Subnet
appgw(AppGW)
end
subgraph AKS Subnet
appgw-->pod1(pod-akspoc)
appgw-->pod2(pod-akspoc)
aks[AKS]
end
end
flowchart LR
x[User]-->x1[GitHub]
x1[GitHub]-->b1
x1[GitHub]-->a1
subgraph /docker/** OR /aks/**
b1[Github Actions]-->|Deploy|b2[Azure Kubernetes Service]
b1[Github Actions]-->|Push|b3[Azure Container Registry]
end
subgraph /bicep/**
a1[Github Actions]-->|Deploy|a2[Azure Resource Manager]
end
.github/workflowscontains the GitHub Actions deployment files- aks-deploy.yaml triggers on push to the docker or aks folder and builds image, pushes to ACR, pulls and deploys to AKS
- bicep-deploy.yaml triggers on push to the bicep folder and deploys Azure Bicep to the Resource Group in Azure
akscontains the manifests for Azure Kubernetes Service- deployment.yaml specifies the deployment, the service, and the appgw ingress for deployment of the image
bicepcontains the bicep configuration files- main.bicep specifies all the main components and calls the aks.bicep module for AKS creation
- aks.bicep specifies a module for Azure Kubernetes Service with required parameteres passed from main.bicep
dockercontains the files required to build the Docker image- Dockerfile specifies the docker build specs
- hello.conf is an nginx config file used in the image
- index.html is the hello-world html static website
imgcontains the images for the high level architecture in the README

