composition-dynamic-controller
The composition-dynamic-controller is an operator that is instantiated by the core-provider to manage the Custom Resources whose Custom Resource Definition is generated by the core-provider.
Summary
Overview
The composition-dynamic-controller is an operator designed to manage the lifecycle of a Helm chart based on specifications defined within its Custom Resource (CR) and the actions performed on this CR.
In practice, when a Custom Resource (CR) is created, the instance of composition-dynamic-controller enabled to manage this specific Group Version Kind (GVK), checks if a Helm release associated with the CR already exists in the cluster. If not, it performs an helm install
using the values specified in the CR to create a new release. However, if the release does already exist, it instead executes an helm upgrade
, updating the release's values with those specified in the CR. Additionally, when the CR is deleted from the cluster, the instance of the composition-dynamic-controller performs an helm uninstall
on the release.
The status of the composition definition is True if the resources contained in the chart with conditions have a positive type equal to True (positive types are "ready", "complete", "healthy", "active", "able").
Examples
apiVersion: composition.krateo.io/v12-8-3
kind: Postgresql
metadata:
name: sample
namespace: krateo-system
spec:
architecture: standalone
The manifest described above represents a Custom Resource (CR) of kind Postgresql, and its apiVersion is composition.krateo.io/v12-8-3. This CRD was generated by the core-provider based on the specifications outlined in the CompositionDefinition. Applying this manifest within the cluster initiates the installation of a chart associated with the corresponding instance of the composition-dynamic-controller.
Configuration
Operator Env Vars
These enviroment varibles can be changed in the Deployment of the composition-dynamic-controller we need to tweak.
Name | Description | Default Value |
---|---|---|
COMPOSITION_CONTROLLER_DEBUG | dump verbose output | false |
COMPOSITION_CONTROLLER_WORKERS | number of workers | 1 |
COMPOSITION_CONTROLLER_RESYNC_INTERVAL | resync interval | 3m |
COMPOSITION_CONTROLLER_GROUP | resource api group | |
COMPOSITION_CONTROLLER_VERSION | resource api version | |
COMPOSITION_CONTROLLER_RESOURCE | resource plural name |