Ice Cream with Kubernetes, or Beginner's Container Solutions

    Actually, Kubernetes and containers came into use quite recently, so it will not be surprising if you still know little about them or are not very actively using them. In this post, we will talk about Kubernetes for those who want to join the vanguard of IT technology - developers who have not yet switched to containers, and even not technical people who today also can not do without IT (hello, digitalization of business!).



    To reveal a hot topic, an ice cream example will help us.

    Ice Cream Case


    Imagine that we produce and sell ice cream, we have a successful business that has recently gone from pure offline to gaining momentum online. We have a small team, but it already has several developers that we hired to cope with the growing demand.

    We first engaged in online trading last year, and the corporate site has already managed to decently increase sales. Thanks to the Internet, we can trade not only in our stores, but also deliver goods to almost all corners of the country where there is delivery. People like our ice cream, and we must scale to meet demand.

    We hired several additional developers to develop and update the site. So that our business could grow further, the developers began to create new applications. In particular, they said that we need a billing system, a temperature monitoring system in freezers, as well as algorithms for optimizing business processes, such as on-time logistics. In general, a lot of everything. And now they have stated that, among other things, we still need some Kubernetes.

    We googled Kubernetes and found a bunch of pages about the history of Linux, some LXC containers, cgroups and other technical jargon. It’s not clearer. Then we asked the developers to explain why we, simple ice cream makers, need all this tuning, when we already have something to do besides Kubernetes. Well, then, for investment, you need a more compelling reason than just the desire of developers to play around with something new.

    One of the developers, Boris, asks if we know how often some function of our site works fine on the machine of Alice’s developer, but it doesn’t work on his machine, Boris. According to the developers, this happens regularly and is explained by the fact that the environments on the machines of Alice and Boris are different. Containers allow the developer to precisely determine those parts of this environment that are needed for the application to work properly. Thanks to this, developers save time on debugging malfunctions associated with mismatching environments, and can devote more time to the development itself. In addition, the containers are easy to pack and move, in other words, the program code is easily transferred from the developer's machine to the corporate server.

    The developers also emphasize that containers help save money: they are lightweight and help to use computing resources more efficiently. In other words, by switching to containers, you can hang more applications on one server.

    “Well, fine,” we say. “Let's pack our software into containers.” The developers answer that they have already started, because for this it was only necessary to switch to systemd or another initialization system. “Initialization system?” - we ask again. The developers say that this is not important, and this system is simply needed for container management. Then we are interested in when we get to selling ice cream.



    In response, we hear that soon we will have to manage hundreds of containers. Hundreds is really a lot. Then the developers return to our original questions: what is Kubernetes? Why do we need it? And how much technology do you need in order to sell ice cream?

    What is Kubernetes?


    Kubernetes is a container management tool. If we want to manage hundreds of containers, it is best to do this with automation. And automation is Kubernetes. If it weren’t for it, we would have to manually update hundreds of containers every time we roll out a new function on our website. And we do it all the time! In addition, manual operations are errors. And mistakes in our business are bad, because ice cream has the ability to melt.

    Kubernetes is an orchestration of containers. In other words, the right way to work with containers when there are a lot of them.

    Suppose a container crashes and crashes - Kubernetes instantly creates a new one. How does the container know which computer it should run on? The Kubernetes scheduler is responsible for this. Therefore, if a container that monitors the temperature in the freezer has flown out and needs to be re-deployed, or it is time to roll out a new version of the corporate website, Kubernetes will be very helpful. It seems that it seriously simplifies the mass of tasks for managing all kinds of server things in a rapidly growing business, like ours.

    Then our conversation shifts slightly into the realm of magic. Online Kubernetesself-healing technology is mentioned. They also write that he is so smart that he can automatically perform rollout updates and rollbacks. We read it out loud and ask the developers about it. They answer, and approval is heard in their words: we finally began to ask the right questions. “If you really want to know how the machine works, you need to look at the details.”

    So Kubernetes is smart, automated and easy to interact with. So, solid milk rivers and no pitfalls? And here, the developers answer, the fun begins. Kubernetes is an open source project. Google started it, laying the foundation of his many years of experience with containers. But now this project has come under the wing of the independent Cloud Native Computing Foundation and is supported by a large community, in which Red Hat, the second most active member of the community, is actively involved. In addition, it is one of the fastest growing projects in the history of the industry .

    Kubernetes can work anywhere from bare iron to clouds, so it won’t turn into gold handcuffs. We can use it in any cloud: in private, in public, or both there and there.

    Technological process


    Despite the rapid spread in the corporate sector, Kubernetes is often a tough nut for beginners. The thing is a large number of concepts that need to be learned to work with this platform.
    How to deal with pod, service and control panel? How to make the service publicly available?

    How are running pods updated? To answer most of the questions, we have a special Kubernetes guide that details the basics of this platform.

    And also, those who missed the Red Hat webinar on Kubernetes can still see its entry on our page: Webinar “Managing Containers in a Distributed Environment”.

    Still have questions? We will try to answer them in the comments.

    Based on coreos.com and Red Hat.

    Also popular now: