Reader small image

You're reading from  Docker and Kubernetes for Java Developers

Product typeBook
Published inAug 2017
Reading LevelIntermediate
PublisherPackt
ISBN-139781786468390
Edition1st Edition
Languages
Right arrow
Author (1)
Jarosław Krochmalski
Jarosław Krochmalski
author image
Jarosław Krochmalski

Jaroslaw Krochmalski is a passionate software designer and developer who specializes in the financial business domain. He has over 12 years of experience in software development. He is a clean-code and software craftsmanship enthusiast. He is a Certified Scrum Master and a fan of Agile. His professional interests include new technologies in web application development, design patterns, enterprise architecture, and integration patterns. He has been designing and developing software professionally since 2000 and has been using Java as his primary programming language since 2002. In the past, he worked for companies such as Kredyt Bank (KBC) and Bank BPS on many large-scale projects such as international money orders, express payments and collection systems. He currently works as a consultant in Danish company 7N as an IT architect for the Nykredit bank. You can reach him via Twitter at @jkroch or by e-mail at jarek@finsys.pl. I would like to say hello to my friends at 7N and Nykredit, keep up the great job!
Read more about Jarosław Krochmalski

Right arrow

Introduction to Kubernetes

After reading Chapter 6, Running Containers with Java Applications, you now have a lot of knowledge about using Docker to package your Java applications. It's now time to move even further and focus on what we are missing--the container management and orchestration. There are some suitable tools on the market, such as Nomad, Docker Swarm, Apache Mesos, or AZK, for example. In this chapter, we will focus on probably the most popular one, Kubernetes. Kubernetes (sometimes referred to as k8s) is an open source orchestration system for Docker containers, created by Google in 2015. The first unified container management system developed at Google was the system, internally called, Borg; Kubernetes is its descendant. The list of topics covered in this chapter will be:

  • Why and when we need container management
  • An introduction to Kubernetes
  • Basic Kubernetes...

Why do we need Kubernetes?

As you already know, Docker containers provide great flexibility for running Java services packaged into small, independent pieces of software. Docker containers make components of your application portable--you can move individual services across different environments without needing to worry about the dependencies or the underlying operating system. As long as the operating system is able to run the Docker engine, your Java containers can run on this system.

Also, as you remember from Chapter 1, Introduction to Docker, the Docker concept of isolating containers is far from the traditional virtualization. The difference is that Docker containers utilize the resources of the host operating system--they are light, fast, and easy to spin up. It's all very nice, but there are some risks. Your application consists of multiple, independent microservices...

Basic Kubernetes concepts

A cluster is a group of nodes; they can be physical servers or virtual machines that have the Kubernetes platform installed. The basic Kubernetes architecture is presented in the following diagram:

As you can see, the Kubernetes cluster consists of a Master node and a number of worker nodes with some components inside. While it may look scary and complicated at first glance, it will be easier to understand if we describe the concepts one by one, starting with the Pod.

Pods

The Pod consists of one or more Docker containers. This is the basic unit of the Kubernetes platform and an elementary piece of execution that Kubernetes works with. A diagram of the Pod is presented as following:

Containers running...

Summary

This chapter introduced a lot of new concepts. Let's briefly summarize what we have learned about the Kubernetes architecture.

Kubernetes (k8s) is an open source platform for automating container operations such as deployment, scheduling, and scalability across a cluster of nodes. Using Kubernetes, you can:

  • Automate the deployment and replication of containers
  • Scale up and down containers on the fly
  • Organize containers in groups and provide load balancing between them
  • Easily roll out new versions of application containers
  • Provide fault tolerance mechanisms to your application--if a container dies it gets replaced
  • Kubernetes consists of:
    • A Cluster: A group of nodes.
    • Nodes: Physical or virtual machines that act as workers. Each node runs the kubelet, proxy, and a Docker engine process.
    • The Master node: Provides a unified view into the cluster. It delivers the Kubernetes...
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Docker and Kubernetes for Java Developers
Published in: Aug 2017Publisher: PacktISBN-13: 9781786468390
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Jarosław Krochmalski

Jaroslaw Krochmalski is a passionate software designer and developer who specializes in the financial business domain. He has over 12 years of experience in software development. He is a clean-code and software craftsmanship enthusiast. He is a Certified Scrum Master and a fan of Agile. His professional interests include new technologies in web application development, design patterns, enterprise architecture, and integration patterns. He has been designing and developing software professionally since 2000 and has been using Java as his primary programming language since 2002. In the past, he worked for companies such as Kredyt Bank (KBC) and Bank BPS on many large-scale projects such as international money orders, express payments and collection systems. He currently works as a consultant in Danish company 7N as an IT architect for the Nykredit bank. You can reach him via Twitter at @jkroch or by e-mail at jarek@finsys.pl. I would like to say hello to my friends at 7N and Nykredit, keep up the great job!
Read more about Jarosław Krochmalski