Being a novice kubernetes user, I have successfully deployed an application with ingress-nginx. But now in my application deployment specification, I have need to reference the EXTERNAL-IP of an ingress-nginx-controller (created via kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/controller-v0.47.0/deploy/static/provider/cloud/deploy.yaml
).
I tried doing the following in my deployment specification,
- name: HOSTIP
valueFrom:
fieldRef:
fieldPath: status.hostIP
but that returned a wholly different IP address than the EXTERNAL-IP address value found in the table when I did kubectl get svc -n ingress-nginx
.
Is there a way to reference the ingress-nginx-controller EXTERNAL-IP value using the valueFrom
syntax or is that not possible? And if not, what might be another way to let the deployed pod get at the EXTERNAL-IP value of the ingress-nginx-controller?