Skip to content

Latest commit

 

History

History
71 lines (46 loc) · 4.08 KB

03-02-runtime-components.md

File metadata and controls

71 lines (46 loc) · 4.08 KB
title type
Runtime components
Details

Kyma Environment Broker (KEB) serves the functionality of composing the list of components that are installed in a Runtime. The diagram and steps describe the KEB workflow in terms of calculating and processing Runtime components:

runtime-components-architecture

  1. During KEB initialization, the broker reads two files that contain lists of components to be installed in a Runtime:

    • kyma-installer-cluster.yaml file with the given Kyma version
    • managed-offering-components.yaml file with additional managed components that are added at the end of the base components list
  2. The user provisions a Runtime and selects optional components that they want to install.

  3. KEB composes the final list of components by removing components that were not selected by the user. It also adds the proper global and components overrides and sends the whole provisioning information to the Runtime Provisioner.

There is a defined list of the component names. Use these names in your implementation.

Disabled components

To disable a component for a specific plan, add it to the disabled components list. To disable a component for all plans, add its name under the AllPlansSelector parameter.

Optional components

An optional component is a component that is disabled by default but can be enabled in the provisioning request. Currently, the optional components are:

  • Kiali
  • Tracing

Add the optional component

If you want to add the optional component, you can do it in two ways.

  • If disabling a given component only means to remove it from the installation list, use the generic disabler:
runtime.NewGenericComponentDisabler("component-name", "component-namespace")
  • If disabling a given component requires more complex logic, create a new file called internal/runtime/{compoent-name}_disabler.go and implement a service which fulfills the following interface:
// OptionalComponentDisabler disables component form the given list and returns a modified list
type OptionalComponentDisabler interface {
	Disable(components internal.ComponentConfigurationInputList) internal.ComponentConfigurationInputList

NOTE: Check the CustomDisablerExample as an example of custom service for disabling components.

In each method, the framework injects the components parameter which is a list of components that are sent to the Runtime Provisioner. The implemented method is responsible for disabling component and as a result, returns a modified list.

This interface allows you to easily register the disabler in the cmd/broker/main.go file by adding a new entry in the optionalComponentsDisablers list:

// Register disabler. Convention:
// {component-name} : {component-disabler-service}
//
// Using map is intentional - we ensure that component name is not duplicated.
optionalComponentsDisablers := runtime.ComponentsDisablers{
		"Kiali":      runtime.NewGenericComponentDisabler(components.Kiali),
		"Tracing":     runtime.NewGenericComponentDisabler(components.Tracing),
}

Remove the optional component

If you want to remove the option to disable components and make them required during Kyma installation, remove a given entry from the optionalComponentsDisablers list in the cmd/broker/main.go file.