OpenShift Downward API Operations: Difference between revisions
Jump to navigation
Jump to search
Line 31: | Line 31: | ||
<font color=teal>'''fieldRef:'''</font> | <font color=teal>'''fieldRef:'''</font> | ||
<font color=teal>'''fieldPath: metadata.namespace'''</font> | <font color=teal>'''fieldPath: metadata.namespace'''</font> | ||
The deployment configuration will produce a pod that contains the following environment properties in its environment: | |||
POD_NAME=something-cm34t | |||
POD_NAMESPACE=lab4 | |||
=Expose OpenShift Information to Pod via Volumes = | =Expose OpenShift Information to Pod via Volumes = |
Revision as of 04:26, 23 November 2017
Internal
Overview
Expose OpenShift Information to Pod via Environment Variables
Edit the deployment configuration for the pod we want to expose data to:
oc edit dc/<dc-name>
Add the following environment entires:
... spec: ... template: ... spec: containers: - name: printenv env: - name: POD_NAME valueFrom: fieldRef: fieldPath: metadata.name - name: POD_NAMESPACE valueFrom: fieldRef: fieldPath: metadata.namespace
The deployment configuration will produce a pod that contains the following environment properties in its environment:
POD_NAME=something-cm34t POD_NAMESPACE=lab4