Kubernetes Components you need to know in 10 minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey what's up everyone and welcome to daily code buffer in this video we are going to see all the basic components of kubernetes so you can start working on kubernetes and create the powerful applications so let's get started so the smallest unit of kubernetes is a pod so let's take an example of a java application that is connected to mysql database or mongodb database or radius database anything so considering one java application either a springboard application or a normal java application and a database so we have two applications both of them are in a different container so we can deploy both the containers into a individual pots so we'll be creating a two parts one part for the application and one part for the database and we'll be deploying that two parts to our kubernetes cluster so that means our part is the abstraction for our containers so generally one part will contain the one application means one container so on the creation of pod each pod will be getting its own ip addresses so internally within the virtual network they both can be connected using their internal ip address that are created so they will be connected using that internal ip address which is created so suppose any issue happened and that part is died and the new port is created so new ip address will be created for that particular part so in that case the configurations will be difficult now right because earlier you have already configured your application to work on that internal ip which was already there now the new pod is created so you have to configure again to work on that particular new api address so in that case the other component service comes into picture service is a abstract layer for exposing the apis so what we'll be doing is we'll be creating a services for the parts that we have created both the service and the parts have its own different lifecycle so whenever a part is destroyed service will remain intact so whenever there is a new parts created based on the scalability or based on the availability of the configuration all will be connected to that particular service and our multiple applications will be connected via that service which has been exposed not the ip address so the configuration will be taken care using these service endpoints that we created so that will solve the issue that we had earlier using the ip address so now services can be internal service or the external service so suppose your application can be accessed from outside your kubernetes cluster so for that you will be creating your external service and for your database you will be creating your internal service because from the outside you should not be allowed to access your database your application can directly access your database from the internal service that you have created so when you create the external service that external service will be having the ip address and the port details but that is not the way you want to share your applications to the users you want a particular dns name or a domain name that you want to share so how it can be handled when a user tries to hit that particular domain name or a dns name then from that domain name your ip address has been resolved and it will be called your application so in that case ingress components comes into picture so what you will be doing you will be creating one ingress component for your service so it will resolve your request so whenever a request is coming to that particular wing dress using a domain name or a dns name it will resolve that to your internal application deployed to your kubernetes cluster so there will be one extra layer on top of your service that is your ingress and all our services are load balanced as well so if you have multiple parts deployed to your kubernetes cluster and all those ports are connected to a single service so that service is a load balance so that it will internally decide to which application that request has to be passed and internally it will resolve the requests so suppose we have our application and we have our database both in their individual pods and if we change our database so entire configuration is been changed so our application has to now connect to the new database that we have created to connect to so typically we have created all those configuration like our application should be connected to this database inside our application properties file so to change those properties files we have to again rebuild our application we have to again deploy our applications and all our parts into our cluster so that's a very tedious process so what we can do is we can use the another kubernetes component that is config map all our connection details all our external configuration we can create in a config map and we can connect that config map to our application so that whenever there is a change in the configuration we just have to change in the config map and kubernetes will takes care of everything and all our application will work consistently so this way we can introduce the config map in our cluster as well so there will be a scenarios like you have to store your credentials you have to store your password in your application so to store all those password in a config map in a plain text is not feasible that's a security risk as well so to store all of these things there is another component in kubernetes that is secrets so secrets will be storing all your credentials all your data in a b64 encoded format so you can store all your credentials all your private informations that no one should access to in these secrets and you can deploy that secrets into your kubernetes clusters now we saw that whenever there is an issue in the parts that pod is destroyed and the new part is created right so consider if there is an issue in your database pod and that database pod is destroyed in the new database part is created so all your data has been destroyed all your data has been deleted but that's not what you want right you have to store your data and whenever new part is created that new part should be having all those data that earlier it was having so to achieve that we have another component that is volumes so you can use kubernetes volumes to store all those persistent data so suppose all your database all your mongodb database all your file systems for all of that you can create the volumes and you can attach those volumes to your kubernetes components what is the volume volumes are nothing but your external storage your hard drives or any of the storage provided by your local provided by your on-premise provided by your cloud provider so in that volumes also there are two types either you can create a volumes locally inside a kubernetes cluster or you can create a remote volume to any of the cloud provider you can attach those storage to your kubernetes cluster so now by any chance consider that your pod is destroyed your main application pod is destroyed and new pod has been created so it will take some time to create a new port and meanwhile any user is trying to access that application they won't be able to access that application so the purpose of high availability and high scalability is not yet achieved so to achieve that high availability like whenever a pod is restored and a new pod is created you should be having a replica of it right so what you can do is you can create the entire replica of your application like the pods the services the database parts and everything and you can replicate all of those things right and you can connect all those replicas to your services as the services are load balanced so to make the replicas of your application deployments comes into picture so deployment is the another kubernetes component that is the abstraction for your entire applications so like what is the abstraction for your containers and deployment is the abstraction for your entire applications like you'll be having different parts different services ingress and everything so entire thing can be abstract in a single deployment and in that deployments you can specify the replication factors like how many replicas you want to create how you want to upscale how you want to downscale your applications and all those informations you can define in your deployments now if you're using deployments for your application that is fine let it be creating your multiple instances for it and all of those instances are created or connected using the services but what about database if you are creating database using the deployments then multiple instances of the database will be created and the synchronizations won't be happening so there will be a duplication of data as well in your database so you don't want your databases or your stateful apps to be running using the deployments so to do that there is a different component there is another component that is stateful set so stateful set is more used when you are working with databases or the data that has to be synchronized across all your replicas but to set a stateful set is more complex and more tedious task than to do a deployment so mostly what has been preferred or what i can suggest you is you can do deployments for your stateless application like for all your application you can do deployment and you can do replicas and everything on that but for your databases and your persistent storage i suggest you to do the externalizations create the database separately from your kubernetes cluster so it is easy to maintain and easy to connect all your applications so that's it these are all the basic components of kubernetes architecture so if you know all these components and you know how to work with these components then you can create a pretty powerful applications out of it so if you like this video give us a thumbs up and subscribe to my channel for the upcoming videos till then happy coding see you [Music]
Info
Channel: Daily Code Buffer
Views: 2,716
Rating: undefined out of 5
Keywords: kubernetes, k8s, kubernetes tutorial for beginners, kubernetes basic concepts, k8s explained, kubernetes components, kubernetes components explained, kubernetes deployment, what is configmap in kubernetes, what is configmap, kubernetes service, kubernetes configmap, kubernetes services, kubernetes secrets, kubernetes pods, what are kubernetes pods, kubernetes for beginners, kubernetes explained, what is kubernetes, dailycodebuffer, daily code buffer, kubernetes architecture
Id: ivDzqrCfC2Y
Channel Id: undefined
Length: 9min 2sec (542 seconds)
Published: Mon Dec 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.