> For the complete documentation index, see [llms.txt](https://docs.catalyx.solutions/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.catalyx.solutions/catalyx-blockchain-manager/canton-network/version-1.11/validator-management/validator-custom-resource-definition.md).

# Validator Custom Resource Definition

This page provides an overview of the Validator Custom Resource Definition (CRD) used by Catalyst Blockchain Manager to deploy and manage Canton validators using Kubernetes. It describes the structure of the CRD and explains how each validator component is defined and configured.

{% hint style="info" %}
A Custom Resource Definition (CRD) in Kubernetes is a way to extend the Kubernetes API by defining new, custom object types, allowing you to manage application-specific data.
{% endhint %}

### Structure of the Specification

The CRD specification defines each validator component separately.

| Component            | CRD Location                            |
| -------------------- | --------------------------------------- |
| **Validator** (core) | Top level of the specification          |
| **ANS/CNS UI**       | `spec.applicationCantonNameServer.spec` |
| **Wallet UI**        | `spec.walletUI.spec`                    |
| **Participant Node** | `spec.participant.spec`                 |

#### Provisioned Postgres Database

The PostgreSQL database provisioned for the validator is not explicitly represented in the CRD specification. To increase the database storage size (decreases are ignored), use:

```
spec.storageSize
```

### Modifying Component Specifications

#### Environment Variables

For all components, environment variables are defined under `spec.envVars`. They follow the same structure and format used in Kubernetes Pods and Deployments.

#### Resources

Each component has a resource specification:

```yaml
resources:
    cpuLimit: '2'
    cpuRequested: '1'
    imagePullSecret: intellecteu-gitlab-access
    memoryLimit: 2Gi
    memoryRequested: 1Gi
    replicas: 1
```

| Field             | Description                                    |
| ----------------- | ---------------------------------------------- |
| `cpuLimit`        | Maximum CPU allocation                         |
| `cpuRequested`    | Minimum CPU allocation                         |
| `memoryLimit`     | Maximum memory allocation                      |
| `memoryRequested` | Minimum memory allocation                      |
| `replicas`        | Number of instances (can be set to `0` or `1`) |

To scale down a validator, set the `replicas` field to `0` for all components.

### Example CRD

<details>

<summary>Full example Validator CRD YAML</summary>

```yaml
apiVersion: catalyst.manager.canton/v1
kind: Validator
metadata:
  name: validator1st
  namespace: canton-dev
spec:
  application:
    spec:
      domain: participant-validator1st
      resources:
        cpuLimit: '2'
        cpuRequested: '1'
        imagePullSecret: intellecteu-gitlab-access
        memoryLimit: 2Gi
        memoryRequested: 1Gi
        replicas: 1
      type: backend
      validatorParent: validator1st
  applicationCantonNameServer:
    spec:
      domain: cns-validator1st
      image: >-
        digitalasset-canton-network-docker.jfrog.io/digitalasset/ans-web-ui:0.3.15
      resources:
        cpuLimit: '1'
        cpuRequested: '0.1'
        imagePullSecret: intellecteu-gitlab-access
        memoryLimit: 1536Mi
        memoryRequested: 240Mi
        replicas: 1
      type: ui
  applicationWallet:
    spec:
      domain: wallet-validator1st
      image: >-
        digitalasset-canton-network-docker.jfrog.io/digitalasset/wallet-web-ui:0.3.15
      resources:
        cpuLimit: '1'
        cpuRequested: '0.1'
        imagePullSecret: intellecteu-gitlab-access
        memoryLimit: 1536Mi
        memoryRequested: 240Mi
        replicas: 1
      type: ui
  customAuth: false
  disabledWallet: false
  image: digitalasset-canton-network-docker.jfrog.io/digitalasset/validator-app:0.3.15
  imageRepo: digitalasset-canton-network-docker.jfrog.io/digitalasset
  imageTag: 0.3.15
  migrationId: '0'
  migrationMigrating: false
  participant:
    spec:
      adminPort: '5002'
      auth: true
      authProvider: keycloak
      image: >-
        digitalasset-canton-network-docker.jfrog.io/digitalasset/canton-participant:0.3.15
      jsonapi: false
      ledgerPort: '5001'
      logLevel: INFO
      resources:
        cpuLimit: '2'
        cpuRequested: '1'
        imagePullSecret: intellecteu-gitlab-access
        memoryLimit: 2Gi
        memoryRequested: 1Gi
        replicas: 1
      storageType: Shared Postgres
  resources:
    cpuLimit: '2'
    cpuRequested: '1'
    imagePullSecret: intellecteu-gitlab-access
    memoryLimit: 2Gi
    memoryRequested: 1Gi
    replicas: 1
  storageSize: 20Gi
```

</details>

***


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.catalyx.solutions/catalyx-blockchain-manager/canton-network/version-1.11/validator-management/validator-custom-resource-definition.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
