1
00:00:00,610 --> 00:00:04,720
Welcome to The Solution video for the Environmental Variables Lab.

2
00:00:07,500 --> 00:00:14,700
So for the first question, we have to find the number of parts and to do this, we'll and still get

3
00:00:14,700 --> 00:00:20,880
ports and you'll notice that there is one part which is running by the name of webapp color.

4
00:00:26,430 --> 00:00:31,200
Next, find out the environment variable name set on the container and the port.

5
00:00:33,160 --> 00:00:42,010
So let's and keep CTL describe pod webapp color and look for the environment variable, and here it

6
00:00:42,020 --> 00:00:43,990
set to up color.

7
00:00:44,260 --> 00:00:46,480
That's the name of the environment variable.

8
00:00:49,960 --> 00:00:54,670
So select that from the options app Dash Color, which is the variable name.

9
00:00:56,160 --> 00:01:00,090
And next question, we have to find the value we just had for that environment variable.

10
00:01:00,890 --> 00:01:03,650
So going back, you'll see that it is set to pink.

11
00:01:06,200 --> 00:01:07,070
So pink.

12
00:01:09,480 --> 00:01:15,980
Now, the next one is just an information of you, the Web application you eye by clicking on the Web

13
00:01:15,980 --> 00:01:17,700
app killer tab above your Domhnall.

14
00:01:20,740 --> 00:01:27,100
So let's go back and click on Webapp Color Tab, and you can see that it displays the pink web page.

15
00:01:32,630 --> 00:01:38,390
Next, we have to update the environment variable on the iPod to display a green background, so you'll

16
00:01:38,390 --> 00:01:40,010
have to delete and recreate the pod.

17
00:01:42,670 --> 00:01:46,270
And on the right, we have the specifications to be used to create port.

18
00:01:53,480 --> 00:01:55,310
So let's create a poor definition file.

19
00:01:59,300 --> 00:02:05,100
So we'll make use of the same pod, which is currently created CubeSat.

20
00:02:05,140 --> 00:02:10,130
You'll get pod webapp color, national Yamal and redirected to a file called Pod.

21
00:02:13,750 --> 00:02:15,250
Now, let's lead the part.

22
00:02:18,220 --> 00:02:20,590
Wait for the prompt to come back.

23
00:02:23,630 --> 00:02:27,020
And now we can update the poor definition file.

24
00:02:29,990 --> 00:02:37,520
So go down to this pack and change the environment, variable up, color the value to green.

25
00:02:40,590 --> 00:02:45,660
Now Creedy part using Kubek to apply f podhorzer Yamal.

26
00:02:47,630 --> 00:02:49,910
And let's check the answer.

27
00:02:51,800 --> 00:02:58,430
So we can verify the change has been correctly made by checking the Web application UI again, so let's

28
00:02:58,430 --> 00:02:58,970
refresh it.

29
00:03:00,030 --> 00:03:02,580
And you can see that the color has changed to green.

30
00:03:05,720 --> 00:03:10,810
Now for the next question, we have to find out the number of config maps that exist in the environment.

31
00:03:11,900 --> 00:03:17,690
So go back to the terminal and run the command cube, ctrl, get C and which stands for config map.

32
00:03:18,110 --> 00:03:23,270
And you'll notice that there is one config map by the name of the dash config which has been created.

33
00:03:29,820 --> 00:03:35,600
Now we have to inspect that the conflict map and find out the name of the device host.

34
00:03:36,720 --> 00:03:42,900
So let's run the command cubicle, describe conflict map.

35
00:03:44,370 --> 00:03:52,130
The name of the conflict map, and under the data, you'll see that the host name is set to sequel zero

36
00:03:52,130 --> 00:03:53,700
one dot example dot com.

37
00:03:54,050 --> 00:03:55,400
So choose that from the option.

38
00:04:00,170 --> 00:04:05,540
Next, we had to create a new conflict map by the name of rebaptized color, and you have to use the

39
00:04:05,570 --> 00:04:06,890
specs given all the right.

40
00:04:09,210 --> 00:04:11,940
To do this, we will use the imperative command, which is.

41
00:04:14,290 --> 00:04:20,260
It'll create s.m, which is like short for conflict map, name of the conflict map.

42
00:04:21,900 --> 00:04:31,950
And we'll use the dash dash from Litoral option, and here we'll copy the name of the Environment Variable,

43
00:04:31,950 --> 00:04:35,820
which is app dash app, underscore color as a call to dark blue.

44
00:04:41,290 --> 00:04:42,760
The conflict map has been created.

45
00:04:44,830 --> 00:04:48,580
But looks like I made a mistake in copying the name of the conflict map.

46
00:04:51,210 --> 00:04:57,990
So the name should be webapp dash conflict dash map, but the one I created is webapp dash color, so

47
00:04:57,990 --> 00:04:58,740
let's fix that.

48
00:05:01,550 --> 00:05:03,560
So let's correct the name of the conflict map.

49
00:05:05,050 --> 00:05:06,280
Copied from the question.

50
00:05:10,050 --> 00:05:19,260
And provide the same option as before Dash Dash from Dash Litoral as equal to app color is equal to

51
00:05:19,470 --> 00:05:20,190
dark blue.

52
00:05:22,670 --> 00:05:25,190
Now that the conflict map was created, let's check.

53
00:05:26,850 --> 00:05:27,600
And this time.

54
00:05:29,020 --> 00:05:29,890
It should go through.

55
00:05:30,950 --> 00:05:36,830
And now for the next question, we have to update the environment variable on the pod to use the newly

56
00:05:36,830 --> 00:05:38,070
created config map.

57
00:05:38,960 --> 00:05:43,730
So earlier, we have directly specified the environment variable, as we saw from the pod definition

58
00:05:43,730 --> 00:05:44,610
file earlier.

59
00:05:44,990 --> 00:05:46,970
So now we will make use of the config map.

60
00:05:49,050 --> 00:05:52,790
So you have to use the specific issues on the right.

61
00:05:52,850 --> 00:06:00,810
The problem is same as before Web app discolor will use the N from and specify the config name, which

62
00:06:00,810 --> 00:06:01,560
is Web app.

63
00:06:01,560 --> 00:06:02,910
Dash config, dash map.

64
00:06:04,340 --> 00:06:05,240
So let's go back.

65
00:06:09,520 --> 00:06:16,900
And legislative report again, then will make changes to the poor definition for.

66
00:06:18,450 --> 00:06:22,160
Just as before, this can take a few seconds, so please be patient.

67
00:06:25,180 --> 00:06:29,650
And now one of the commands that I like to look up often is the cube.

68
00:06:30,130 --> 00:06:31,020
Explain, come on.

69
00:06:31,420 --> 00:06:39,220
So cubicle explain parts, doshisha cursive and we can go for either envy from our.

70
00:06:40,230 --> 00:06:49,110
A conflict map string just to look up the different options that can be used to update the poor definition

71
00:06:49,110 --> 00:06:49,380
for.

72
00:06:52,720 --> 00:06:55,030
So in this case, I'm going to look up envy from.

73
00:06:56,920 --> 00:07:04,930
And while I'm at it, I'll print out a few lines underneath, so let's copy some of the lines from this

74
00:07:04,930 --> 00:07:08,800
command here so it can be from and the lines underneath.

75
00:07:11,450 --> 00:07:13,750
And we'll put it in our definition for.

76
00:07:15,350 --> 00:07:20,390
He can also make use of the documentation, but I find that this is quite an easy way to do things.

77
00:07:21,260 --> 00:07:24,980
So we will replace the energy field with envy from.

78
00:07:31,160 --> 00:07:36,980
And the way to do this is if you notice the string next to energy from it has got the square brackets,

79
00:07:36,980 --> 00:07:41,420
which indicates that the line after and from is an array.

80
00:07:42,730 --> 00:07:45,710
So the line, config, my preference would be an array.

81
00:07:45,730 --> 00:07:52,140
So you'll have to declare it that way and the line underneath config, my preference as an object.

82
00:07:52,180 --> 00:07:52,980
It's not an array.

83
00:07:52,990 --> 00:07:54,750
So we'll have to declare it as an object.

84
00:07:57,550 --> 00:08:00,430
So let's do that now, remove the string.

85
00:08:04,900 --> 00:08:15,520
And declare the entry below it as an area and again, remove the string for the world object and underneath

86
00:08:15,520 --> 00:08:17,950
we have the key value pair.

87
00:08:19,330 --> 00:08:25,300
The name should be part of the conflict we created earlier, so change it to that and now we should

88
00:08:25,300 --> 00:08:25,690
be good.

89
00:08:26,590 --> 00:08:32,560
And just as I said before, you can also write for the documentation, make sure that things have been

90
00:08:32,980 --> 00:08:35,740
set up correctly, make use of the correct options.

91
00:08:36,070 --> 00:08:38,020
But this is one easy way to do things.

92
00:08:39,200 --> 00:08:44,360
So once this is done, save the file and recreate the part, using Kubasik will apply.

93
00:08:45,510 --> 00:08:52,110
The pot has been created, so now let's check the solution and it should go through.

94
00:08:53,070 --> 00:08:54,990
So the last one is just an information.

95
00:08:54,990 --> 00:08:58,410
Again, let's go back to the Web application UI and refresh it.

96
00:09:00,010 --> 00:09:06,490
And you will find that it has changed from green to dark blue, which means that our pod has been created

97
00:09:06,490 --> 00:09:06,970
correctly.

98
00:09:09,090 --> 00:09:10,890
Thank you for joining me in the studio.

99
00:09:10,980 --> 00:09:12,240
I'll see you in the next one.
