To explain what we mean by new abstractions and primitives, here we compare them with the
well-known object-oriented programming (OOP), and Java specifically. In the OOP universe, we
have concepts such as class, object, package, inheritance, encapsulation, and polymorphism. Then
the Java runtime provides specific features and guarantees on how it manages the lifecycle of our
objects and the application as a whole.
The Java language and the Java Virtual Machine (JVM) provide local, in-process building blocks for
creating applications. Kubernetes adds an entirely new dimension to this well-known mindset by
offering a new set of distributed primitives and runtime for building distributed systems that
spread across multiple nodes and processes. With Kubernetes at hand, we don’t rely only on the
local primitives to implement the whole application behavior.
We still need to use the object-oriented building blocks to create the components of the distributed
application, but we can also use Kubernetes primitives for some of the application
behaviors. Table 1-1 shows how various development concepts are realized differently with local
and distributed primitives.

 

The in-process primitives and the distributed primitives have commonalities, but they are not
directly comparable and replaceable. They operate at different abstraction levels and have different
preconditions and guarantees. Some primitives are supposed to be used together. For example, we
still have to use classes to create objects and put them into container images. However, some other
primitives such as CronJob in Kubernetes can replace the ExecutorService behavior in Java
completely.

 

 

Logo

K8S/Kubernetes社区为您提供最前沿的新闻资讯和知识内容

更多推荐