I'm looking to get the information available in the command kubectl cluster-info
Kubernetes control plane is running at https://api.joseph-rancher-cluster-2.rancher.aveshalabs.io
CoreDNS is running at https://api.joseph-rancher-cluster-2.rancher.aveshalabs.io/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
How can I get the api server endpoint URL using that function?
I only know of two ways to get the end point, but both of them only return the private ip:
kubectl describe svc kubernetes -n default
kubectl config view -o jsonpath="{.clusters[?(@.name==\"joseph-rancher-cluster-2\")].cluster.server}"