How do I install and configure AKS networks with Azure Portal or Powershell ?

Installing and configuring AKS networks in Azure can be done through either the Azure Portal or using PowerShell. Here are the steps for both methods:

Installing and configuring AKS networks with Azure Portal:

  1. Log in to the Azure Portal and click on the “Create a resource” button.
  2. Search for “Azure Kubernetes Service” and select it from the search results.
  3. Click the “Create” button to start the AKS deployment wizard.
  4. Fill in the required information such as resource group, cluster name, region, and node size, and click on “Next.”
  5. Configure the networking options, such as virtual network and subnet settings, and click on “Next.”
  6. Select the authentication method, either Azure AD or service principal, and provide the necessary credentials.
  7. Review the settings and click on “Create” to deploy the AKS cluster.
  8. After deployment, you can manage the AKS network from the Azure Portal, including configuring network security policies, setting up load balancing, and managing network routes.

Installing and configuring AKS networks with PowerShell:

  1. Open PowerShell and connect to your Azure account using the “Connect-AzAccount” cmdlet.
  2. Create a new resource group using the “New-AzResourceGroup” cmdlet.
  3. Create a new virtual network and subnet using the “New-AzVirtualNetwork” and “New-AzVirtualNetworkSubnetConfig” cmdlets.
  4. Create a new AKS cluster using the “New-AzAks” cmdlet, specifying the required parameters such as resource group, cluster name, node count, and networking options.
  5. After deployment, you can manage the AKS network using the “Get-AzAksNetworkingConfiguration” cmdlet, which allows you to configure network security policies, set up load balancing, and manage network routes.

Here’s an example PowerShell command to create an AKS cluster with a virtual network and subnet:





New-AzResourceGroup -Name MyResourceGroup -Location eastus

$vnet = New-AzVirtualNetwork `
-Name MyVirtualNetwork `
-ResourceGroupName MyResourceGroup `
-Location eastus `
-AddressPrefix 10.0.0.0/16

$subnet = New-AzVirtualNetworkSubnetConfig `
-Name MySubnet `
-AddressPrefix 10.0.1.0/24

New-AzAks `
-ResourceGroupName MyResourceGroup `
-Name MyAksCluster `
-NodeCount 1 `
-NodeVmSize Standard_B2s `
-VirtualNetworkSubnetId $vnet.Subnets[0].Id `
-ServiceCidr 10.0.0.0/16 `
-DnsServiceIP 10.0.0.10 `
-PodCidr 10.244.0.0/16

This command creates a new resource group, virtual network, and subnet, and then deploys a new AKS cluster with the specified networking options. The VirtualNetworkSubnetId parameter specifies the subnet to use for the AKS cluster, while the ServiceCidr, DnsServiceIP, and PodCidr parameters specify the IP ranges for the cluster services, DNS, and pods, respectively.

These are just basic examples of installing and configuring AKS networks in Azure using the Azure Portal or PowerShell. There are many more options and settings available for managing AKS networks, depending on your specific needs and requirements.

Author: tonyhughes