@@ -93,14 +93,14 @@ the list. Similarly, avoid circular references.
93
93
94
94
## Using environment variables inside of your config
95
95
96
- Environment variables that you define in a Pod's configuration can be used
97
- elsewhere in the configuration, for example in commands and arguments that
98
- you set for the Pod's containers.
96
+ Environment variables that you define in a Pod's configuration under
97
+ ` .spec.containers[*].env[*] ` can be used elsewhere in the configuration, for
98
+ example in commands and arguments that you set for the Pod's containers.
99
99
In the example configuration below, the ` GREETING ` , ` HONORIFIC ` , and
100
100
` NAME ` environment variables are set to ` Warm greetings to ` , `The Most
101
- Honorable` , and ` Kubernetes`, respectively. Those environment variables
102
- are then used in the CLI arguments passed to the ` env-print-demo `
103
- container.
101
+ Honorable` , and ` Kubernetes`, respectively. And the environment variable
102
+ ` MESSAGE ` combines the set of all these environment variables and then used
103
+ as a CLI argument passed to the ` env-print-demo ` container.
104
104
105
105
``` yaml
106
106
apiVersion : v1
@@ -118,8 +118,10 @@ spec:
118
118
value : " The Most Honorable"
119
119
- name : NAME
120
120
value : " Kubernetes"
121
+ - name : MESSAGE
122
+ value : " $(GREETING) $(HONORIFIC) $(NAME)"
121
123
command : ["echo"]
122
- args : ["$(GREETING) $(HONORIFIC) $(NAME )"]
124
+ args : ["$(MESSAGE )"]
123
125
` ` `
124
126
125
127
Upon creation, the command ` echo Warm greetings to The Most Honorable Kubernetes` is run on the container.
0 commit comments