Search
StarWind is a hyperconverged (HCI) vendor with focus on Enterprise ROBO, SMB & Edge

Kubectl with Azure CLI

  • July 8, 2021
  • 3 min read
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.
Cloud and Virtualization Architect. Florent is specializing in public, hybrid, and private cloud technologies. He is a Microsoft MVP in Cloud and Datacenter Management and an MCSE in Private Cloud.

A new interesting feature that has been released by Microsoft, with the aks-preview module, is the possibility to execute kubectl commands, directly from Azure CLI, without connecting to the cluster. The full documentation is available here: https://docs.microsoft.com/en-us/azure/aks/private-clusters#aks-run-command-preview

The first thing is to register the RunCommandPreview in your subscription:

RunCommandPreview

You can check the status of the registering, with this command:

Check the status of the registering

Check the status of the registering

When the state is Registered you need to re-register the provider ContainerService:

You can now execute your Kubernetes commands, with the following command:

Execute your Kubernetes commands

You can also apply a file:

wp-image-16854

I can now access the webpage that I deployed from the Azure CLI:

wp-image-16855

How it works? It is simple. When you execute the az aks command invoke command, a new pod is deployed in your AKS clusters, and execute the command that you passed.

At this time, this feature has some limitation like the execution with Private AKS cluster and Azure AD authentication, where it doesn’t work.

Found Florent’s article helpful? Looking for a reliable, high-performance, and cost-effective shared storage solution for your production cluster?
Dmytro Malynka
Dmytro Malynka StarWind Virtual SAN Product Manager
We’ve got you covered! StarWind Virtual SAN (VSAN) is specifically designed to provide highly-available shared storage for Hyper-V, vSphere, and KVM clusters. With StarWind VSAN, simplicity is key: utilize the local disks of your hypervisor hosts and create shared HA storage for your VMs. Interested in learning more? Book a short StarWind VSAN demo now and see it in action!