> 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/guides/configure-mesh.md).

# Configure Mesh

`Mesh` is a Custom Resource (CR) that represents a CDM Signaling installation on a Core Cluster. It is managed by the CDM Provider. `Mesh` CR allows you to define and configure CDM Signaling on a Core Cluster.

## Prerequisites

Before creating `Mesh` CR, ensure the following components are properly configured:

### Management Cluster requirements

- **CDM Manager** - Must be running on the Management Cluster to handle identity administration, secret management, and mesh composition
- **CDM Provider** - Must be installed on the Management Cluster to orchestrate Mesh lifecycle operations
- **Crossplane** - Must be installed on the Management Cluster to enable resource provisioning and cross-cluster operations

### Core Cluster requirements

- **Core Cluster registration** - Core Cluster must be registered in the Cennso Management Cluster
- **Node Attachment** - At least one node must be attached to the Core Cluster
- **Kubernetes** - Kubernetes must be installed on each machine in the Core Cluster where CDM Signaling will be deployed
- **Cluster connectivity** - The Management Cluster must have network access to the Core Cluster through kubeconfig

For more details about the architecture and component interactions, see the [Architecture documentation](https://docs.cennso.com/cennso/cdm/latest/architecture.md).

## Steps

1. Create a YAML file for your Mesh (for example: `mesh.yaml`) resource and configure it according to your needs. For example:

    ```yaml
    apiVersion: cdm.cennso.com/v1alpha1
    kind: Mesh
    metadata:
      name: my-mesh
    spec:
      forProvider:
        connectionSecretRef:
          name: my-core-cluster
          namespace: cennso-infra
          key: kubeconfig
        clusterName: my-core-cluster
        mode: SINGLE
        namespace: mesh-system
        resources:
          cpu: "100m"
          memory: "128Mi"
        persistence:
          size: "1Gi"
          memoryStoreSize: "128Mi"
          storageClassName: "standard"
          accessModes:
            - ReadWriteOnce
          pvcRetentionPolicy:
            whenDeleted: "Delete"
            whenScaled: "Retain"
    ```

    For more details about `Mesh` CRD, refer to the [Mesh API reference](https://docs.cennso.com/cennso/cdm/latest/technical-reference/crds/mesh.md).

2. Apply `Mesh` CR to your Management Cluster using this command:

    ```bash
    kubectl apply -f ./mesh.yaml
    ```

## Verification

To verify that `Mesh` has been created successfully, follow these steps:

1. To check whether `Mesh` CR is created and what its status is, run:

    ```bash
    kubectl get mesh my-mesh
    ```
