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?

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 has assembled it on his computer, such “packaging” should serve as a kind of protection . This eliminates surprises, such as when the application works during the test, but when transferred to the production environment, it breaks. 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 all the server’s RAM, leaving the second application to fend for itself). The advantages of “packaging” with a microservice architecture are especially noticeable, it’s understandable, there are a lot of microservices - a lot of small applications that need to communicate with each other, but they should not interfere with each other. An example is a chest of drawers (server), in which there are many different drawers, and we can safely shift different socks from one drawer to another, and at the same time they will not mix with each other or with shorts. Who are Docker, Kubernetes, OpenShift and how are they related?  - 1 Packaging is created by means of virtualization. Once upon a time, virtual machines (VM) were used as "packaging". Olds will remember how they deployed Windows XP to Vista in a virtual machine. Now the VM for packaging applications is the last century. 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?  - 2 There are some advantages of containers to keep in mind: • they are smaller (take up less memory on the server); • have access to shared server resources (RAM, CPU time); • have better portability to another environment (from test to production); • provide faster startup speed (because the container is lightweight, it starts up 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. If using examples, then Docker is such a mixture of an online designer and a 3D printer with a crane. That is, he can first design a template (image) for the container, print (create) the container according to the specified conditions (image), and then move it where necessary. Dockerfiles are used instead of levers. The management process is simple: you write files, you run commands, you see what happens. Who are Docker, Kubernetes, OpenShift and how are they related?  - 3 First acquaintance with Docker Docker Compose - pumped Docker Now let's look at a scenario where multiple containers need to work in place. To do this, use the utility - Docker Compose. Docker Compose is a tool included with Docker. It is designed to solve problems related to the deployment of projects. Difference between Docker and Docker Compose: Docker is used to manage individual containers. Docker Compose is used to manage multiple containers at the same time. This tool offers the same features as Docker, but allows you to work with more complex structures. Who are Docker, Kubernetes, OpenShift and how are they related?  - 4 Typical Docker Compose use case: Imagine that you are the developer of a web project. This project includes two websites. The first allows business people to create, with just a few clicks, online stores. 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 capacity of the server on which it works is no longer enough. As a result, you decide to transfer the entire project to another machine. If you have not used something like Docker Compose, then you will have to migrate and reconfigure containers one at a time, hoping that you will not forget anything in the process of this work. If you are using Docker Compose, then moving your project to a new server is a matter of which is solved by executing several commands. 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?  - 5 Things to remember: Containers are the primary means for "packaging" applications. Docker handles containers, creates container images, lifts and moves containers. To manage a bunch of containers at the same time, Docker Compose is used, which is included with Docker. These programs are freeware (freebie - in a word) Kubernetes (K8s) - Docker automation And so we deployed containers, we know how to transfer them in “packs” from machine to machine. But suddenly one of the containers fell! What to do? Who will pick it up again? Who are Docker, Kubernetes, OpenShift and how are they related?  - 6 Of course, you can do it manually, through Docker. But you have to do something, write something, you need some kind of tool for automation. This is where Kubernetes (K8s for short) enters the scene, it will also manage and orchestrate (automated management of related entities) containers. With K8s at your disposal, you do not have to monitor containers day and night. It is enough to define a scenario of behavior, and K8s will do everything by itself. Key features of Kubernetes 1. Provides scalability and control over 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, specify 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 installed configuration. What you need to remember here: Kubernetes is a tool for orchestrating containerized applications - automating their deployment, scaling and coordination in a cluster environment. Supports major containerization technologies, including Docker. K8s is open source software. Who are Docker, Kubernetes, OpenShift and how are they related?  - 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 features It is immediately ready for use, it does not need to be long and painful to set up, you can immediately put it into production. See how many icons there are above Kubernetes. And each of them does their own cool stuff. Who are Docker, Kubernetes, OpenShift and how are they related?  - 8 Highlights of OpenShift: • It's a paid product, unlike K8s; • DevOps out of the box, support for the main deployment scenarios blue/green, canary; • Built-in Jenkins support; • Provides convenient tools for administration and work with the cluster; • Has a stricter security model and built-in monitoring. It is worth pointing out 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, then this is a product of Red Hat, which, as part of paid support, solves problems that arise. Let's summarize: In industrial development, there is a need to “package” an application; this approach is especially relevant in microservice architecture. Containers are the primary means for "packaging" applications. Docker handles containers, creates container images, lifts and moves containers. To manage a bunch of containers at the same time, Docker Compose is used, which is included with Docker. These programs are free software. Kubernetes(K8s) is a tool for orchestrating containerized applications - automating their deployment, scaling and coordination in a cluster environment. Supports major containerization technologies, including Docker. K8s is open source software. OpenShift is an add-on to Kubernetes that offers additional features. This is a paid product unlike K8s intended for corporate use. Provides DevOps out of the box: support for basic blue / green, canary deployment scenarios, has built-in support for Jenkins and provides convenient tools for administering and working with a cluster. It has a stricter security model and built-in monitoring. For those who are itching to code: Package a Spring Boot application in 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