Azure PowerShell Kubernetes Cmdlets

Comprehensive Reference for Managing Azure Kubernetes Service (AKS) with PowerShell

Introduction to Azure Kubernetes Service (AKS) PowerShell Cmdlets

The Azure PowerShell module provides a robust set of cmdlets for interacting with and managing Azure Kubernetes Service (AKS) clusters. These cmdlets streamline the deployment, configuration, and operational tasks for your containerized applications on Azure. Whether you're creating new clusters, scaling existing ones, or integrating with other Azure services, these tools empower administrators and developers alike.

Getting Started

Before you can use the AKS cmdlets, ensure you have the Azure PowerShell module installed and are connected to your Azure account.

Install-Module -Name Az -AllowClobber -Scope CurrentUser
Connect-AzAccount

Once connected, you can discover available cmdlets using the `Get-Command` cmdlet.

Get-Command -Module Az.Aks

Cluster Management Cmdlets

New-AzAksCluster

Creates a new Azure Kubernetes Service (AKS) cluster.

Syntax

New-AzAksCluster -Name <String> -ResourceGroupName <String> [-Credential <PSCredential>] ...

Parameters

  • -Name: The name of the AKS cluster.
  • -ResourceGroupName: The name of the resource group to which the cluster belongs.
  • -Location: The Azure region where the cluster will be deployed.
  • -NodeCount: The initial number of nodes in the default node pool.
  • -VmSize: The size of the virtual machines for the nodes.
  • -EnablePodSecurityPolicy: Enables the Pod Security Policy feature.
  • -EnableAutoScaler: Enables the cluster autoscaler.

Get-AzAksCluster

Retrieves information about one or more Azure Kubernetes Service (AKS) clusters.

Syntax

Get-AzAksCluster [-Name <String>] [-ResourceGroupName <String>] ...

Parameters

  • -Name: The name of the AKS cluster. If omitted, all clusters in the resource group are returned.
  • -ResourceGroupName: The name of the resource group. If omitted, all clusters in the subscription are returned.

Node Pool Management Cmdlets

Add-AzAksNodePool

Adds a new node pool to an existing Azure Kubernetes Service (AKS) cluster.

Syntax

Add-AzAksNodePool -ClusterName <String> -Name <String> -ResourceGroupName <String> ...

Parameters

  • -ClusterName: The name of the AKS cluster.
  • -Name: The name for the new node pool.
  • -ResourceGroupName: The resource group of the AKS cluster.
  • -NodeCount: The number of nodes in the node pool.
  • -VmSize: The size of the virtual machines for the nodes.

Application Deployment and Management

Monitoring and Logging

  • (Cmdlets related to Azure Monitor integration with AKS)

Security Cmdlets

  • (Cmdlets related to AKS security features, RBAC, network policies)

Advanced Topics

Explore advanced configurations, integration with other Azure services like Azure Active Directory, Azure Monitor, and Azure Policy for enhanced security and management.