JavaRush /Java Blog /Random EN /Who are Docker, Kubernetes, OpenShift and how are they re...
Павел
Level 11

Who are Docker, Kubernetes, OpenShift and how are they related to each other?

Published in the Random EN group
It all starts with packaging. In industrial development, there is a need to “package” the assembled application, for example, so that it can be transferred to the server where it will work, in the form in which the developer assembled it on his computer, such “packaging” should serve as a kind of protection . This eliminates surprises, such as when an application works during a test, but breaks when transferred to production. Also, “packaging” isolates one application from another, located on the same server, such isolation allows one application not to interfere with the work of another (for example: one application will not be able to take over all the server’s RAM, leaving the second application to its fate). The advantages of “packaging” with a microservice architecture are especially noticeable, and this is understandable; there are many microservices - many small applications that must communicate with each other, but at the same time should not interfere with each other. An example is a chest of drawers (server), in which there are many different drawers, and we can easily move different socks from one drawer to another, and at the same time they will not mix with each other or with panties. Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 1 The packaging is created by virtualization tools. Once upon a time, virtual machines (VMs) were used as “packaging”. Old people will remember how they deployed Windows XP on Vista in a virtual machine. Now VM for application packaging is a thing of the past. Containers have taken over the world. Because they are: lighter, more productive and safer. In more detail: how is a container different from a virtual machine? Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 2 You need to remember some advantages of containers: • they are smaller in size (take up less memory on the server); • have access to shared server resources (RAM, processor computing time); • have better portability to other environments (from test to industrial); • provide higher launch speed (since the container is lightweight, it launches faster). Docker is the mother of containers. When they say container, they mean Docker. Docker is software for automating the deployment and management of applications in containerized environments. Using examples, Docker is a cross between an online designer and a 3D printer with a crane. That is, he can first design a template (image) for a container, print (create) the container according to given conditions (image), and then move it wherever needed. Dockerfiles are used instead of levers. The management process is simple: you write files, commands, run them, and see what happens. Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 3 First acquaintance with Docker Docker Compose - upgraded Docker Now let's look at a scenario where multiple containers need to be running in a location. The utility used for this is Docker Compose. Docker Compose is a tool included with Docker. It is designed to solve problems related to project deployment. Difference between Docker and Docker Compose: Docker is used to manage individual containers. Docker Compose is used to manage multiple containers simultaneously. This tool offers the same capabilities as Docker, but allows you to work with more complex structures. Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 4 Typical scenario for using Docker Compose: Imagine that you are a developer of a web project. This project includes two websites. The first allows business people to create online stores with just a few clicks. The second is aimed at customer support. These two sites interact with the same database. Your project is becoming more and more popular, and it turns out that the power of the server on which it runs is no longer enough. As a result, you decide to move the entire project to another machine. If you haven't used something like Docker Compose, then you'll have to migrate and reconfigure containers one at a time, hoping that you won't forget anything in the process. If you use Docker Compose, then moving your project to a new server is a matter that can be solved by running a few commands. In order to complete the transfer of the project to a new location, you only need to make some settings and upload a backup copy of the database to the new server. Typical DockerComposer: Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 5 What you need to remember here: Containers are the main means for “packaging” applications. Docker handles containers, creates container images, picks up and moves containers. To simultaneously manage a bunch of containers, Docker Compose is used, which is included in Docker. These programs are free software (freebies - in a word) Kubernetes (K8s) - Docker automation And so we deployed containers, we know how to transfer them “in batches” from machine to machine. But suddenly one of the containers fell! What to do? Who will raise it again? Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 6 Of course, you can do this manually, via Docker. But you have to do something, write something, you need some kind of automation tool. This is where Kubernetes (abbreviated K8s) comes into the picture, it will also deal with the management and orchestration (automated management of related entities) of containers. With K8s at your disposal, you don’t need to monitor containers day and night. It is enough to define the behavior scenario, and K8s will do everything itself. Key features of Kubernetes 1. Provides scalability and management of your configuration. 2. You can describe what you want to get when deploying a cluster, and K8s will do it. For example, specify the number of pods, how much memory to allocate for them, indicate the number of replicas (instances) of applications deployed (in containers) on pods. 3. Responsible for maintaining the system in a certain state; if something falls, then K8s will pick it up, according to the established configuration. What you need to remember here: Kubernetes is a tool for orchestrating containerized applications - automating their deployment, scaling and coordination in a cluster. Supports major containerization technologies, including Docker. K8s is open-source software. Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 7 OpenShift is a Ferrari in the world of virtualization, cool, fast and expensive Developing the topic, let’s move on to OpenShift. OpenShift is an add-on to Kubernetes that offers additional functions. It is immediately ready to use, it does not require long and painful configuration, and can be immediately put into production. Look how many different icons there are above Kubernetes. And each of them does their own cool things. Who are Docker, Kubernetes, OpenShift and how are they related to each other?  - 8 OpenShift highlights: • It is a paid product, unlike K8s; • DevOps out of the box, support for basic blue/green, canary deployment scenarios; • Built-in Jenkins support; • Provides convenient tools for administering and working with the cluster; • Has a more stringent security model and built-in monitoring. It is worth emphasizing once again that OpenShift is a paid product, unlike Kubernetes. The difference is this: if we take bare Kubernetes, then we solve all the problems ourselves. If we talk about OpenShift, it is a product of Red Hat, which solves emerging problems as part of paid support. Let's summarize: In industrial development there is a need to “package” the application; this approach is especially relevant in microservice architecture. Containers are the primary means of packaging applications. Docker handles containers, creates container images, picks up and moves containers. To simultaneously manage a bunch of containers, Docker Compose is used, which is included in Docker. These programs are free software. Kubernetes(K8s) is a tool for orchestrating containerized applications - automating their deployment, scaling and coordination in a cluster. Supports major containerization technologies, including Docker. K8s is open-source software. OpenShift is an add-on to Kubernetes that offers additional functionality. This is a paid product, unlike K8s, intended for corporate use. Provides DevOps out of the box: support for the main deployment scenarios blue/green, canary, has built-in support for Jenkins and provides convenient tools for administering and working with the cluster. Has a more stringent security model and built-in monitoring. For those who are itching to code: Package a Spring Boot application into a container How to deploy Postgres in Docker and connect to a Spring-Boot application Webinar: Docker - How to work with containers? — Backend development in Java
Comments
TO VIEW ALL COMMENTS OR TO MAKE A COMMENT,
GO TO FULL VERSION