Setup a 3-node Kubernetes Cluster from Scratch with Ubuntu 16.04 workstation in VMware Fusion

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
okay so we're gonna install three Linux machines as part of the test environment for kubernetes this is video to show you how to do that on my system I'm running a Mac and I'm running a VMware fusion and so using fusion we're going to install three linux ubuntu 16.04 workstations right so let's do that so here I already have my VMware installed I'm gonna go up to new and I'm gonna install from disk I already have my image added to the folder and this is what I'm using ubuntu 16.04 desktop I'm actually using the workstation just you don't have to use the workstation you can use the server but one thing to keep in mind this is very important you have to use a 64-bit which typically in the description for Linux it says AMD so don't get confused by this I got confused by this and I lost a lot of time I actually built an entire cluster with the 32-bit I 386 Linux images and then you get to a point where Linux installs fine but when you try to install kubernetes it fails and in fact it fails and it doesn't even tell you that it's failing because it's 32-bit so this is very important you have to install 64-bit and the the problem here is that most of the Linux most of the Linux installation media when they refer to 64-bit they don't say I 386 they just say AMD and that got me confused because obviously I have an Intel machine so the point is get a 64-bit Linux if you want to follow exactly I would recommend you get the 16.04 desktop it says AMD 64 and that's what we're gonna use so here we go so we're gonna hit continue the depending on the type of installation you have depending on the type of hypervisor some of these questions may get asked in advance some of these questions get asked after you've installed Linux or during the setup of the actual Linux in this case I haven't even booted the the media yet and VMware fusion is asking me for this kind of information okay so this is interesting that you know depend when you get this you may not get this screen asking you for these credentials this is considered the easy install and so VMware Fusion has a feature where it can prompt me for these things now as opposed to later during the actual setup of the operating system so I'm gonna hit continue it's one other thing I'm gonna do you probably don't have to do this if you are ok with 2 gigabyte 2 gigabytes of RAM and a 20 gig hard drive you should be fine with this but I'm gonna go ahead and I'm gonna change a couple of things I'm gonna change the name of my machines because I'm gonna name them 71 72 and 73 this is just to help me organize myself eventually I'm gonna have many of these and these 71 is actually the last octet of my IP address that I plan to use for these and for me it's just easy for me to identify them based on that number so my cluster number one is gonna have dot 70 1.72 and dot 73 so I'm naming this one to 71 this is actually the file name within my folders not too relevant but I'd like to keep everything consistent okay so the last thing I'm gonna do here is I'm gonna go to processors and because I have enough horsepower here I'm gonna assign two and I'm gonna assign 4096 4 4 gig of ram now I do recommend on the primary or master node that you do give it 4 gig on the second and third nodes you can give 2 gig if you like but because I have the RAM I'm actually gonna go higher in this case ok so we're gonna keep this at 2 cores and 4096 I'm not really specifying any additional features I would recommend just leaving everything at default that's pretty much it I guess the only other thing I can change is my display settings I'm gonna choose the resize option so that I can resize the windows you really shouldn't have to deal with any of the rest of these settings for the VM ok now I'm gonna hit go and now is when the actual installation starts for this particular VM okay now a bunch of 1604 is pretty advanced and pretty slick where it's really not gonna prompt me for much it's gonna go about doing its thing and so in fact what I'm gonna do is I'm gonna start my next machine as well okay so I'm gonna do file new I'm gonna do the second machine at the same time okay so I'm gonna do the same thing that you saw before this for me it's gonna be 72 and like I did before I'm gonna give it two gig and 4096 and my display settings I'm gonna do resize that's pretty much it and then this one is gonna start and in fact I'm gonna do one more now this is just a test environment so I'm not going crazy with the passwords but you probably you could put the password as you like this is my machine number 73 again same deal relatively simple settings and now I have three machines running that are installing okay so if I go back to the first one I'm get this library out of the way you can see that this is almost finished so I'll come back to these once they're finished and I'll show you the settings that we need to do in each one okay so at this point we can see that one of my machines is ready however before I log into it I want to do a couple of things to its network adapter which were not done before so if you you could either do it from here or I'm gonna go to settings and I'm gonna go to network I guess I should have done this before I am going to set this to a different network that I have created this is a NAT network within VMware this is a NAT network in VMware and what this does is I just happen to pick my own subnet from my lab environment I want this as I want this environment to have the 172 16 16 Network so when I numbered the 71 72 73 that was the last octet of this network okay so I'm gonna leave it like this the other thing I like to do just for fun is if you go in here I guess you can't do this when the machine is on so I'll have to shut it off so let's power down the three machines I should have done it earlier so the second one is also done I'm gonna shut it down third one is still shutting down he's still installing anything um so here what we're gonna do is I'm gonna go to settings I'm gonna go to network and I'm gonna do something interesting I'm gonna change the MAC address just the last three octets to match my number okay and this is just for me to be to when I look at the MAC addresses because in kubernetes and in various screens we like to see the MAC address and this just helps me recognize which machine it is that's all really not a big deal but it's just for fun I'm gonna close this and I'm gonna boot this machine up 72 I'm gonna do the same thing so I'm gonna go to rich settings got a network I'm gonna pick this network and I'm gonna change this to 72 okay and this machine also seems to have finished installing so we're going to shut it down this is gonna be 73 okay I'm gonna start it up so here's my three machines position these like this and now there's some work we have to do within each of these before we ever get to installing docker or anything else so first thing I'm gonna do is just set up my shortcuts so I want to put terminal here and I want to put the network settings right here and if we go to terminal you can see that I do not have an IP address okay this is because I changed the MAC address but if you notice at least my MAC addresses are a little bit more obvious sounding so in order to change the IP address you can do this the hard way or the easy way because we have workstation this is probably good if you're not too familiar with Linux this is probably the best Linux for you to use because a lot of the GUI control panels are available so what I'm going to do is we're gonna go in here we're going to go into options and in here we're gonna change this from DHCP to manual the netmask is 24 bit and the gateway is unique for your hypervisor in my case it is dot 2 and I'm going to also install a real internet DNS I'm installing two DNS servers and in my case I'm actually shutting off IP 6 just to make life a little bit simpler here ok so that's pretty much it let's see yes it's already saved no what happened didn't give me an option to save okay so there we go now you could see that my IP is 71 the default gateway to I have my DNS and I should be able to see that here so I have my IP address which is 172 1616 71 I could ping the IP and let's see if we could ping names so there we go okay so let's go fix that on the others and then we'll come back and there's more to do here so we're gonna do term and I'm gonna copy this here I'm gonna do Network and this is the network control panel right so again we're gonna go into the network control panel do options we are going to go to IP for change it to manual add an address this by the way there's just a space in between these IPS don't put any other symbols okay so I'm gonna hit save here and if I go to this I should be able to see my IP is now 72 if you notice my MAC address a little trick that I did is also now 72 s and I can ping and resolve names on the internet so one more there we go so here we're going to hit search terminal Network I'm gonna go into network options IP for manual add this is 73 mask of 24 gateway okay there we go and let's just see that this can that this has the correct information so I have an IP of dot 73 my MAC address is what I had set and there you go I can bring the internet now there's one other thing it's not really written or I didn't really read this that it wasn't obvious to me when I did this but in kubernetes once you install kubernetes a little bit later it's very important that the host names of the machines be unique and resolvable so if you notice I can ping the host name and but that's not magically happening that is happening because there has been a host entry already created the problem is all three of these are the same name so what we have to do is we have to change the names of these so I'm gonna do sudo host name Ubuntu 71 and now I have changed the host name although you see it doesn't show up here until you come back into terminal and you'll see my host name now the problem that have and it's because of this simple change is my name is not resolvable anymore so this is this is going to cause a lot of headache later on if this is not corrected now but the way to correct this is we have to edit the host file so this is what I'm gonna do doe nano space /xe slash hosts and you see how it's giving me trouble already even just running basic commands there's an error that has come up which is you know not relative to what I'm doing but still it's coming up and this is the problem you're gonna have all kinds of weird things if that's not done so here I am and basically all we want to do is change this to the new name that's pretty much it now I like to also add the real IP as part of this and then because I'm using nano you do control X you press Y and you press ENTER and it's done and if you want to just for fun if you want to see what I did these are the two things that I did I edited this one had said it one - I put 71 next to it and then I added another line to represent this particular name now if I do it actually is resolvable this is pretty important for the kubernetes to function properly so let's go do the same thing on 72 so as you notice I change the name and I like to see the name correct so I'm gonna get into terminal again I'm gonna go into here and correct this name make sure you put the correct ip's in here otherwise you're asking for another nightmare okay so this is the this is now 72 whoops so if you hit if you hit control Z by mistake while you're using VI or nano or any other command line tool what happens is you really don't save anything you don't undo anything this is coming just for my windows you know ctrl Z to undo things that I press ctrl Z by mistake right now instead of ctrl X but you notice what happens here the app that I was using which was Nano has been suspended and sent to the background that's what control Z does in Linux if you're not aware of that so in order to bring this back you have to type in FG all by itself which basically brings the background app to the foreground that's what FG is and I'm back where I was and I can do the correct control X which is what I wanted and then you get this prompt here and you press Y press ENTER and I like to make sure that it worked okay so here is my two lines that I did and I can now ping this machines hostname one more here we go this is now my machine number 73 okay so now I have that name I'm gonna go into the host file and we're gonna do the same thing 73 so there we go now remember control X not control Z Y enter and you can see that I have this and then the last thing is to paying put 273 there we go now if you were using mini cube or there's there's a couple of systems where you can have a full kubernetes cluster on one node then the part of that instructions for setting up that type of thing is you do need to have the host name and the IP you need a host entry for each of the three nodes on all three nodes okay and that is because you're not really running a full DNS in that mini cube environment and so you each of the three nodes really needs to have a host entry in our case when we install kubernetes we're actually gonna have DNS helping us and so you don't really need to do that right now right now all I did is each of the three nodes just has its own name corrected that's really it if you well you're gonna have to correct the names because you don't want three machines with the same name all right so this process is gonna happen now because there is an 1804 Ubuntu out I'm getting this message I'm gonna say don't upgrade on all three of them because we want to stick with 1604 not 1804 the reason we're sticking to 1604 is because 1804 is relatively you know obviously two years newer that's what the eighteen stands for it's the year 2018 that it came out this is from 2016 but some of the other versions of kubernetes and other components that I install may not work correctly on 1804 so if you want the easiest painless method of following along with me I would suggest you stick with 1604 because then at least the versions that I use for docker and kubernetes and for everything else if you stick to the same versions that I'm providing you should not have any trouble right or at least any incompatibility so so far we have three Linux machines installed we have simply given them three IP addresses and we also have corrected their host names in the systems okay so the next step is gonna be to go on and update all three I'll come back in the next video for that
Info
Channel: Haresh M Advani
Views: 679
Rating: 2.8666666 out of 5
Keywords: Setup Ubuntu 16.04 workstation/desktop from scratch in VMware Fusion 11.5 on MacBook Pro 2019
Id: FzGhtjPyJ1g
Channel Id: undefined
Length: 21min 29sec (1289 seconds)
Published: Sat Dec 28 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.