[Vuejs]-How to get kubernetes / minikube env variable in vue js

0👍

The solution that would make the most sense is to use a Kubernetes Service and use the hostname with the Kubernetes DNS nomenclature: <service-name>.<namespace>.svc.cluster.local:<exposed-port>. Since both pods are in the same cluster it can be ClusterIP type of service.

The issue with IP addresses is that they are not fixed in a Kubernetes cluster (even minikube), but for testing you can always get the IP address of the pod like this:

$ kubectl get pod <pod-name> -o=jsonpath='{.status.podIP}'
👤Rico

Leave a comment