Sunday, February 23, 2025

Enhance Your Azure Kubernetes Service Experience with GitHub Copilot Plugins

This blog explains how to use GitHub Copilot Chat to perform various Azure Kubernetes Service (AKS) tasks, such as creating an AKS cluster and generating kubectl commands to interact with the cluster.

Prerequisites:

  • GitHub Copilot and GitHub Copilot for Azure installed
  • Azure Kubernetes Service extension for Visual Studio Code installed

Creating an AKS Cluster Using GitHub Copilot Chat

Open Copilot Chat on Visual Studio Code and type the following command:

@azure create an AKS cluster


A "Create Cluster" button will appear as a result. Click the button to proceed.
This will open a new page where you can enter the AKS cluster details. Provide the Resource Group, Cluster Name, and Region for the cluster, then click 'Create' to proceed.


Once the cluster creation is complete, you will receive a message similar to the one below.


Open the Azure Portal, and you will be able to find the cluster created using GitHub Copilot.




After creating the AKS cluster, we can use kubectl commands in GitHub Copilot Chat to interact with the cluster.

Steps to Run kubectl Commands Using GitHub Copilot Chat:
Open Copilot Chat and type what you want to do in the cluster.

1- Type @azure List all namespaces in aks cluster.
2 - Copilot will display the relevant kubectl command along with a button to open the kubectl panel.
3 - Click on the "Open kubectl panel" button. This will launch the command execution panel.
4 - Click "Run" next to the displayed command.
5 - The results will be listed on the screen.



Run additional commands using the Kubectl command panel as shown below.







No comments:

Post a Comment