- Azure CLI version 2.47.0 or later
- kubectl
cat <<EOF > parameters.json
{
"postgresServerAdminPassword": { "value": "A$(openssl rand -hex 6)#" }
}
EOF
# 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"
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 <cluster-name> \
-g <resource-group> \
--enable-private-cluster
# 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"