1
00:00:02,090 --> 00:00:04,720
In this lecture, we'll install Minikube

2
00:00:04,720 --> 00:00:07,900
and the Kube control tool on Windows.

3
00:00:07,900 --> 00:00:09,550
Of course you can skip this lecture

4
00:00:09,550 --> 00:00:12,570
if you have no Windows device.

5
00:00:12,570 --> 00:00:16,360
Now to install Minikube, which is this tool

6
00:00:16,360 --> 00:00:19,360
which creates this local playground cluster,

7
00:00:19,360 --> 00:00:21,620
you could say, on our system,

8
00:00:21,620 --> 00:00:24,680
we can follow the official installation instructions

9
00:00:24,680 --> 00:00:28,750
to which you also find a link attached to this lecture.

10
00:00:28,750 --> 00:00:30,410
Now on these instructions,

11
00:00:30,410 --> 00:00:32,560
we first of all, want to verify

12
00:00:32,560 --> 00:00:35,860
whether we have the right setup.

13
00:00:35,860 --> 00:00:38,460
So for that, we can copy this command here

14
00:00:39,440 --> 00:00:41,803
and execute that in the command prompt.

15
00:00:42,910 --> 00:00:45,460
This will take a short while,

16
00:00:45,460 --> 00:00:47,270
and if you see output like this,

17
00:00:47,270 --> 00:00:49,670
a hypervisor has been detected,

18
00:00:49,670 --> 00:00:53,130
then you already got everything set up what you need.

19
00:00:53,130 --> 00:00:56,100
If you instead see something like this,

20
00:00:56,100 --> 00:00:59,140
it means that your system supports virtualization,

21
00:00:59,140 --> 00:01:00,490
which is what we need here,

22
00:01:00,490 --> 00:01:03,093
but that a hypervisor hasn't been set up yet.

23
00:01:04,000 --> 00:01:07,890
In that case, you need to install a hypervisor first.

24
00:01:07,890 --> 00:01:09,100
I will install one

25
00:01:09,100 --> 00:01:11,750
even though I already have the requirement met

26
00:01:11,750 --> 00:01:15,230
because I wanna use the VirtualBox as a hypervisor

27
00:01:15,230 --> 00:01:18,650
instead of the built-in one my Windows version ships with,

28
00:01:18,650 --> 00:01:22,000
because I also used the VirtualBox in the last lecture

29
00:01:22,000 --> 00:01:25,510
and VirtualBox will basically work on any system,

30
00:01:25,510 --> 00:01:27,920
including Windows 10 Home,

31
00:01:27,920 --> 00:01:31,310
which doesn't have a built-in hypervisor otherwise.

32
00:01:31,310 --> 00:01:33,610
So that's why I will use VirtualBox,

33
00:01:33,610 --> 00:01:36,683
even though technically I wouldn't need to install it.

34
00:01:37,600 --> 00:01:40,360
If your system doesn't meet the requirements here,

35
00:01:40,360 --> 00:01:43,400
you unfortunately can't install Minikube

36
00:01:43,400 --> 00:01:46,770
and there isn't too much you can do about that.

37
00:01:46,770 --> 00:01:48,923
So, now what we checked this,

38
00:01:50,260 --> 00:01:51,910
on the Windows tab here,

39
00:01:51,910 --> 00:01:56,010
we now first of all wanna installed a Kube control tool.

40
00:01:56,010 --> 00:01:58,910
And we actually need that tool always,

41
00:01:58,910 --> 00:02:02,020
even if we don't install Minikube locally,

42
00:02:02,020 --> 00:02:04,120
because it's the Kube control tool

43
00:02:04,120 --> 00:02:06,610
which helps us communicate with the cluster

44
00:02:06,610 --> 00:02:09,660
and which allows us to send instructions to the cluster,

45
00:02:09,660 --> 00:02:12,123
just as explained in the last lectures.

46
00:02:13,010 --> 00:02:14,190
So therefore, we should start

47
00:02:14,190 --> 00:02:16,610
by installing the Kube control tool.

48
00:02:16,610 --> 00:02:18,350
And to install this on Windows,

49
00:02:18,350 --> 00:02:20,300
we again can follow the instructions

50
00:02:20,300 --> 00:02:23,410
we find on the official installation page.

51
00:02:23,410 --> 00:02:26,550
Now there are different ways of setting it up locally.

52
00:02:26,550 --> 00:02:29,043
And I personally prefer using Chocolatey.

53
00:02:30,250 --> 00:02:34,110
So you can visit this package manager page.

54
00:02:34,110 --> 00:02:36,120
It's a package manager for Windows,

55
00:02:36,120 --> 00:02:39,640
which makes installing third party tools very easy.

56
00:02:39,640 --> 00:02:41,080
And it's free to use,

57
00:02:41,080 --> 00:02:44,173
so we can just install this Chocolatey tool.

58
00:02:45,260 --> 00:02:48,764
You don't need to subscribe to the newsletter for this,

59
00:02:48,764 --> 00:02:53,730
and then basically execute this command here in PowerShell,

60
00:02:57,270 --> 00:02:59,593
run this command there and hit Enter.

61
00:03:00,590 --> 00:03:03,320
And this will now install this Chocolatey tool

62
00:03:03,320 --> 00:03:05,253
locally on your system,

63
00:03:07,100 --> 00:03:09,263
which can again, take a short while.

64
00:03:10,470 --> 00:03:13,120
And once this has been installed,

65
00:03:13,120 --> 00:03:15,200
you're already done with this step.

66
00:03:15,200 --> 00:03:18,420
You can go back and install the Kube control tool

67
00:03:18,420 --> 00:03:23,290
by running choco install kubernetes-cli

68
00:03:23,290 --> 00:03:24,510
and you can run this command

69
00:03:24,510 --> 00:03:26,673
in the regular command prompt now.

70
00:03:32,120 --> 00:03:34,500
And then simply copy in the command here.

71
00:03:34,500 --> 00:03:37,090
And this now installs to Kube control tool

72
00:03:37,090 --> 00:03:40,913
with help of that Chocolatey package manager tool.

73
00:03:42,220 --> 00:03:47,220
Make sure to type yes here for running this setup script.

74
00:03:47,590 --> 00:03:51,633
And this now should successfully install Kube control.

75
00:03:53,170 --> 00:03:54,980
To verify whether it worked,

76
00:03:54,980 --> 00:03:58,750
you can now copy this command and execute that.

77
00:03:58,750 --> 00:04:00,920
And if everything worked,

78
00:04:00,920 --> 00:04:03,950
you should see some output like this.

79
00:04:03,950 --> 00:04:06,730
The exact details of course might differ,

80
00:04:06,730 --> 00:04:08,590
but you shouldn't get an error.

81
00:04:08,590 --> 00:04:10,573
And that proves that it works.

82
00:04:11,430 --> 00:04:15,420
Now that is the Kube control tool installed on your machine,

83
00:04:15,420 --> 00:04:17,180
which we will always need,

84
00:04:17,180 --> 00:04:19,860
even if we're not using Minikube.

85
00:04:19,860 --> 00:04:21,870
Because we only use Minikube

86
00:04:21,870 --> 00:04:24,370
to have this local development cluster,

87
00:04:24,370 --> 00:04:28,490
Kube control is then just our communication device

88
00:04:28,490 --> 00:04:30,870
for talking to that cluster.

89
00:04:30,870 --> 00:04:32,180
Now next, let's make sure

90
00:04:32,180 --> 00:04:34,653
we also follow these other steps here.

91
00:04:35,830 --> 00:04:39,553
In the command prompt, type cd $USERPROFILE$

92
00:04:42,740 --> 00:04:47,300
here in the command prompt to go to your user folder.

93
00:04:47,300 --> 00:04:51,000
Run mkdir for make directory .kube

94
00:04:52,150 --> 00:04:55,473
to create a new folder named .kube in there.

95
00:04:57,860 --> 00:05:02,620
And then go to this .kube folder in the windows Explorer

96
00:05:02,620 --> 00:05:05,730
and create a new text document there

97
00:05:06,940 --> 00:05:09,763
without a file extension, just config.

98
00:05:11,520 --> 00:05:15,350
You can still edit this with any text editor,

99
00:05:15,350 --> 00:05:18,200
though at the moment, we don't need to do anything there.

100
00:05:19,820 --> 00:05:21,980
Now we got Kube control installed,

101
00:05:21,980 --> 00:05:24,203
now let's install Minikube.

102
00:05:25,140 --> 00:05:27,180
Actually, I got the steps here.

103
00:05:27,180 --> 00:05:29,610
We first of all need a hypervisor

104
00:05:29,610 --> 00:05:32,730
and I will use a VirtualBox as explained before,

105
00:05:32,730 --> 00:05:37,020
since this is available on Windows 10 Home, on macOS

106
00:05:37,020 --> 00:05:40,690
and I wanna use one at the same virtualization tool.

107
00:05:40,690 --> 00:05:43,590
So one at the same tool creating that virtual machine,

108
00:05:43,590 --> 00:05:47,133
which holds the cluster on all different systems.

109
00:05:48,010 --> 00:05:50,050
On the VirtualBox homepage,

110
00:05:50,050 --> 00:05:52,110
simply click on Windows hosts here

111
00:05:52,110 --> 00:05:55,500
to download the VirtualBox installer,

112
00:05:55,500 --> 00:05:57,760
which again can take a couple of seconds.

113
00:05:57,760 --> 00:06:00,520
And once that installer was downloaded,

114
00:06:00,520 --> 00:06:03,460
simply walk through it to set up VirtualBox

115
00:06:03,460 --> 00:06:05,363
on your Windows system.

116
00:06:07,670 --> 00:06:09,510
So here I will go through it.

117
00:06:09,510 --> 00:06:12,103
You can keep all the defaults here,

118
00:06:13,260 --> 00:06:17,210
though of course, you can also switch the place

119
00:06:17,210 --> 00:06:18,890
where this is installed.

120
00:06:18,890 --> 00:06:20,623
And I will actually do this,

121
00:06:23,660 --> 00:06:24,683
click Next,

122
00:06:26,030 --> 00:06:28,143
choose whatever you wanna choose here,

123
00:06:30,290 --> 00:06:33,530
and click Yes and install.

124
00:06:33,530 --> 00:06:37,183
Now this will install VirtualBox on your system.

125
00:06:38,560 --> 00:06:41,530
And once it's finished, we don't need to start this,

126
00:06:41,530 --> 00:06:42,990
we just need it to be installed

127
00:06:42,990 --> 00:06:46,380
because Minikube will use this.

128
00:06:46,380 --> 00:06:48,710
Now we can install Minikube.

129
00:06:48,710 --> 00:06:51,840
And for this, I will again use this Chocolatey tool,

130
00:06:51,840 --> 00:06:53,803
which I used before.

131
00:06:55,748 --> 00:06:58,400
And then running choco install minikube,

132
00:06:58,400 --> 00:07:01,460
which now installs this Minikube tool.

133
00:07:01,460 --> 00:07:03,620
Again, this can take a couple of minutes

134
00:07:03,620 --> 00:07:05,203
or seconds to complete.

135
00:07:07,170 --> 00:07:09,500
And once this is completed,

136
00:07:09,500 --> 00:07:14,500
close your command prompt, and restart it.

137
00:07:15,880 --> 00:07:19,730
Now you don't have to start it as administrator,

138
00:07:19,730 --> 00:07:22,410
and confirm your successful installation

139
00:07:22,410 --> 00:07:24,420
by starting a new cluster

140
00:07:24,420 --> 00:07:26,620
and therefore in the case of Minikube,

141
00:07:26,620 --> 00:07:28,750
also a new virtual machine

142
00:07:28,750 --> 00:07:31,700
by running minikube start --driver,

143
00:07:31,700 --> 00:07:33,600
and then the driver of your choice.

144
00:07:33,600 --> 00:07:35,570
I'll come back to that in a second.

145
00:07:35,570 --> 00:07:39,790
So Minikube start --driver is the command,

146
00:07:39,790 --> 00:07:41,700
and now the value for driver

147
00:07:41,700 --> 00:07:44,100
should be your virtualization driver,

148
00:07:44,100 --> 00:07:46,020
which you wanna use.

149
00:07:46,020 --> 00:07:48,800
So in my case, I installed VirtualBox,

150
00:07:48,800 --> 00:07:51,400
so I should use this as a driver.

151
00:07:51,400 --> 00:07:54,410
You can check the full list of drivers you could be using

152
00:07:54,410 --> 00:07:56,510
depending on your setup.

153
00:07:56,510 --> 00:07:58,160
If you use VirtualBox,

154
00:07:58,160 --> 00:08:00,800
you should use virtualbox as a name here,

155
00:08:00,800 --> 00:08:03,030
all lowercase though.

156
00:08:03,030 --> 00:08:06,823
So plug in virtualbox here and hit Enter.

157
00:08:08,220 --> 00:08:10,840
And this now creates a new virtual machine

158
00:08:10,840 --> 00:08:12,580
with help of VirtualBox,

159
00:08:12,580 --> 00:08:15,940
which will hold your development cluster.

160
00:08:15,940 --> 00:08:18,150
And it will set up the master node

161
00:08:18,150 --> 00:08:19,810
and the worker node in there,

162
00:08:19,810 --> 00:08:21,770
actually it just sets up one node

163
00:08:21,770 --> 00:08:25,160
where worker and master node share the resources

164
00:08:25,160 --> 00:08:27,930
because for development, that's no problem.

165
00:08:27,930 --> 00:08:31,770
And it will also install all the software Kubernetes needs,

166
00:08:31,770 --> 00:08:33,960
the API server, the kubelet.

167
00:08:33,960 --> 00:08:37,890
It will install all of that and set everything up for you

168
00:08:37,890 --> 00:08:41,789
inside of this encapsulated virtual machine.

169
00:08:41,789 --> 00:08:43,929
Now, again, this can take a short while,

170
00:08:43,929 --> 00:08:46,480
so let's wait for that to finish.

171
00:08:46,480 --> 00:08:49,763
And once this is finished, we can test whether that worked.

172
00:08:50,810 --> 00:08:52,800
Now you will see for me it failed

173
00:08:52,800 --> 00:08:55,730
because I am using the Hyper-V hypervisor

174
00:08:55,730 --> 00:08:59,660
and this kind of conflicts with VirtualBox,

175
00:08:59,660 --> 00:09:03,130
and therefore, I either should disable that hypervisor

176
00:09:03,130 --> 00:09:07,190
or use the driver Hyper-V instead of VirtualBox.

177
00:09:09,370 --> 00:09:11,050
Now I will do that,

178
00:09:11,050 --> 00:09:13,490
but you can absolutely use VirtualBox

179
00:09:13,490 --> 00:09:15,910
if you don't have this built-in hypervisor,

180
00:09:15,910 --> 00:09:18,600
for example, on Windows 10 Home.

181
00:09:18,600 --> 00:09:23,460
So I will run Minikube start again,

182
00:09:23,460 --> 00:09:26,017
now with --driver hyperv,

183
00:09:26,880 --> 00:09:29,180
and this will now use to built in hypervisor,

184
00:09:29,180 --> 00:09:30,060
which of course means

185
00:09:30,060 --> 00:09:33,490
that installing VirtualBox was unnecessary.

186
00:09:33,490 --> 00:09:34,850
Now we, first of all,

187
00:09:34,850 --> 00:09:37,190
need to delete the other virtual machine,

188
00:09:37,190 --> 00:09:38,690
which was created first,

189
00:09:38,690 --> 00:09:42,318
and then we can run Minikube start driver hyperv.

190
00:09:42,318 --> 00:09:44,670
And now this will set up a new virtual machine

191
00:09:44,670 --> 00:09:48,900
now not based on VirtualBox, but the built-in hypervisor,

192
00:09:48,900 --> 00:09:51,290
which is built-in virtualization support

193
00:09:51,290 --> 00:09:53,050
some Windows versions have.

194
00:09:53,050 --> 00:09:55,510
And you'll see it now also failed

195
00:09:55,510 --> 00:09:58,170
but simply because this now needs to be executed

196
00:09:58,170 --> 00:10:00,063
as administrator,

197
00:10:03,330 --> 00:10:07,893
and then run Minikube start --driver hyperv again.

198
00:10:10,100 --> 00:10:11,750
And now this should succeed

199
00:10:11,750 --> 00:10:13,960
and it should set up this virtual machine

200
00:10:13,960 --> 00:10:18,913
on my local system as well using that built-in hypervisor.

201
00:10:20,660 --> 00:10:22,700
So let's wait for that to finish.

202
00:10:22,700 --> 00:10:25,280
Of course, if VirtualBox work for you,

203
00:10:25,280 --> 00:10:27,000
you don't need to switch.

204
00:10:27,000 --> 00:10:29,970
I just wanna show all possible scenarios

205
00:10:29,970 --> 00:10:31,550
I'm facing at least

206
00:10:31,550 --> 00:10:34,080
so that hopefully there is at least one scenario,

207
00:10:34,080 --> 00:10:36,250
which also works for you.

208
00:10:36,250 --> 00:10:38,400
And therefore by the end of that,

209
00:10:38,400 --> 00:10:39,460
once that finished,

210
00:10:39,460 --> 00:10:42,570
we should have our running demo cluster

211
00:10:42,570 --> 00:10:46,010
in that virtual machine on our local host.

212
00:10:46,010 --> 00:10:49,463
So let's wait for that installation and set up to finish.

213
00:10:52,330 --> 00:10:54,080
And with that finished,

214
00:10:54,080 --> 00:10:56,690
we are now ready to get started

215
00:10:56,690 --> 00:11:00,690
with Minikube and Kube control on our system.

216
00:11:00,690 --> 00:11:02,680
We can verify that everything worked

217
00:11:02,680 --> 00:11:05,720
by running Minikube status now,

218
00:11:05,720 --> 00:11:08,890
and there we should see a bunch of running,

219
00:11:08,890 --> 00:11:10,543
which I do, which is great.

220
00:11:11,800 --> 00:11:14,390
And you can also get a visual dashboard,

221
00:11:14,390 --> 00:11:17,030
which allows you to look into your cluster

222
00:11:17,030 --> 00:11:19,453
by running Minikube dashboard.

223
00:11:20,510 --> 00:11:24,830
This starts a process which will stay up and running,

224
00:11:24,830 --> 00:11:28,160
and which also opens up a browser tab

225
00:11:28,160 --> 00:11:32,580
with a web application, not created by us or by me,

226
00:11:32,580 --> 00:11:34,810
but instead built into Minikube,

227
00:11:34,810 --> 00:11:37,940
which allows you to look into your cluster.

228
00:11:37,940 --> 00:11:41,120
For example, here, you can see any running pods

229
00:11:41,120 --> 00:11:43,070
of which we have none at the moment

230
00:11:43,070 --> 00:11:45,390
because we haven't used Kubernetes right now

231
00:11:45,390 --> 00:11:48,770
to create a deployment and create any pods.

232
00:11:48,770 --> 00:11:52,200
But this can be useful later to look into the cluster

233
00:11:52,200 --> 00:11:56,243
and see which resources were created by Kubernetes.

234
00:11:57,240 --> 00:11:58,950
For the moment, I'll close this

235
00:11:58,950 --> 00:12:02,543
and stop this process by hitting Ctrl + C twice.

236
00:12:03,720 --> 00:12:07,260
Now that's Minikube and the Kube control tool setup.

237
00:12:07,260 --> 00:12:09,820
And with that, we're ready to proceed

238
00:12:09,820 --> 00:12:13,780
and to finally start working with Kubernetes for the moment

239
00:12:13,780 --> 00:12:16,773
with this local development and dummy cluster.

