How to Fetch Cluster Info from command kubectl cluster-info using python api

12/15/2021
[root@vk-okd-01 ~]# kubectl cluster-info
Kubernetes control plane is running at https://vk-aks-061221-testing-f23f0fc1.hcp.southcentralus.azmk8s.io:443
CoreDNS is running at https://vk-aks-061221-testing-f23f0fc1.hcp.southcentralus.azmk8s.io:443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Metrics-server is running at https://vk-aks-061221-testing-f23f0fc1.hcp.southcentralus.azmk8s.io:443/api/v1/namespaces/kube-system/services/https:metrics-server:/proxy

How I can get output of the above "kubectl cluster-info" command using python API or any other way programatically using python

From above output I need to extract Kubernetes control pannel URL and Metric server URL

-- Vishal Kothawade
kubernetes
kubernetes-python-client
python

0 Answers