Dynamically give .cluster.local DNS in environment variables in sts

3/9/2020

I want to create an environment variable in the pod created by my sts which would consist of its FQDN. As the dns domain - ".cluster.local" can be different for various clusters, like '.cluster.abc', or '.cluster.def', I want to populate that dynamically based on the cluster settings. I checked that .fieldRed.fieldPath doesn't consist of anything like it.

Is there any other option to do that?

-- Akshay Nagpal
charts
kubernetes
kubernetes-helm

1 Answer

3/9/2020

This is not a feature of Kubernetes. You would need to use a higher level templating system like Kustomize or Helm.

-- coderanger
Source: StackOverflow