I’d like to get the external ip of the node. Similar to minikube ip as shown in the Istio Ingress Gateways documentation.
Question: How to get the IP address of the node so to allow remote clients outside of the cluster to access services installed within the cluster? In my example, this address would be 192.168.1.98. Maybe it is possible to grep it from microk8s.kubectl cluster-info
However all I can see is the loopback IP 127.0.0.1.
$ microk8s.kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:16443
Heapster is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/heapster/proxy
CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
Grafana is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-grafana/proxy
InfluxDB is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/monitoring-influxdb:http/proxy
EDIT: Hum maybe I am asking the wrong question? A cluster theoritically has multiple nodes so it’s kind of illogical to ask the cluster to give a node IP address. Maybe I should query the node details and read the info in the Addresses section:
MicroK8s will use the default interface. You should be able to locate that with ip route | grep default.
You are right that in a MIcroK8s cluster you will get one IP per node.
In case you look for a kubeconfig file to access the api server, you can use microk8s config [1]
Looks as if at the time of writing this things perhaps have changed a bit with later microk8s versions, ifconfig -a reveals virtual nic vxlan.calico and that ip I’m guessing is the one we want to be using ? I’m not all that familiar with calico but using the command mentioned by @TristanStanicmicrok8s.kubectl describe node $(microk8s.kubectl get nodes --no-headers | cut -f 1 -d " ") I see the same address on an annotation labelled projectcalico.org/IPv4VXLANTunnelAddr