# trusted-execution-clusters/operator architecture

> Architecture diagram of the GitHub repository trusted-execution-clusters/operator, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-26). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/trusted-execution-clusters/operator
- Repository: https://github.com/trusted-execution-clusters/operator

## Overview

This repository is a Kubernetes operator for declaratively managing Trusted Execution Clusters and their Trustee attestation configuration. Users create a TrustedExecutionCluster; the operator watches it, converges the cluster components and Trustee configuration, and coordinates image reference-value computation and attestation-key registration. The README documents the auxiliary Clevis PIN register server as another managed capability. The sampled excerpts show parts of operator reconciliation and Trustee synchronization; other service relationships below are based on README descriptions, not inspected service internals.

Main entry points: [`operator/src/main.rs`](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/main.rs) (Operator Controller), [`lib/src/lib.rs`](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/lib.rs) (Shared Rust Types), [`operator/src/trustee.rs`](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/trustee.rs) (Trustee Reconciler), [`operator/src/reference_values.rs`](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/reference_values.rs) (Image Reconciler)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_api["Cluster API"]
  node_tec_crd["Cluster CRD<br/>[crds.go]"]
  node_api_conditions["API Conditions<br/>[conditions.go]"]
end

subgraph group_operator["Operator Reconciliation"]
  node_operator_main["Operator Controller<br/>[main.rs]"]
  node_trustee_config["Trustee Reconciler<br/>[trustee.rs]"]
  node_image_reconcile["Image Reconciler"]
  node_ak_reconcile["Key Registration Reconciler"]
  node_register_reconcile["PIN Server Reconciler<br/>[register_server.rs]"]
  node_condition_logic["Operator Conditions<br/>[conditions.rs]"]
end

subgraph group_attestation["Attestation Services"]
  node_trustee["Trustee Server<br/>[trustee.rs]"]
  node_pcr_job["PCR Computation Job"]
  node_compute_pcrs["PCR Computation<br/>[main.rs]"]
  node_compute_lib["PCR Library<br/>[lib.rs]"]
  node_ak_server["Attestation Key Server<br/>[main.rs]"]
  node_pin_server["Clevis PIN Server<br/>[main.rs]"]
end

subgraph group_shared["Shared Domain Types"]
  node_shared_lib["Shared Rust Types<br/>[lib.rs]"]
  node_shared_conditions["Condition Helpers<br/>[conditions.rs]"]
  node_reference_types["Reference Values"]
  node_vm_types["KubeVirt VM Types<br/>[virtualmachines.rs]"]
  node_vmi_types["KubeVirt Instance Types"]
end

node_user(("Cluster User"))
node_kube[("Kubernetes API")]

node_user -->|"applies resources"| node_kube
node_kube -->|"watches resources"| node_operator_main
node_operator_main -->|"reconciles config"| node_trustee_config
node_operator_main -->|"reconciles images"| node_image_reconcile
node_operator_main -->|"reconciles keys"| node_ak_reconcile
node_operator_main -->|"reconciles server"| node_register_reconcile
node_operator_main -->|"updates conditions"| node_condition_logic
node_trustee_config -->|"configures"| node_trustee
node_image_reconcile -->|"creates jobs"| node_pcr_job
node_pcr_job -->|"runs computation"| node_compute_pcrs
node_compute_pcrs -->|"uses library"| node_compute_lib
node_ak_reconcile -->|"manages deployment"| node_ak_server
node_register_reconcile -->|"manages deployment"| node_pin_server
node_tec_crd -->|"drives reconciliation"| node_operator_main
node_shared_lib -->|"exposes helpers"| node_shared_conditions
node_shared_lib -->|"exposes types"| node_reference_types
node_shared_lib -->|"exports types"| node_vm_types
node_shared_lib -->|"exports types"| node_vmi_types

click node_tec_crd "https://github.com/trusted-execution-clusters/operator/blob/main/api/v1alpha1/crds.go"
click node_api_conditions "https://github.com/trusted-execution-clusters/operator/blob/main/api/v1alpha1/conditions.go"
click node_operator_main "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/main.rs"
click node_trustee_config "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/trustee.rs"
click node_image_reconcile "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/reference_values.rs"
click node_ak_reconcile "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/attestation_key_register.rs"
click node_register_reconcile "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/register_server.rs"
click node_condition_logic "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/conditions.rs"
click node_trustee "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/trustee.rs"
click node_pcr_job "https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/reference_values.rs"
click node_compute_pcrs "https://github.com/trusted-execution-clusters/operator/blob/main/compute-pcrs/src/main.rs"
click node_compute_lib "https://github.com/trusted-execution-clusters/operator/blob/main/compute-pcrs/src/lib.rs"
click node_ak_server "https://github.com/trusted-execution-clusters/operator/blob/main/attestation-key-register/src/main.rs"
click node_pin_server "https://github.com/trusted-execution-clusters/operator/blob/main/register-server/src/main.rs"
click node_shared_lib "https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/lib.rs"
click node_shared_conditions "https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/conditions.rs"
click node_reference_types "https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/reference_values.rs"
click node_vm_types "https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/vendor_kopium/virtualmachines.rs"
click node_vmi_types "https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/vendor_kopium/virtualmachineinstances.rs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_tec_crd,node_api_conditions,node_user toneBlue
class node_operator_main,node_trustee_config,node_image_reconcile,node_ak_reconcile,node_register_reconcile,node_condition_logic,node_kube toneAmber
class node_trustee,node_pcr_job,node_compute_pcrs,node_compute_lib,node_ak_server,node_pin_server toneMint
class node_shared_lib,node_shared_conditions,node_reference_types,node_vm_types,node_vmi_types toneRose
```

## Components

### Cluster API

- [Cluster CRD](https://github.com/trusted-execution-clusters/operator/blob/main/api/v1alpha1/crds.go): `api/v1alpha1/crds.go`
- [API Conditions](https://github.com/trusted-execution-clusters/operator/blob/main/api/v1alpha1/conditions.go): `api/v1alpha1/conditions.go`

### Operator Reconciliation

- [Operator Controller](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/main.rs): `operator/src/main.rs`
- [Trustee Reconciler](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/trustee.rs): `operator/src/trustee.rs`
- [Image Reconciler](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/reference_values.rs): `operator/src/reference_values.rs`
- [Key Registration Reconciler](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/attestation_key_register.rs): `operator/src/attestation_key_register.rs`
- [PIN Server Reconciler](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/register_server.rs): `operator/src/register_server.rs`
- [Operator Conditions](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/conditions.rs): `operator/src/conditions.rs`

### Attestation Services

- [Trustee Server](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/trustee.rs): `operator/src/trustee.rs`
- [PCR Computation Job](https://github.com/trusted-execution-clusters/operator/blob/main/operator/src/reference_values.rs): `operator/src/reference_values.rs`
- [PCR Computation](https://github.com/trusted-execution-clusters/operator/blob/main/compute-pcrs/src/main.rs): `compute-pcrs/src/main.rs`
- [PCR Library](https://github.com/trusted-execution-clusters/operator/blob/main/compute-pcrs/src/lib.rs): `compute-pcrs/src/lib.rs`
- [Attestation Key Server](https://github.com/trusted-execution-clusters/operator/blob/main/attestation-key-register/src/main.rs): `attestation-key-register/src/main.rs`
- [Clevis PIN Server](https://github.com/trusted-execution-clusters/operator/blob/main/register-server/src/main.rs): `register-server/src/main.rs`

### Shared Domain Types

- [Shared Rust Types](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/lib.rs): `lib/src/lib.rs`
- [Condition Helpers](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/conditions.rs): `lib/src/conditions.rs`
- [Reference Values](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/reference_values.rs): `lib/src/reference_values.rs`
- [KubeVirt VM Types](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/vendor_kopium/virtualmachines.rs): `lib/src/vendor_kopium/virtualmachines.rs`
- [KubeVirt Instance Types](https://github.com/trusted-execution-clusters/operator/blob/main/lib/src/vendor_kopium/virtualmachineinstances.rs): `lib/src/vendor_kopium/virtualmachineinstances.rs`

### Other components

- **Cluster User**
- **Kubernetes API**

## Connections

- Cluster User → Kubernetes API: applies resources (evidence: `README.md`)
- Kubernetes API → Operator Controller: watches resources (evidence: `README.md`)
- Operator Controller → Trustee Reconciler: reconciles config (evidence: `operator/src/main.rs`)
- Operator Controller → Image Reconciler: reconciles images (evidence: `operator/src/main.rs`)
- Operator Controller → Key Registration Reconciler: reconciles keys (evidence: `operator/src/main.rs`)
- Operator Controller → PIN Server Reconciler: reconciles server (evidence: `operator/src/main.rs`)
- Operator Controller → Operator Conditions: updates conditions (evidence: `operator/src/main.rs`)
- Trustee Reconciler → Trustee Server: configures (evidence: `operator/src/main.rs`)
- Image Reconciler → PCR Computation Job: creates jobs (evidence: `operator/src/reference_values.rs`)
- PCR Computation Job → PCR Computation: runs computation (evidence: `README.md`)
- PCR Computation → PCR Library: uses library (evidence: `README.md`)
- Key Registration Reconciler → Attestation Key Server: manages deployment (evidence: `README.md`)
- PIN Server Reconciler → Clevis PIN Server: manages deployment (evidence: `README.md`)
- Cluster CRD → Operator Controller: drives reconciliation (evidence: `README.md`)
- Shared Rust Types → Condition Helpers: exposes helpers (evidence: `lib/src/lib.rs`)
- Shared Rust Types → Reference Values: exposes types (evidence: `lib/src/lib.rs`)
- Shared Rust Types → KubeVirt VM Types: exports types (evidence: `lib/src/lib.rs`)
- Shared Rust Types → KubeVirt Instance Types: exports types (evidence: `lib/src/lib.rs`)
