Welcome to The Solution video for the Environmental Variables Lab.
So for the first question, we have to find the number of parts and to do this, we'll and still get
ports and you'll notice that there is one part which is running by the name of webapp color.
Next, find out the environment variable name set on the container and the port.
So let's and keep CTL describe pod webapp color and look for the environment variable, and here it
set to up color.
That's the name of the environment variable.
So select that from the options app Dash Color, which is the variable name.
And next question, we have to find the value we just had for that environment variable.
So going back, you'll see that it is set to pink.
So pink.
Now, the next one is just an information of you, the Web application you eye by clicking on the Web
app killer tab above your Domhnall.
So let's go back and click on Webapp Color Tab, and you can see that it displays the pink web page.
Next, we have to update the environment variable on the iPod to display a green background, so you'll
have to delete and recreate the pod.
And on the right, we have the specifications to be used to create port.
So let's create a poor definition file.
So we'll make use of the same pod, which is currently created CubeSat.
You'll get pod webapp color, national Yamal and redirected to a file called Pod.
Now, let's lead the part.
Wait for the prompt to come back.
And now we can update the poor definition file.
So go down to this pack and change the environment, variable up, color the value to green.
Now Creedy part using Kubek to apply f podhorzer Yamal.
And let's check the answer.
So we can verify the change has been correctly made by checking the Web application UI again, so let's
refresh it.
And you can see that the color has changed to green.
Now for the next question, we have to find out the number of config maps that exist in the environment.
So go back to the terminal and run the command cube, ctrl, get C and which stands for config map.
And you'll notice that there is one config map by the name of the dash config which has been created.
Now we have to inspect that the conflict map and find out the name of the device host.
So let's run the command cubicle, describe conflict map.
The name of the conflict map, and under the data, you'll see that the host name is set to sequel zero
one dot example dot com.
So choose that from the option.
Next, we had to create a new conflict map by the name of rebaptized color, and you have to use the
specs given all the right.
To do this, we will use the imperative command, which is.
It'll create s.m, which is like short for conflict map, name of the conflict map.
And we'll use the dash dash from Litoral option, and here we'll copy the name of the Environment Variable,
which is app dash app, underscore color as a call to dark blue.
The conflict map has been created.
But looks like I made a mistake in copying the name of the conflict map.
So the name should be webapp dash conflict dash map, but the one I created is webapp dash color, so
let's fix that.
So let's correct the name of the conflict map.
Copied from the question.
And provide the same option as before Dash Dash from Dash Litoral as equal to app color is equal to
dark blue.
Now that the conflict map was created, let's check.
And this time.
It should go through.
And now for the next question, we have to update the environment variable on the pod to use the newly
created config map.
So earlier, we have directly specified the environment variable, as we saw from the pod definition
file earlier.
So now we will make use of the config map.
So you have to use the specific issues on the right.
The problem is same as before Web app discolor will use the N from and specify the config name, which
is Web app.
Dash config, dash map.
So let's go back.
And legislative report again, then will make changes to the poor definition for.
Just as before, this can take a few seconds, so please be patient.
And now one of the commands that I like to look up often is the cube.
Explain, come on.
So cubicle explain parts, doshisha cursive and we can go for either envy from our.
A conflict map string just to look up the different options that can be used to update the poor definition
for.
So in this case, I'm going to look up envy from.
And while I'm at it, I'll print out a few lines underneath, so let's copy some of the lines from this
command here so it can be from and the lines underneath.
And we'll put it in our definition for.
He can also make use of the documentation, but I find that this is quite an easy way to do things.
So we will replace the energy field with envy from.
And the way to do this is if you notice the string next to energy from it has got the square brackets,
which indicates that the line after and from is an array.
So the line, config, my preference would be an array.
So you'll have to declare it that way and the line underneath config, my preference as an object.
It's not an array.
So we'll have to declare it as an object.
So let's do that now, remove the string.
And declare the entry below it as an area and again, remove the string for the world object and underneath
we have the key value pair.
The name should be part of the conflict we created earlier, so change it to that and now we should
be good.
And just as I said before, you can also write for the documentation, make sure that things have been
set up correctly, make use of the correct options.
But this is one easy way to do things.
So once this is done, save the file and recreate the part, using Kubasik will apply.
The pot has been created, so now let's check the solution and it should go through.
So the last one is just an information.
Again, let's go back to the Web application UI and refresh it.
And you will find that it has changed from green to dark blue, which means that our pod has been created
correctly.
Thank you for joining me in the studio.
I'll see you in the next one.