how to get kubectl configuration from azure aks with python?

11/29/2018

I create a k8s deployment script with python, and to get the configuration from kubectl, I use the python command:

from kubernetes import client, config

config.load_kube_config()

to get the azure aks configuration I use the following az commands:

az login
az aks get-credentials --resource-group [resource group name] --name [aks name]

is there any way to get azure aks credential only from python and without the need of the az commands?

thanks!

-- Mendi Neymark
azure
azure-aks
azure-kubernetes
kubernetes
python

1 Answer

11/29/2018
-- 4c74356b41
Source: StackOverflow