1
00:00:05,120 --> 00:00:06,830
Hello and welcome to this demo.

2
00:00:06,860 --> 00:00:14,370
In this demo we're going to see how to create a pod using a demo definition file.

3
00:00:14,900 --> 00:00:15,150
OK.

4
00:00:15,170 --> 00:00:23,120
So in order to create Yammer files you can actually use any editor of your choice.

5
00:00:23,120 --> 00:00:30,230
You could even use just a notepad or notepad plus plus or Adam or there are multiple options available.

6
00:00:30,320 --> 00:00:37,800
In my case I tend to use pi charm or a tool from the brains family.

7
00:00:37,880 --> 00:00:41,900
So I personally use pi term which is actually a python editor.

8
00:00:42,020 --> 00:00:45,010
And it has it has good support for Yemen files.

9
00:00:45,410 --> 00:00:52,510
So I use jet brains pi charm as my editor if you'd like to use pi charm you can actually go to dead

10
00:00:52,510 --> 00:01:02,630
brains dot com and select pi charm brains dot com forward slash pi charm and you can actually see when

11
00:01:02,630 --> 00:01:05,950
you click on download you can actually see there are two options.

12
00:01:06,110 --> 00:01:12,620
One is a professional version and another is community version which is free so you can actually download

13
00:01:12,620 --> 00:01:21,560
this lightweight idea which is free and to develop definition files and later on I will also show some

14
00:01:21,560 --> 00:01:28,550
tips and tricks around using this idea which will make your life a developing Cuban it is to finish

15
00:01:28,550 --> 00:01:29,600
in files enamel.

16
00:01:29,600 --> 00:01:30,800
Very easy.

17
00:01:30,800 --> 00:01:32,240
So there are ways that you can.

18
00:01:32,240 --> 00:01:38,240
There are plugins that will help you validate your file available with a pie chart.

19
00:01:38,270 --> 00:01:40,800
So we look at those as well.

20
00:01:41,960 --> 00:01:44,450
So to start with I'm going to create a new project.

21
00:01:44,720 --> 00:01:49,880
I'm going to call it as part and I'm just going to create the project.

22
00:01:51,290 --> 00:01:59,360
So that's that's my folder named part and under part I'm going to start by creating a pod definition

23
00:01:59,360 --> 00:02:00,210
file.

24
00:02:00,440 --> 00:02:07,510
I'm going to name that part that dash definition dot Jamel.

25
00:02:07,600 --> 00:02:09,290
And so now I have a one file.

26
00:02:09,310 --> 00:02:17,500
And as we saw in the lecture every component is definition file has the four root level properties which

27
00:02:17,500 --> 00:02:18,820
are API version.

28
00:02:18,850 --> 00:02:27,620
So I'm going to specify each of those so we have API portion kind metadata and spec okay.

29
00:02:27,650 --> 00:02:34,580
So as we disclosed API version is going to be V1 for pod the kind.

30
00:02:34,580 --> 00:02:35,870
As we know is pod.

31
00:02:35,900 --> 00:02:38,380
So I'm going to set that as pod.

32
00:02:38,390 --> 00:02:41,840
The metadata is an object or a dictionary.

33
00:02:41,900 --> 00:02:48,220
So I'm going to hit enter and then I'm going to hit tab or you can actually use spaces as well.

34
00:02:48,320 --> 00:02:52,070
I'm going to provide the properties unlimited data which are name.

35
00:02:52,130 --> 00:02:58,700
And I'm going to set a name for my part which is going to be my app dash pod and when I hit enter as

36
00:02:58,700 --> 00:03:00,880
you see it goes to the next line.

37
00:03:00,890 --> 00:03:05,930
But it's intended it has equal number of spaces before it then the previous line.

38
00:03:05,930 --> 00:03:08,540
And I'm going to have labels and other labels.

39
00:03:08,540 --> 00:03:15,200
So since labels is a dictionary again I'm going to invent the next few lines to the right as well under

40
00:03:15,200 --> 00:03:15,580
labels.

41
00:03:15,590 --> 00:03:20,780
I have app and the name of the app is going to be my app.

42
00:03:20,780 --> 00:03:27,710
Now if you look at this whole file and if you look at the bottom page chart has support for understanding

43
00:03:28,020 --> 00:03:29,140
ammo files.

44
00:03:29,210 --> 00:03:35,340
So if you look at the bottom you can actually see the various elements in a tree structure.

45
00:03:35,570 --> 00:03:41,580
So as you can see document one of one indicates this file is in the entire file.

46
00:03:41,780 --> 00:03:47,960
And under this file it it actually shows you in tree structure the various properties.

47
00:03:47,990 --> 00:03:51,470
So you have API version which is directly under the File kind.

48
00:03:51,470 --> 00:03:58,220
Metadata and spec are all directly under the file or root properties of the file which is what we wanted.

49
00:03:58,670 --> 00:04:05,570
And if you look at V1 V1 is actually under API version so now as you can see under the document I have

50
00:04:05,570 --> 00:04:08,320
API version and under that I have V1.

51
00:04:08,510 --> 00:04:11,390
So that matches what we're trying to do.

52
00:04:11,390 --> 00:04:18,140
Similarly if I select part you can see that it's under kind and if you select name which is under metadata

53
00:04:18,200 --> 00:04:20,060
you can see that it's under metadata.

54
00:04:20,750 --> 00:04:28,460
Similarly when you select labels you will also see that it is under metadata.

55
00:04:28,490 --> 00:04:32,610
So that means name and labels are children of metadata and theirs.

56
00:04:32,720 --> 00:04:37,160
So there are siblings and they must be intended.

57
00:04:37,160 --> 00:04:38,960
They must have the same intonation.

58
00:04:39,530 --> 00:04:44,240
So under a name you have my app part so you can see the hierarchy there.

59
00:04:44,240 --> 00:04:50,720
Similarly app is under labels and my app is under AB which is under labels.

60
00:04:50,730 --> 00:04:55,940
Now if you look at it name and labels need to be on the same vertical line for now.

61
00:04:55,940 --> 00:05:03,380
If I simply move labels to the right you now see that labels is under names and labels is now a child

62
00:05:03,440 --> 00:05:09,620
of name and which is not right it is supposed to be a sibling.

63
00:05:09,620 --> 00:05:16,220
So I'm going to remove those extra spaces I'm going to hit backspace and I'm going to level it.

64
00:05:16,310 --> 00:05:24,080
So this is right and under labels you can actually have as many labels as you want so you can create

65
00:05:24,200 --> 00:05:35,920
any key value pair here you can see cost center is our location north america or something like that

66
00:05:35,920 --> 00:05:42,160
type of this particular pod maybe a front end or something like that.

67
00:05:42,260 --> 00:05:48,350
So anything that will help you group this particular part in the future for now I'm just going to remove

68
00:05:48,380 --> 00:05:54,650
all of that and I'll no move on to the specs section under the spec section.

69
00:05:55,220 --> 00:06:00,770
Remember the specs section is unique to each object that you're creating.

70
00:06:00,800 --> 00:06:11,060
So for a pod under the spec section you actually have containers and under containers you have the containers

71
00:06:11,060 --> 00:06:16,050
is in fact an array or a list so you have a list of items.

72
00:06:16,340 --> 00:06:23,330
So you need a each item in the list is identified by a dash so as you have to put a dash followed by

73
00:06:23,340 --> 00:06:28,380
space and then name which is the name of my pod.

74
00:06:28,670 --> 00:06:34,820
Sorry the name of my container inside the pod and that's going to be in the next control container.

75
00:06:35,000 --> 00:06:42,100
And and then I have image which is the name of the image itself which is NTI and.

76
00:06:42,200 --> 00:06:47,570
So if you look at it I have under spec I have containers which is a list and then I have an item in

77
00:06:47,570 --> 00:06:51,100
the list which is which has name and image.

78
00:06:51,110 --> 00:06:58,220
Now if you try and look at the hierarchy of what we just created say if I select Name I see that it's

79
00:06:58,310 --> 00:07:06,260
under spec and it's under containers but there's something in between it says item once one of one.

80
00:07:06,350 --> 00:07:13,040
What that actually means is that's what indicates that the container is a list and it has multiple items

81
00:07:13,160 --> 00:07:16,970
and this is the first item of just one item.

82
00:07:16,970 --> 00:07:20,690
So these two lines is one item in the containers.

83
00:07:20,690 --> 00:07:26,000
Similarly you can have we know that we discussed that you can have additional containers in a port so

84
00:07:26,000 --> 00:07:29,570
if you had additional containers then this is how you would define it.

85
00:07:29,570 --> 00:07:36,860
You would in the new line you would add a new dash followed by new information about the way followed

86
00:07:36,860 --> 00:07:44,360
by information about the new port which could be like a back and container and the image is could be

87
00:07:44,360 --> 00:07:47,030
something like Redis or something.

88
00:07:47,330 --> 00:07:55,200
So in this case now when it's like name you can actually see that it says item two or two and then one

89
00:07:55,200 --> 00:07:56,220
of two.

90
00:07:56,250 --> 00:08:05,370
So now it actually identifies each item in the array or the list so that indicates that the format is

91
00:08:05,370 --> 00:08:07,920
correct and that is what we were trying to do.

92
00:08:08,280 --> 00:08:14,280
I'm just gonna get rid of the second container and I'm going to leave it as one can report.

93
00:08:14,310 --> 00:08:15,210
So this is good.

94
00:08:15,220 --> 00:08:23,670
I'm now going to copy this the contents of this and create an actual port using this the content that

95
00:08:23,670 --> 00:08:24,610
we just created.

96
00:08:25,050 --> 00:08:27,930
So I'm going to go to the cube master.

97
00:08:28,110 --> 00:08:32,720
I'm going to create a a folder structure for my demos.

98
00:08:32,730 --> 00:08:39,480
I'm going to call it demos and under demos I'm going to create a folder called pod and under part I'm

99
00:08:39,480 --> 00:08:44,790
going to create a file named pod definition dot Jamil

100
00:08:49,810 --> 00:08:53,040
and I will paste the contents that I just created

101
00:08:56,810 --> 00:08:57,370
OK.

102
00:08:57,420 --> 00:09:02,410
So when I know I'm going verify the contents of the file

103
00:09:07,430 --> 00:09:13,040
I can now run the cube control get parts command before I create the port I just want to make sure there's

104
00:09:13,040 --> 00:09:13,640
nothing running.

105
00:09:13,640 --> 00:09:21,310
So if you're following me from the previous lab where I deployed a port using the cube control run command.

106
00:09:21,800 --> 00:09:26,300
That's the part that's still running so I'm gonna get rid of that using the cube control delete deployment

107
00:09:26,300 --> 00:09:27,520
command.

108
00:09:27,520 --> 00:09:28,560
So that's gone by now.

109
00:09:28,580 --> 00:09:30,750
Right now we're the cube control get port command.

110
00:09:30,760 --> 00:09:38,030
I see that there are no resources found I can now create a new port using the cube control create port

111
00:09:38,080 --> 00:09:46,850
definition the Yemen command and I see that a new pod my part my airport is created when I run the cube

112
00:09:46,850 --> 00:09:54,680
control get ports command I see that it's in the process of creating the container and I will now monitor

113
00:09:54,680 --> 00:10:01,790
it and when I run it again I see that it's in a running state well that's it for this lecture in the

114
00:10:01,790 --> 00:10:08,490
next demo we're going to look at some tips and tricks around working with the ammo files in my.

115
00:10:08,900 --> 00:10:11,320
Thank you for your time and I will see you in the next demo.
