Reference

castctl flags, auto-sizing behavior, and what gets deployed in your cluster when you enable reliability metrics.

This page documents the castctl flags available for reliability metrics, explains how castctl automatically sizes components for your cluster, and describes what gets provisioned in the cluster during installation. For an overview of the feature and step-by-step installation instructions, see Reliability metrics.


castctl cluster connect flags

These flags are used with castctl cluster connect to install and configure reliability metrics.

FlagDescription
--reliability-metricsEnable reliability metrics during cluster connect. Required to install the feature.
--non-interactiveSkip all interactive prompts. Use this flag in CI/CD pipelines where there is no terminal.
--cluster-name <name>Set the display name for the cluster being connected.
--dry-runPrint what would be installed without making any changes to the cluster. Useful for reviewing the install plan before committing.

These flags can be combined with flags for other Cast AI features in a single command:

castctl cluster connect \
  --non-interactive \
  --cluster-name production-us-east \
  --reliability-metrics \
  --cluster-optimization \
  --workload-autoscaler

castware upgrade flags

Use castctl castware upgrade to upgrade reliability metrics and all other Cast AI components in your cluster.

FlagDescription
--non-interactiveSkip confirmation prompts. Use in CI/CD pipelines.
castctl castware upgrade --non-interactive

Upgrading with castware preserves your existing configuration and applies any new data migrations automatically when the collector restarts.


How castctl sizes components

When you run castctl cluster connect --reliability-metrics, castctl inspects your cluster before installing anything and automatically determines the right resource allocation for two components: the collector agent that runs on each node, and the metrics database.

You do not need to specify sizing manually. The selections below describe what castctl chooses and why.

Collector agent sizing

The collector agent runs as a DaemonSet (one instance per node) and observes HTTP and gRPC traffic on that node. castctl counts the maximum number of containers running on any single node and selects a sizing profile accordingly.

Max containers on any nodeSelected profileCPU requestCPU limitMemory requestMemory limit
Up to 5small50m200m128 MiB256 MiB
Up to 15medium100m400m256 MiB512 MiB
Up to 30large200m800m512 MiB1 GiB
More than 30xlarge400m1600m1 GiB2 GiB

These profiles reflect expected traffic volume per node at each workload density level. A node running many containers typically serves more concurrent requests and needs more resources to observe them accurately.

Metrics database sizing

castctl also provisions a ClickHouse time-series database in your cluster for temporary metric storage. It sizes the database by summing your cluster's total allocatable CPU across all nodes.

Total cluster allocatable CPUCPU requestMemory requestMemory limit
Less than 100 cores500m1 GiB2 GiB
Less than 500 cores1 core2 GiB4 GiB
Less than 1,000 cores2 cores4 GiB8 GiB
Less than 5,000 cores2 cores8 GiB16 GiB
Less than 10,000 cores4 cores16 GiB32 GiB
10,000 cores or more4 cores32 GiB64 GiB

The default persistent volume size for the metrics database is 10 GiB. Data collected in the cluster is retained for up to 7 days before being purged. It is exported to Cast AI continuously and only needs to be stored locally for a short window.

ClickHouse operator detection

castctl checks whether a ClickHouse operator (Altinity) is already running in your cluster before installing. If one is found, castctl skips the operator installation and reuses the existing one. This prevents conflicts on clusters that already use ClickHouse for other workloads.

If your cluster has restricted Custom Resource Definition permissions and the operator cannot be installed automatically, castctl will surface an error. In this case, install the Altinity ClickHouse Operator CRDs manually first, then re-run castctl cluster connect --reliability-metrics.


What gets installed in your cluster

When reliability metrics is enabled, castctl installs the following components in the castai-agent namespace:

ComponentTypeRole
Collector agentDaemonSet (one pod per node)Observes HTTP and gRPC network traffic and sends measurements to the metrics database
Metrics databaseStatefulSet (ClickHouse)Stores and aggregates traffic measurements temporarily before they are exported to Cast AI
ExporterDeploymentReads aggregated data from the metrics database and streams it to Cast AI continuously
ClickHouse OperatorDeployment (cluster-scoped)Manages the lifecycle of the ClickHouse StatefulSet. Skipped if an operator is already present.

All components are managed by castctl and castctl castware upgrade. You do not need to interact with them directly under normal operation.


Default monitored ports

The collector observes traffic on these ports by default:

PortCommon use
8080HTTP application traffic
8443HTTPS application traffic
8090Common alternative HTTP port
6379Redis

Services on other ports

Traffic on ports not in this list is not collected. When installing with Helm, you can add ports by setting autoscaler.castai-kvisor.agent.reliabilityMetrics.obi.openPorts (a comma-separated list). For the full set of Helm values, see ArtifactHUB.


Helm charts

Installation via castctl is the recommended method. It takes care of many manual pitfalls and sets up the sizing profiles along with the requested resources properly.

To install the reliability-metrics stack with the Cast AI Helm chart, including for GitOps workflows, first review the generic Helm instructions at Helm charts.

Because castctl is not sizing the components for you, you will need to size the resources properly on your own, see:

Prerequisites

If you don't use the ClickHouse operator in your cluster, you need to install the Altinity ClickHouse CRDs:

kubectl apply -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/refs/tags/release-0.27.0/deploy/operator/parts/crd.yaml

If you already use the ClickHouse operator configured to watch all namespaces (including castai-agent), disable the
ClickHouse operator installed by this chart by setting:

--set autoscaler.castai-kvisor.reliabilityMetrics.operator.enabled=false

Installation

helm repo add castai-helm https://castai.github.io/helm-charts
helm repo update

helm upgrade -i castai castai-helm/castai -n castai-agent --create-namespace \
  --set global.castai.apiKey="<apiKey>" \
  --set global.castai.provider="<provider>" \
  --set tags.readonly=true \
  --set autoscaler.castai-kvisor.enabled=true \
  --set autoscaler.castai-kvisor.reliabilityMetrics.enabled=true \
  --set autoscaler.castai-kvisor.reliabilityMetrics.operator.enabled=true \
  --set autoscaler.castai-kvisor.agent.reliabilityMetrics.obi.sizingProfile="<sizingProfile>" \
  --set autoscaler.castai-kvisor.reliabilityMetrics.clickhouse.resources.requests.cpu="<cpu>" \
  --set autoscaler.castai-kvisor.reliabilityMetrics.clickhouse.resources.requests.memory="<memory>" \
  --set autoscaler.castai-kvisor.reliabilityMetrics.clickhouse.resources.limits.memory="<memory>"
📘

Note

We run a Helm lookup check for the ClickHouse operator in your cluster. This lookup doesn't work well with helm template. If you want to run helm template in your setup, consider adding:

--set autoscaler.castai-kvisor.reliabilityMetrics.clickhouse.skipCRDValidation=true

For all available configuration options, see ArtifactHUB.

Common Helm values

The values below are the ones most Helm and GitOps users need beyond the install command. Paths are relative to the castai-kvisor chart, so prefix each with autoscaler.castai-kvisor. when setting it on the umbrella chart.

ValueDefaultDescription
agent.reliabilityMetrics.obi.openPorts8080,8443,8090,6379Comma-separated list of ports the collector instruments. Add ports your services listen on. Each additional port raises collector memory use (roughly 27 MiB per instrumented process).
agent.reliabilityMetrics.obi.sizingProfilemediumCollector sizing profile: small, medium, large, xlarge, or custom. See collector agent sizing. Set to custom to size manually with agent.reliabilityMetrics.obi.resources.
agent.reliabilityMetrics.obi.exclude[]Workloads to skip, reducing memory use. Each entry matches on k8s_namespace, exe_path, open_ports, container_name, k8s_pod_labels, k8s_pod_annotations, or cmd_args (glob patterns supported). Built-in exclusions (kube-system, cert-manager, and others) apply unless you set excludeDefaults: false.
reliabilityMetrics.clickhouse.persistence.size100GiSize of the ClickHouse persistent volume (chart default; castctl sizes this differently — see metrics database sizing).
reliabilityMetrics.clickhouse.persistence.storageClassunsetStorage class for the ClickHouse volume. Uses the cluster's default storage class when unset.

Exclusions are easier to set from a values file than from --set:

autoscaler:
  castai-kvisor:
    agent:
      reliabilityMetrics:
        obi:
          exclude:
            - k8s_namespace: "monitoring"
            - exe_path: "*nginx*"

Ensure successful installation

kubectl logs -l app.kubernetes.io/name=castai-kvisor-controller --tail 100 | grep "component=clickhouse_exporter"

Look for a line similar to the one below, which indicates that data was successfully sent to Cast AI:

time=2026-07-29T14:32:58.736Z level=INFO source=worker.go:205 msg="cursor committed: last_exported_time=2026-07-29 14:31:21 +0000 UTC last_exported_pk=16025012183535387539" component=clickhouse_exporter table=reliability_metrics_db

It can take up to 3 minutes for the data to start flowing to Cast AI.
If you don't see this log, ensure you have at least one observable process in your cluster.
To test the installation, rerun it with --set autoscaler.castai-kvisor.trafficGenerator.enabled=true.
It will create a traffic-gen namespace running some arbitrary traffic generators.


Did this page help you?