Wednesday, September 8, 2021

How to use a custom location for aks

set AZURE_CONFIG_DIR=D:\separate_account

az login

az account set --subscription <subscription_id>

az aks get-credentials --resource-group <resourcegroup> --name <clustername> --file D:\kubernetes_config\config

kubectl get clusterinfo --kubeconfig D:\kubernetes_config\config

kubectl cluster-info --kubeconfig D:\kubernetes_config\config


You can use --kubeconfig for providing config file path everytime for any kubernetes command or just set an environment variable and it will pick from here directly.

set KUBECONFIG=D:\separate_account\kubernetes_config\config


Reference:

https://kubernetes.io/docs/concepts/configuration/organize-cluster-access-kubeconfig/

https://kubernetes.io/docs/tasks/access-application-cluster/configure-access-multiple-clusters/

No comments:

Post a Comment