From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Docker vs. Kubernetes

From the course: Cloud Native Development with Node.js, Docker, and Kubernetes

Start my 1-month free trial

Docker vs. Kubernetes

- [Instructor] Earlier in the course we showed how you can take your app and package it using a Docker file into a Docker container. And how that can then be used to run the Docker container on another machine, and that other machine could be a cloud. But at this point we only have a single instance of our application running in a single container. To go beyond that this is where Kubernetes comes in. Kubernetes will let us run multiple instances of the same container and load balance any incoming request across the multiple instances. It will also allow us to connect to other things. That might be something as simple as a database or it might be another application or microservice. And Kubernetes will also let us to integrate with cloud capabilities. Things like authentication, monitoring and logging. Kubernetes is the container orchestrator that was originally developed to Google and which was subsequently open sourced and donated to the CNCF, the Cloud Native Computing Foundation. Kubernetes is now also backed by almost all the cloud providers and used by some of the world's biggest companies. Kubernetes provides support for deploying multiple containers and replicas. It also provides support for service discovery load balancing, self healing which means restarting on failures, as well as secret and configuration management and allowing you to roll out, roll back and scale horizontally to more instances based on load. Kubernetes can be installed locally on your desktop in multiple ways. The easiest way of doing that is using Docker for desktop. To do that we can go to our Docker logo in the top right hand corner of our desktop. From here we can click on preferences. Here there are two tabs of interest. The first is the advanced tab. This can be used configure how much CPU and memory is available to our Docker in Kubernetes instance. Make sure that you have at least six CPUs and eight GB worth of memory or less available and hit apply and restart if you need to. Once you've done that click on the Kubernetes tab. In order to enable Kubernetes, you simple need to click the enable Kubernetes button and hit apply. This will now install a Kubernetes cluster and download the required images to be able to do that and start Kubernetes for you, running directly in Docker for desktop, so that you can use it on your laptop. Now that Kubernetes is installed, we can close the panel. In our Docker menu, we also have access to configurations for Kubernetes. These are called context. The Docker-for-desktop context is our local Kubernetes runner as part of Docker-for-desktop. You can also configure remote Kubernetes clusters such as running in a public cloud. And those will show up under context as well and you can change context for everything that you do to work with remote Kubernetes rather than a local one. As well as installing Kubernetes, it's also installed the Kubernetes CLI. The Kubernetes CLI is is called kubectl. Kubectl minus h it gives us the health, which is all of the commands that we can do. This gives us a comprehensive set of things that we can do to work with Kubernetes. And it also provides a set of online help. We can visit that page to see quite a lot of documentation on how to use Kubernetes. This may look somewhat overwhelming and daunting but don't worry, in the next videos we're going to start to show you how easy it can be to take your app and deploy it to Kubernetes.

Contents