AWS EKS - Create Kubernetes cluster on Amazon EKS | the easy way

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
many of you have requested a video about aws eks or elastic kubernetes service so that's what we'll be covering in this video we'll go through what is eks how to use it and the actual demo of creating a kubernetes cluster with eks the easy way for a quick overview aws is one of the most popular cloud platforms which has a tons of services for different use cases and eks elastic kubernetes service is just one of those many services so what is eks it is a managed kubernetes cluster meaning aws will manage the master nodes for you it will create the masternodes install all the necessary applications on them like container runtime kubernetes master processes it will take care of scaling it when needed doing backups on that etc so if you have a small team of people then usually it's a good idea to let the platform do this maintenance for you so you can focus on deploying your applications in kubernetes without worrying about whether masternodes are properly backed up etc this means you only create and worry about the worker nodes so let's see how you can use eks suppose you and your team have a small project which you want to run in kubernetes and you want to do that with eks in order to create the cluster with eks they're following steps involved before you even create a cluster you need to do some setup or preparation first of all obviously you need to create an aws account there is a free tier for one year when you're a new user so you can take advantage of that then you have to create or have a vpc it's basically your virtual private space in aws basically a space where you do your own stuff it doesn't interfere with other aws users in the cloud that's basically what vpc is then you have to create an iam role with security group these two terms in my opinion are too obscure so here's a human translation for you you have to create an aws user with a list of permissions permissions to create and do stuff with eks service once you have these things set up now you can go and create the control plane of the cluster meaning the masternodes you create the cluster with the aws role or this iam role which obviously has to have a permission to create and configure the eks cluster here just choose some basic information like name of the cluster which kubernetes version you want which region your cluster should run in and so on you set some security for your cluster and note that you can do this setup or creating the cluster process you can do that either using aws ui or management console or aws command line the next step once you have the control plane once aws creates all these master nodes you have to create worker nodes and connect that to cluster on aws these worker nodes will be some ec2 instances with certain cpu ram and storage resources so how do we create worker nodes and add them to the cluster we create them as node group or group of nodes and not a separate ec2 instances when you create a node group you choose the cluster it will attach to or join to you define also security group for that you select the instance type of ec2 instances so basically you choose which resources your ec2 instances should have and with node group you also have auto scaling which is pretty cool because based on your needs or based on the cluster needs depending on how much load the cluster has new worker nodes will automatically be added or removed in the cluster so for that you define maximum and minimum number of nodes so maximum number of nodes it should scale up to and minimum number of nodes it should scale down to and you have some other configuration as well and once you create the node group as well so you have your worker nodes connected to the cluster finally you will connect to the cluster from your local machine right because you want to deploy your applications from your laptop or local computer using cubectl which is kubernetes command line tool so in this step you basically configured cube ctl to talk to the remote cluster now at this point as i have listed all the stuff that you have to do in order to create a cluster you may be thinking that's a lot of effort for just creating a simple kubernetes cluster maybe you're not very good at aws you're just starting off and you don't want to learn all these services you already have kubernetes to learn you just want to create a cluster and start deploying your containers inside as fast as possible and you're right i think it's relatively complex compared to other managed kubernetes services like linux kubernetes engine or digital kubernetes service but aws is of course very powerful and that increases the complexity and also it's one of the most popular providers so for example at work or in your projects you might have to use it but the good news is there is a way to simplify this process of creating a cluster on aws much faster and more efficiently without having to do all of these one by one manually and you can do that with a command line tool called eks control it is not an aws tool it is from webworks actually and has a lot of contributors from community now i'm a huge fan of understanding the concepts of how a technology works its architecture and what's going on behind the scenes but if there are tools that make working with this technology much easier then i like to use them usually these are tools that are created by community or people that know this technology better than me or who are specialized in that so it makes sense to use that knowledge why reinvent the wheel so in the demo we will create kubernetes cluster using eks control tool so basically the advantage of eks control tool is that instead of going through all of these steps that i mentioned in creating these services and configuring all this stuff one by one manually either on management console or from the command line instead you just execute one single eks control command that basically does all of that in the background for you and you don't have to configure anything because it uses all these default values of course if you want to customize some stuff like set the cluster name or fixate kubernetes version or define which note types you want in your note group you can override all these different values using parameters but you still have just one comment so with that let's jump into the demo and see eks in action so the first step is to install eks control so that we can create a cluster using that tool and as i mentioned it's from weave works so we're gonna first install the weaveworks homebrew tab and now we can install the eks control and as you see it's also installing some of the dependencies like here this is the cube ctl aws im authenticator and some other dependencies and now we can actually check that it was successfully installed by executing just the version command and here we have the version as a next step we'll create a cluster using the eks control here you see in the amazon eks i have no clusters it's empty so we're gonna go and create one important to note here that eks control command has to connect and authenticate with aws in order to create the cluster this means before you can execute this command you have to have your aws user credentials locally in the path like this i put a link in the description how to do that and how to configure that so you can go and set it up first and command for that is eks control create cluster and this command would actually be enough this will create a cluster with all the defaults but you can override all multiple values using parameters so we are gonna do that just to demonstrate so first of all i'm gonna overwrite the name we're gonna call it test cluster let's also set a version of kubernetes we can also um define a region usually it's the one that's nearest to you so i'm going to choose eucentral one that's my nearest zone or region and these are basically the cluster information in addition to that we also want to create worker nodes right and the worker nodes are created in a group as i mentioned so we are going to add some parameters for that node group as well so we're going to give it a name first of all let's call it linux nodes and we can also define type of worker nodes or basically types of ec2 instances because they will become worker nodes when creating ec2 instance you usually have this type to select so you have different types depending on how much resources this virtual server has so it starts with the lowest resources and you have type with much more resources this is just a demonstration so i'm going to go with t2 micro this is one of the smallest and i'm gonna set the type here and the last thing that we are gonna define is number of worker nodes that i want in that note group to connect to the cluster so we'll set it to two it should be enough and i'm gonna execute it and here you see a lot of stuff start to happen it's building a cluster first of all it's created all the subnets and vpc and all this stuff in the background i don't have to worry about all this stuff and if i go back to my cluster overview soon enough i should see a cluster appearing here so this will actually take uh quite some time because aws eks cluster creation takes relatively longer so we're gonna wait until the cluster is ready so one thing to note here is that this command gets executed with the aws user credentials that have stored locally so basically that user will be able to later access the cluster make changes to that etc so maybe to note so that you know which user to execute this command with now as you see eks control is great for creating a cluster on eks but if you will be managing several clusters or just prefer a graphical user experience to a command line tool numata our sponsor who made this video possible provides a web console for simplified provisioning of eks also after you provision a kubernetes cluster on eks the maintenance and management part begins you need to provide proper backups and restore optimize resources and so on nurmata eks manager solves these day two kubernetes operations pain points by providing a simplified management across all your eks workloads and clusters nirmata made a special offer for my followers the first 30 signups get three months free check out in the video description for more info so let's get back to our cluster so the cluster was created and here you see now the node group is getting created with those two nodes that we defined here so if i go back again and i refresh this see cluster active and there's some data that we already see here so now the ec2 instances are creating so when they're ready we should see them here and this part will also take some time so the node group was also created as you see here it has two nodes in that and it should be connected with the cluster already so if i go back let's refresh this you see we have two ec2 instances running another thing that you can also see here is that cube config this is basically a file that is generated whenever you create this cluster so basically this is a file that is information about the cluster so that cubectl on your local machine can connect to that remote cluster so it will include the endpoint of the cluster the certificate and some other details and here you see it has been saved in this location and now when i execute cubectl i can actually use that config to connect to the cluster so here you see cube ctl command should work with config so basically the config is already set we don't have to pass it as a parameter so if i do cube ctl get notes i get my worker nodes listed here so they're both ready and here's the kubernetes version that we set so basically we have a cluster we're connected to that with using cubectl and we can actually start deploying applications inside doing queries in the cluster and so on so as you saw just right now using the eks control tool makes it super easy to create and deploy kubernetes cluster on aws eks where you don't have any effort of creating all these components by yourself it's all done automatically in the background and if i'm done with a cluster for example if it's a test cluster i can pretty easily delete the cluster and all the resources that were created here the easy2 instances the note group and all this stuff it will be all cleaned up in the background using the tool so i'm going to do eks control delete cluster and we just need a cluster name we call it test cluster and if i execute this this also took a while and here you see all cluster resources were deleted so if i go back here and reload this i should see deleting status as well as for my ec2 instances so everything is terminating deleting you don't have to interfere and do anything manually which is good but as i said this process takes some time so to recap we went through what eks services on aws two different ways of creating a cluster or kubernetes cluster with the elastic currently service and you also saw a demo of how to actually create the cluster using the second the easier way using eks control tool with that thank you for watching and see you in the next video
Info
Channel: TechWorld with Nana
Views: 389,068
Rating: undefined out of 5
Keywords: aws eks, eks aws, amazon eks, aws eks tutorial, aws eks kuberenetes tutorial, aws eks example, kubernetese on aws, kubernetes aws, kubernetes aws setup, kubernetes aws tutorial, kubernetes cluster on aws, setup kubernetes cluster on aws, aws kubernetes, aws kubernetes tutorial, aws kubernetes setup, how to setup kubernetes cluster on aws, how to setup kubernetes in aws, aws eks explained, techworld with nana, kubernetes on cloud, kubernetes cloud, kubernetes tutorial
Id: p6xDCz00TxU
Channel Id: undefined
Length: 16min 26sec (986 seconds)
Published: Fri Sep 11 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.