> For the complete documentation index, see [llms.txt](https://docs.cennso.com/cennso/cdm/latest/llms.txt) (all documentation: [llms.txt](https://docs.cennso.com/llms.txt)). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cennso.com/cennso/cdm/latest/concepts/mesh.md).

# Mesh

[`Mesh` Custom Resource (CR)](https://docs.cennso.com/cennso/cdm/latest/technical-reference/crds/mesh.md) allows you to configure and deploy a functional Cennso Data Mesh (CDM) Signaling instance on a Core Cluster.

A minimal configuration includes these fields specified under **spec.forProvider**:

- **connectionSecretRef** that contains a reference to a Kubernetes Secret with kubeconfig for provider connection. It must contain:
  - **connectionSecretRef.name** - Name of the Secret
  - **connectionSecretRef.namespace** - Namespace where the Secret is stored

  By default, the kubeconfig is expected in the **kubeconfig** key in the referenced Secret.

- **clusterName** - Name of the cluster where Mesh will be deployed
- **mode** - Deployment mode, either `SINGLE` for single-instance deployment or `HA` for high availability
- **resources** - CPU and memory resource requirements for the Mesh pods

The following example shows the minimal configuration needed to deploy a working CDM Signaling in `SINGLE` mode with resource requests of `100m` CPU and `128Mi` memory:

```yaml
spec:
  forProvider:
    connectionSecretRef:      # Required
      name: secret-name
      namespace: namespace
    clusterName: name         # Required
    mode: SINGLE              # Required, available values: SINGLE, HA
    resources:                # Required
      cpu: "100m"
      memory: "128Mi"
```

## Provider configuration

The **spec.forProvider** section defines all deployment parameters for the Mesh. This section controls where the Mesh is deployed, how it runs, and what resources it uses. It serves as the primary configuration interface, mapping your desired state to the actual Mesh deployment on the target cluster.

### Connection and target

The connection and target settings establish how and where Mesh will be deployed. These fields point to the target Kubernetes cluster and specify the deployment location within that cluster.

- **connectionSecretRef** (Required) - References the Secret containing kubeconfig to access the target core cluster:
  - **name** - Secret name
  - **namespace** - Secret namespace
  - **key** - Key in Secret (defaults to `kubeconfig`)
- **clusterName** (Required) - Name of the cluster where Mesh will be deployed
- **namespace** - Target namespace for Mesh deployment

### Deployment configuration

The deployment configuration settings determine the operational characteristics of your Mesh instance, including whether it runs as a single instance or in high availability mode, and what compute resources it requires.

- **mode** (Required) - Deployment mode:
  - `SINGLE` (default) - Single-instance deployment without clustering, suitable for development, testing, or non-critical workloads where simplicity is the priority.
  - `HA` - High availability deployment with multiple replicas (minimum three nodes). All nodes in HA mode maintain the same resolution and provide fault tolerance. If one node fails, the cluster continues operating through the remaining nodes. This mode is recommended for production workloads.

- **resources** (Required) - CPU and memory requirements for the Mesh pods. Proper resource allocation is critical for performance and cost optimisation:
  - **cpu** - CPU request/limit (for example, "100m", "1")
  - **memory** - Memory request/limit (for example, "128Mi", "1Gi")

  Calculate resource requirements based on your expected workload characteristics, including messages per second throughput, message payload sizes, and bucket size. Under-provisioning can lead to message delays or drops, while over-provisioning increases operational costs. Test with representative workloads before deploying to production.

### Persistence

The persistence configuration controls how the Mesh stores data, including the size and behaviour of persistent volumes. These settings define both disk-based and memory-based storage, along with policies that determine what happens to data when the Mesh is deleted or scaled.

- **persistence** - Storage configuration:
  - **size** - Requested storage capacity for the CDM-Node data volume. Each pod gets its own PVC (default: "10Gi")
  - **memoryStoreSize** - Maximum storage allowed across all memory-based assets (default: "64Mi")
  - **storageClassName** - If set, overrides the default storage class for the CDM-Node's PVCs. If not set, the default storage class of the Kubernetes cluster is used
  - **accessModes** - Access modes for the PVC. Common values are `ReadWriteOnce`, `ReadOnlyMany`, and `ReadWriteMany` (default: `ReadWriteOnce`)
  - **pvcRetentionPolicy** - Retention policies for the CDM-Node's PVCs. Accepted values for both fields are `Retain` and `Delete`:
    - **whenDeleted** - Policy for PVC when the Mesh is deleted: `Retain` (default) preserves the data, or `Delete` removes it
    - **whenScaled** - Policy for PVC when the Mesh is scaled down: `Retain` (default) preserves the data, or `Delete` removes it

### Advanced configuration

The advanced configuration options provide fine-grained control over pod scheduling, monitoring, container images, and cluster behaviour. These settings allow you to optimise Mesh deployment for specific infrastructure requirements and operational needs.

- **affinity** - Pod affinity/anti-affinity rules following the full Kubernetes affinity specification. Use standard pod affinity to control pod placement and ensure CDM Signaling pods land on nodes with specific labels. This is particularly useful for dedicating certain machines to Mesh workloads or ensuring proper distribution across failure domains:
  - **nodeAffinity** - Node selection preferences to target specific nodes based on labels (for example, to schedule Mesh pods only on nodes with specific hardware characteristics or in specific zones)
  - **podAffinity** - Co-location rules to place Mesh pods on the same nodes as other specified pods (for example, to reduce network latency by co-locating with applications that communicate frequently with the Mesh)
  - **podAntiAffinity** - Anti-co-location rules to prevent Mesh pods from running on the same nodes as other specified pods (for example, to spread Mesh replicas across different nodes for better availability in HA mode)
- **noAdvertise** - When set to `true`, disables advertising this Mesh's client URLs to other cluster members. This prevents the Mesh from sharing its client connection URLs with other servers in the cluster, which is useful when running behind load balancers or when clients should not connect directly to this node
- **advertise** - Custom URL to advertise for this Mesh instance. When it's set, the **noAdvertise** field is ignored. It allows you to specify a custom address (such as a load balancer endpoint) that other cluster members will use to connect to this Mesh node. If not set, the Mesh will automatically determine the advertise URL based on the cluster configuration and network environment
- **enableMonitoring** - Enables monitoring via Prometheus metrics exporter when set to `true`
- **pullSecretRef** - References the Secret containing credentials to pull the CDM chart. If not specified, the default Cennso pull Secret will be used:
  - **name** - Secret name containing registry credentials
- **releaseOverrides** - Allows overriding Helm chart parameters:
  - **chartVersion** - Override the default CDM chart version

See the example with advanced configuration:

```yaml
apiVersion: cdm.cennso.com/v1alpha1
kind: Mesh
metadata:
  name: production-mesh
spec:
  forProvider:
    connectionSecretRef:
      name: prod-core-cluster
      namespace: cennso-infra
      key: kubeconfig
    clusterName: prod-core-cluster
    mode: HA
    namespace: mesh-system
    resources:
      cpu: "2"
      memory: "4Gi"
    persistence:
      size: "50Gi"
      memoryStoreSize: "512Mi"
      storageClassName: "fast-ssd"
      accessModes:
        - ReadWriteOnce
      pvcRetentionPolicy:
        whenDeleted: "Retain"
        whenScaled: "Retain"
    enableMonitoring: true
    noAdvertise: true
    affinity:
      podAntiAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          - labelSelector:
              matchExpressions:
                - key: app
                  operator: In
                  values:
                    - cdm-mesh
            topologyKey: kubernetes.io/hostname
      nodeAffinity:
        requiredDuringSchedulingIgnoredDuringExecution:
          nodeSelectorTerms:
            - matchExpressions:
                - key: node-role.kubernetes.io/worker
                  operator: In
                  values:
                    - "true"
```

In this example, the Mesh is deployed in high availability mode with enhanced resources. The persistence configuration uses a fast SSD storage class with larger volumes, and retention policies are set to preserve data in all cases. Monitoring is enabled, and **noAdvertise** is set to `true` for load-balanced deployments. The affinity rules ensure that Mesh pods are spread across different nodes (anti-affinity) and only run on designated worker nodes (node affinity).

## Deletion policy

The **spec.deletionPolicy** field controls the lifecycle of external resources when the `Mesh` CR is deleted from Kubernetes. This setting determines whether the actual Mesh deployment and its resources are removed or preserved when you delete the CR.

- `Delete` (default) - Deletes the external Mesh resources when the CR is deleted
- `Orphan` - Leaves the external Mesh resources intact when the CR is deleted, allowing you to manage them independently

## Management policies

The **spec.managementPolicies** field provides granular control over which operations Crossplane is allowed to perform on the Mesh resources. This is useful when you want to observe existing resources without modifying them, or restrict certain operations for compliance or safety reasons.

- Default: `*` - Allows all operations
- Available policies: `Observe`, `Create`, `Update`, `Delete`, `LateInitialize`

## Provider configuration reference

The **spec.providerConfigRef** field allows you to specify which provider configuration to use for this Mesh deployment. Provider configurations define authentication and connection settings for the CDM provider. If not specified, the default provider configuration is used.

## Status

The **status** section represents the observed state of the last install or upgrade operation of the Mesh. While these operations ensure that Mesh pods initially reach an operational state, subsequent events — such as pod eviction or node failures — may affect Mesh health. To check the current status of the Mesh, refer to the Mesh dashboard and metrics.

### Mesh state

The **status.atProvider** section provides observable fields showing the actual Mesh state, including deployment phase and detailed installation progress:

- **phase** - Current deployment phase:
  - `Pending` - Waiting to start installation
  - `Installing` - Installation in progress
  - `Running` - Successfully deployed and operational
  - `Failed` - Deployment failed
  - `Terminating` - Being deleted
  - `Unknown` - Status unclear

- **lastTransitionTime** - Timestamp when the phase last changed

- **steps** - Detailed installation progress tracking each step of the deployment:
  - **name** - Step identifier:
    - `StepCreateCDMClaims` - Creating required CDM resource claims
    - `CopyResourcesToCoreCluster` - Copying resources to the target cluster
    - `DeployHelmRelease` - Deploying the Helm chart
  - **status** - Step status: `Pending`, `InProgress`, `Completed`, `Failed`, `Skipped`
  - **message** - Additional details about the step's status
  - **error** - Error information if the step failed
  - **completionTime** - When the step completed

### Conditions

The **status.conditions** provides information about the status of the last installation or upgrade operation. Conditions follow the standard Crossplane format for tracking resource health:

- `Ready` - Overall readiness status indicating whether the Mesh is fully operational
- `Synced` - Whether the spec is synchronized with the external resource

Each condition includes:

- **type** - Condition type (`Ready` or `Synced`)
- **status** - Current condition status: `True`, `False`, or `Unknown`
- **reason** - Machine-readable reason code for the condition's last transition
- **message** - Human-readable message with details about the condition's last transition
- **lastTransitionTime** - Timestamp when this condition last changed from one status to another
- **observedGeneration** - The resource generation number this condition was based on

### Observed generation

The **status.observedGeneration** field tracks which metadata.generation the controller has processed, helping to determine whether the controller has reconciled the latest changes to the resource specification.

See the example:

```yaml
status:
  atProvider:
    phase: Running
    lastTransitionTime: "2026-02-24T10:15:30Z"
    steps:
      - name: StepCreateCDMClaims
        status: Completed
        completionTime: "2026-02-24T10:12:45Z"
      - name: CopyResourcesToCoreCluster
        status: Completed
        completionTime: "2026-02-24T10:14:20Z"
      - name: DeployHelmRelease
        status: Completed
        completionTime: "2026-02-24T10:15:30Z"
  conditions:
    - lastTransitionTime: "2026-02-24T10:15:30Z"
      observedGeneration: 1
      reason: ReconcileSuccess
      status: "True"
      type: Synced
    - lastTransitionTime: "2026-02-24T10:15:45Z"
      observedGeneration: 1
      reason: Available
      status: "True"
      type: Ready
  observedGeneration: 1
```
