i have a service runinig inside kubernetes, and i need to extract the exndpoint ip in environment variable
Here's the informations about the service
kubectl get endpoints
NAME ENDPOINTS AGE
kubernetes 10.0.2.15:8443 5h
locations-service 172.17.0.4:8080,172.17.0.5:8080,172.17.0.4:8081 + 1 more... 2h
mysql 172.17.0.7:3306 3h
phpmyadmin 172.17.0.6:80 5h
How i can get the Endpoints value and export it to a variable? i tried the following but it's not working
export PORT=$(kubectl describe service mysql -o go-template='{{range.spec.endpoints}}')