The Deckhouse Code operator is a Kubernetes operator that manages the lifecycle of Deckhouse Code instances using the CodeInstance custom resource. The operator installs Deckhouse Code components in the Deckhouse Platform cluster, as well as the managed-opensearch module (if the spec.features.globalSearch.enabled parameter of the CodeInstance custom resource is set to true), and performs their configuration.
Architecture
The following simplifications are made in the diagram:
- The diagram shows containers in different pods interacting directly with each other. In reality, they communicate via the corresponding Kubernetes Services (internal load balancers). Service names are omitted if they are obvious from the diagram context. Otherwise, the Service name is shown above the arrow.
- Pods may run multiple replicas. However, each pod is shown as a single replica in the diagram.
The Level 2 C4 architecture of the Deckhouse Code operator is shown in the following diagram:
Components
The operator consists of the following components:
Code-operator-webhook: Webhook server consisting of a single webhook container, used to validate and mutate CodeInstance custom resources via the Validating/Mutating Admission Controllers mechanisms.
Code-operator: Deckhouse Code operator, which performs the following functions:
- Manages CodeInstance custom resources.
- Performs additional validation of the CodeInstance custom resource to detect changes to the backup volume in its specification.
It consists of the following containers:
- manager: Main container.
- kube-rbac-proxy: Sidecar container providing authorized access to the operator’s metrics.
Interactions
The operator interacts with the following external components:
Kube-apiserver:
- Authorizes requests for the operator’s metrics;
- Manages the CodeInstance custom resources.
The following external components interact with the operator:
- Kube-apiserver: Validates and mutates CodeInstance custom resources (using validating and mutating webhooks).
- Prometheus-main: Collects the operator’s metrics.