title: Its possible to set a var for a pod using a command that has to run inside of that pod?
body: <p>Its possible to set a var for a pod using a command that has to run inside of that pod? </p>
  
  <p>what i am trying to do is get private and public ip from the node, so i can use them into the app on the allowed host, i can get the private ip using this:</p>
  
  <pre><code>containers:
  - env:
    - name: NODE_IP
      valueFrom:
        fieldRef:
           status.hostIP
  </code></pre>
  
  <p>but only that private ip, and i need the public, my idea is to get them from here:</p>
  
  <p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html" rel="nofollow noreferrer">https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-instance-addressing.html</a>
  with this 2 commands:</p>
  
  <pre><code>curl http://169.254.169.254/latest/meta-data/local-ipv4
  curl http://169.254.169.254/latest/meta-data/public-ipv4
  </code></pre>
  
  <p>doing inside the container will be something like this:</p>
  
  <pre><code>command: MYPRIVATEIP=$(curl http://169.254.169.254/latest/meta-data/local-ipv4)
  command: MYPUBLICIP=$(curl http://169.254.169.254/latest/meta-data/public-ipv4)
  
  containers:
  - env:
    - name: NODE_IP
      valueFrom:
        fieldRef:
           status.hostIP
  </code></pre>
  
  <p>i already try to put this like this:</p>
  
  <pre><code>    env:
      - name: MYIP
        value: $(curl http://169.254.169.254/latest/meta-data/local-ipv4)
  </code></pre>
  
  <p>but this doesnt make anything but putting this like plane text. </p>
  
  <p>what i expect is to have that command output inside of the var so my app can pickup from there and add into the allowed host. thanks in advance for any help! regards</p>