AKS Cluster Login Access
Overview
Before managing or deploying workloads in the Azure Kubernetes Service (AKS), you must gain access to the relevant cluster using Azure CLI and kubectl.
Prerequisites
- Install Azure CLI
- Install kubectl
- If the cluster restricts inbound IPs, your client IP must be allowlisted (or you must be on the required network/VPN).
Gaining Cluster Access
- Navigate to the relevant AKS cluster.
- Use Privileged Identity Management (PIM) to assign yourself the role: TRG Custom Role - MGMT AKS Cluster Administrator.
- Open the Azure CLI and run the following commands.
- Log in to Azure
az login- Set the correct subscription:
az account set --subscription <SUBSCRIPTION_ID>- Retrieve the AKS Cluster Credentials:
az aks get-credentials –-resource-group <RESOURCE_GROUP> --name <AKS_CLUSTER_NAME>- Verify the connection:
kubectl cluster-info
If successful, the Kubernetes control plane and services should be visible. If not, recheck the prerequisites and ensure PIM role assignment is complete.