https://github.com/timoknapp/az-aks-demo
Demo of AKS in combination with App Gateway
https://github.com/timoknapp/az-aks-demo
aks application-gateway azure
Last synced: over 1 year ago
JSON representation
Demo of AKS in combination with App Gateway
- Host: GitHub
- URL: https://github.com/timoknapp/az-aks-demo
- Owner: timoknapp
- Created: 2023-06-13T09:00:56.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2023-08-03T09:38:28.000Z (almost 3 years ago)
- Last Synced: 2025-02-13T05:17:10.133Z (over 1 year ago)
- Topics: aks, application-gateway, azure
- Language: Bicep
- Homepage:
- Size: 589 KB
- Stars: 0
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Azure AKS Demo

## Prerequisites
* Azure CLI version 2.47.0 or later
* kubectl
## Getting started
### Create parameters.json
```bash
cat < parameters.json
{
"postgresServerAdminPassword": { "value": "A$(openssl rand -hex 6)#" }
}
EOF
```
### Enable / disable private AKS cluster
[Link to documentation](https://learn.microsoft.com/en-US/azure/aks/api-server-vnet-integration#enable-or-disable-private-cluster-mode-on-an-existing-cluster-with-api-server-vnet-integration)
```bash
# Install the aks-preview extension
az extension add --name aks-preview
# Update the extension to make sure you have the latest version installed
az extension update --name aks-preview
# Register the EnableAPIServerVnetIntegrationPreview feature flag using the az feature register command.
az feature register --namespace "Microsoft.ContainerService" --name "EnableAPIServerVnetIntegrationPreview"
# Verify the registration status using the az feature show command - this may take some time
az feature show --namespace "Microsoft.ContainerService" --name "EnableAPIServerVnetIntegrationPreview"
# Re-register the provider
az provider register --namespace "Microsoft.ContainerService"
```
### Deploy Resources to Azure
```bash
resourceGroupName="rg-aks-demo-001"
location="northeurope"
deploymentName="aks-demo-001"
# create a resource group
az group create -n $resourceGroupName -l $location
# modify the template as needed
az deployment group create \
-g $resourceGroupName \
-n $deploymentName \
--template-file main.bicep \
--parameters parameters.json
# Enable private cluster mode
az aks update -n \
-g \
--enable-private-cluster
```
### Adding a node pool to the cluster
```bash
# Update these values so that they match the actual deployed resources
resourceGroupName="rg-aks-demo-001"
clusterName="aksdemo1234-cluster"
nodePoolName="nodepool2"
deploymentName="aks-demo-$nodePoolName-001"
az deployment group create \
--name $deploymentName \
--resource-group $resourceGroupName \
--template-file ./modules/nodepool.bicep \
--parameters clusterName="$clusterName" nodePoolName="$nodePoolName"
```