Kubernetes for Beginners - Docker Introduction in 15 Minutes

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to this lecture on kubernetes overview my name is moon shot' monomyth and we are learning kubernetes for beginners in this lecture we will go through an overview of kubernetes kubernetes also known as k-8 was built by Google based on their experience running containers in production it is now an open source project and is arguably one of the best and most popular container orchestration technologies out there in this lecture we will try to understand kubernetes at a high level to understand kubernetes we must first understand two things container and orchestration once we get familiarized with both of these terms we would be in a position to understand what kubernetes is capable of we will start by looking at each of these next we're now going to look at what containers are specifically we will look at the most popular container technology out there that is docker if you are familiar with docker already feel free to skip this lecture and move over to the next hello and welcome to this lecture on docker overview my name is moonshot monomyth and we are learning docker fundamentals in this lecture we're going to look at a high-level overview on why you need docker and what it can do for you let me start by sharing how I got introduced to docker in one of my previous projects I had this requirement to set up an end-to-end stack including various different technologies like a web server using node.js a database such as MongoDB a messaging system like Redis and an orchestration tool like ansible we had a lot of issues developing this application with all these different components first there compatibility with the underlying operating system we had to ensure that all these different services were compatible with the version of the operating system we were planning to use there have been times when certain version of these services were not compatible with the OS and we've had to go back and look for another OS that was compatible with all these different services secondly we had to check the compatibility between these services and the libraries and dependencies on the OS we've had issues where one service requires one version of a dependent library whereas another service required another version the architecture of our application changed over time we've had to upgrade to newer versions of these components or change the database etc and every time something changed we had to go through the same process of checking compatibility between these various components and the underlying infrastructure this compatibility matrix issue is usually referred to as the matrix from hell next every time we had a new developer on board we found it really difficult to set up a new environment the new developers had to follow a large set of instructions and run hundreds of commands to finally set up their environments they had to make sure they were using the right operating system the right versions of each of these components and each developer had to set all that up by himself each time we also had different development tests and production environments one developer may be comfortable using one OS and the others may be using another one and so we couldn't guarantee that the application that we were building would run the same way in different environments and so all of this made our life in developing building and shipping the application really difficult so I needed something that could help us with the compatibility issue something that will allow us to modify or change these components without affecting the other components and even modify the underlying operating system as required and that search landed me on docker with docker I was able to run each component in a separate container with its own libraries and its own dependencies all on the same VM and the OS but within separate environments or containers we just had to build the docker configuration once and all our developers could now get started with a simple docker run command irrespective of what the underlying operating system they run all they needed to do was to make sure they had darker installed on their systems so what are containers containers are completely isolated environments as in they can have their own processes or services their own networking interfaces their own mounts just like virtual machines except they're all shared the same operating system kernel we will look at what that means in a bit but it's also important to note that containers are not new with docker containers have existed for about 10 years now and some of the different types of containers are alexei LX d LX EFS etc docker utilizes lxc containers setting up these container environments is hard as they're very low-level and that is where docker offers a high level tool with several powerful functions making it really easy for end-users like us to understand how docker works let us revisit some basic concepts of operating systems first if you look at operating systems like Ubuntu Fedora SUSE or st. OS they all consist of two things an OS kernel and a set of software the operating system kernel is responsible for interacting with the underlying hardware while the OS kernel remains the same which is Linux in this case it's the software above it that makes these operating systems different this software may consist of a different user interface drivers compilers file managers developer tools etc so you have a common Linux kernel shared across all operating systems and some custom software that differentiates operating systems from each other we said earlier that docker containers shared the underlying kernel what does that actually mean sharing the kernel let's say we have a system with an Ubuntu OS with docker installed on it docker can run any flavor of OS on top of it as long as they are all based on the same kernel in this case Linux if the underlying operating system is Ubuntu docker can run a container based on another distribution like debian fedora SUSE or st. OS each docker container only has the additional software that we just talked about in the previous slide that makes these operating systems different and docker utilizes the underlying kernel of docker host which works with all the operating systems above so what is an OS that do not share the same kernel as this Windows and so you won't be able to run a windows-based container on a docker host with Linux OS on it for that you would require a docker on a Windows server you might ask isn't that a disadvantage then not being able to run another kernel on the OS the answer is no because unlike hypervisors docker is not meant to virtualize and run different operating systems and kernels on the same hardware the main purpose of docker is to containerize applications and to ship them and run them so that brings us to the differences between virtual machines and containers something that we tend to do especially those from a virtualization background as you can see on the right in case of docker we have the underlying hardware infrastructure than the operating system and docker installed on the OS docker can then manage the containers that run with libraries and dependencies alone in case of a virtual machine we have the OS on the underlying hardware then the hypervisor like ESX or virtualization of some kind and then the virtual machines as you can see each virtual machine has its own operating system inside it then the dependencies and then the application this overhead causes higher utilization of underlying resources as there are multiple virtual operating systems and kernels running the virtual machines also consume higher disk space as each VM is heavy and is usually in gigabytes in size whereas docker containers are lightweight and are usually in megabytes in size this allows docker containers to put up faster usually in a matter of seconds whereas virtual machines as we know takes minutes to boot up as it needs to put up the entire operating system it is also important to note that docker has less isolation as more resources are shared between containers like the kernel whereas we amps have complete isolation from each other since millions don't rely on the underlying operating system or kernel you can have different types of operating systems such as Linux based or Windows based on the same hypervisor whereas it is not possible on a single docker host so these are some differences between the two so how is it done there are a lot of containerized versions of applications readily available as of today so most organizations have their products containerized and available in a public docker registry called docker hub or docker store already for example you can find images of more common operating systems databases and other services and tools once you identify the images you need and you install docker on your host bringing up an application stack is as easy as running a docker run command with the name of the image in this case running a docker run ansible command will run an instance of ansible on the docker host similarly run an instance of MongoDB Redis and node.js using the docker run command when you run nodejs just point to the location of the code repository on the host if you need to run multiple instances of the web service simply add as many instances as you need and configure a load balancer of some kind in the front in case one of the instances was to fail simply destroy that instance and launch a new instance there are other solutions available for handling such cases that we will look at later during this course we've been talking about images and containers let's understand the difference between the two an image is a package or a template just like a VM template that you might have worked with in the virtualization world it is used to create one or more containers containers are running instances of images that are isolated and have their own environments and set of processes as we have seen before a lot of products have been docker eyes already in case you cannot find what you're looking for you could create an image yourself and push it to the docker hub repository making it available for the public if you look at it traditionally developers developed applications then they hand it over to ops team to deploy and manage it in production environments they do that by providing a set of instructions such as information about how the house must be set up what prerequisites are to be installed on the host and how the dependencies are to be configured etc the ops team uses this guide to set up the application since the ops team did not develop the application on their own the struggle with setting it up when they hit an issue they work with the developers to resolve it with docker a major portion of work involved in setting up the infrastructure is now in the hands of the developers in the form of a docker file the guide that the developers built previously to set up the infrastructure can now easily be put together into a docker file to create an image for the applications this image can now run on any container platform and is guaranteed to run the same way everywhere so the ops team now can simply use the image to deploy the application since the image was already working when the developer built it and operations are not modifying it it continues to work the same way when deployed in production to learn more about containers check out my other courses docker for the absolute beginners and docker swarm where you can learn and practice docker commands and create docker files that's the end of this lecture on containers and docker see you in the next lecture
Info
Channel: KodeKloud
Views: 905,616
Rating: 4.8710527 out of 5
Keywords: kubernetes, docker, udemy, course, tutorial, beginners, kubernetes tutorial, kubernetes in 15 minutes, kubernetes for beginners, kubernetes and docker, kubernetes for devops, docker for devops, devops tools, docker explained, kubernetes explained, kubernetes architecture, docker architecture, docker networking, kubernetes installation, kubernetes deployment, kubernetes demo, docker deployment, kubernetes course, kubernetes free online, kubernetes and docker classes
Id: rmf04ylI2K0
Channel Id: undefined
Length: 14min 3sec (843 seconds)
Published: Sat Jun 09 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.