<p>I've k8s cluster and pod which one living in there . 
So ,  I have got a requirements for pod process . </p>

<p>Pod need a Cluster Ip for manage some jobs . How I can set the API Server name as a Environment variable . </p>

<p>My Pod Yaml shown as below :</p>

<pre><code> apiVersion: v1
 kind: Pod
 metadata:
  name: api-server-check
 spec:
  containers:
   - name: container-1
   image: project_reg/pod:latest
   env:
    - name: MY_NODE_NAME
      valueFrom:
        fieldRef:
          fieldPath: spec.nodeName
    - name: CLUSTER_IP
      valueFrom:
        fieldRef:
          fieldPath: ???????? ### Problem is here I think . 
</code></pre>

<p>If you have another suggestion for me , I will apply it to the Pod yaml . (Shell script or etc .. )</p>

<p>Thanks</p>

ColossusMark1
<p>You can use the cluster internal DNS to point to the Kubernetes API Server.<br>
The API Service should already be exposed as a service called "kubernetes" in the default namespace.<br>
<code>kubernetes.default.svc.cluster.local</code> should resolve to the API server.</p>

<p>Also, if you dump the <code>env</code> inside a running pod you should see that there is an environment variable which already has this information... <code>KUBERNETES_SERVICE_HOST</code></p>
