Learning - Component

The role of the component is to enable developers to define the deployment mode of the business unit without paying attention to the underlying infrastructure. The component describes the functional unit that can be instantiated as part of a large distributed application. For example, each microservice in an application is described as a component. Another example is Wordpress+Mysql’s business systems Wordpress and Mysql are described as components respectively.

The component model has the following main attributes:

  • Build source Define the way the component is built, mainly including source code, mirroring and application model.

  • Component type defines the deployment mode of the component. Currently, Kato supports single-instance stateless, multi-instance stateless, single-instance stateful and multi-instance stateful types. Later, it supports the expansion of component types based on the Operator model. .

  • Environment configuration defines the component operating environment configuration, including two types of environment variables and configuration files.

  • Storage defines the persistent storage requirements of the component.

  • Port defines the ability of the component to provide external services.

  • Resource allocation and number of instances define the scale of component deployment.

  • Dependency defines the communication dependency and variable injection configuration between components.

How to Make Good Use of “Components”

The division of components is a crucial thing, and developers need to master the following principles:

  • One service per component

  • One main process per component

  • A component has a clear business boundary

  • Separation of state and statelessness

In Kato, there is a container for each component, so if it is a custom mirroring situation, the idea of ​​making mirrors should also be consistent with the idea of ​​component division. In Kubernetes native scenarios, there are often multiple containers in the same Pod. In general, it is composed of a main business container plus some operation and maintenance feature containers, such as Mysql+Mysql monitoring container, API service plus log collection container, etc. There are primary and secondary, the primary container is the business, and the secondary container is the general operation and maintenance feature, so the Pod multi-container capability is used in Kato as a component + plugin mode. Components define the main business, and plug-ins define operation and maintenance characteristics and are universal.

Let the External Services Become Kato Components

The Kato platform uniformly manages the business system of the enterprise. It is inevitable that some businesses may not be able to or need not be migrated to the Kato cluster, but the existing components in the cluster may need to communicate with it or want to manage the external network traffic uniformly through the Kato gateway. For such scenarios, Kato has expanded a special “component” type, third-party components. By specifying the communication address of third-party components, it is included in the unified management category of Kato.