---
title: "Production Installation | Cosmonic"
description: "Deploy Cosmonic Control to production Kubernetes with Helm. Covers cluster requirements, Helm values, ingress setup, and day-two operations for Wasm workloads."
canonical: "https://cosmonic.com/docs/operations/deploying-to-cosmonic-control/"
---

# Production Installation

Cosmonic Control separates **operator** and **developer** concerns: Wasm component developers use their own tooling to build and publish Wasm components, while operators use standard Kubernetes-native pipelines and tooling to deploy and manage them.

This page covers installing and configuring Cosmonic Control on a production Kubernetes cluster. See also:

- [Ingress and Workloads](https://cosmonic.com/docs/operations/ingress-and-workloads/) — configuring Envoy ingress and deploying Wasm workloads
- [Air-Gapped Installation](https://cosmonic.com/docs/operations/air-gapped-installation/) — mirroring images to a private registry
- [Upgrading](https://cosmonic.com/docs/operations/upgrading/) — upgrading Cosmonic Control to a new version
- [Observability](https://cosmonic.com/docs/observability/) — the built-in metrics, logs, and traces stack

## Prerequisites

- [`kubectl`](https://kubernetes.io/releases/download/)
- [Helm](https://helm.sh/docs) v3.8.0+
- Kubernetes **v1.24.0** or newer

## Installing Cosmonic Control

Cosmonic Control is distributed as an OCI Helm chart at `oci://ghcr.io/cosmonic/cosmonic-control`. The chart deploys the following components into the `cosmonic-system` namespace:

| Component | Role |
| --- | --- |
| `operator` | Runtime operator — reconciles CRDs and manages wasmCloud workloads |
| `nexus` | NATS message bus — internal communication backbone |
| `envoy` | HTTP ingress proxy — routes external traffic to Wasm workloads |
| `opentelemetry-collector` | Receives OTLP telemetry from all components |
| `prometheus` | Metrics store |
| `loki` | Log store |
| `tempo` | Trace store |
| `perses` | Observability dashboard UI |

### Cloud clusters (EKS, GKE, AKS)

For cloud clusters, set `envoy.service.type=LoadBalancer`. Most providers will provision a load balancer automatically. Use `envoy.service.annotations` to control cloud-specific load balancer behavior.

**AWS (Network Load Balancer):**

```shell
helm install cosmonic-control oci://ghcr.io/cosmonic/cosmonic-control \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --create-namespace \
  --set envoy.service.type=LoadBalancer \
  --set-json 'envoy.service.annotations={"service.beta.kubernetes.io/aws-load-balancer-type":"nlb","service.beta.kubernetes.io/aws-load-balancer-scheme":"internet-facing"}'
```

**GKE / AKS (standard cloud load balancer):**

```shell
helm install cosmonic-control oci://ghcr.io/cosmonic/cosmonic-control \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --create-namespace \
  --set envoy.service.type=LoadBalancer
```

### On-premises and bare-metal

For clusters without a cloud load balancer controller, expose Envoy as a `NodePort` and route external traffic to that port yourself:

```shell
helm install cosmonic-control oci://ghcr.io/cosmonic/cosmonic-control \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --create-namespace \
  --set envoy.service.type=NodePort \
  --set envoy.service.httpNodePort=30950
```

Traffic must reach port `30950` on any node in the cluster. Configure your external load balancer, firewall rules, or ingress proxy accordingly.

### Using a values file

For anything beyond a simple install, use a `values.yaml` file to manage configuration:

```yaml
# cosmonic-control-values.yaml
envoy:
  service:
    type: LoadBalancer
    annotations:
      service.beta.kubernetes.io/aws-load-balancer-type: nlb
      service.beta.kubernetes.io/aws-load-balancer-scheme: internet-facing
```

```shell
helm install cosmonic-control oci://ghcr.io/cosmonic/cosmonic-control \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --create-namespace \
  -f cosmonic-control-values.yaml
```

### Wait for readiness

```shell
kubectl rollout status deploy -l app.kubernetes.io/instance=cosmonic-control -n cosmonic-system
```

## Installing HostGroups

A **HostGroup** is a group of one or more wasmCloud host pods that run Wasm workloads. Every Cosmonic Control installation needs at least one HostGroup. HostGroups connect to the `nexus` NATS server and register themselves as available hosts for workload scheduling.

Install the default HostGroup:

```shell
helm install hostgroup oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system
```

Wait for it to be ready:

```shell
kubectl rollout status deploy -l app.kubernetes.io/instance=hostgroup -n cosmonic-system
```

### Scaling HostGroups

HostGroups are standard Kubernetes Deployments and can be scaled horizontally. Set `replicaCount` to run multiple host replicas:

```shell
helm install hostgroup oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --set replicaCount=3
```

Cosmonic Control automatically load-balances workloads across all available hosts in a HostGroup (round-robin). If a host crashes, its workloads are redistributed to remaining hosts.

### Multiple HostGroups

Deploy multiple HostGroups with different names and host labels to create distinct scheduling zones—for example, separating general-purpose workloads from GPU workloads, or isolating workloads by team or environment:

```shell
# General-purpose HostGroup
helm install hostgroup-default oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --set hostgroup=default \
  --set replicaCount=2

# GPU-enabled HostGroup
helm install hostgroup-gpu oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system \
  --set hostgroup=gpu \
  --set gpu=true \
  --set runtimeClassName=nvidia \
  --set replicaCount=1
```

Workload placement is controlled through host labels on `WorkloadDeployment` manifests. See [Multi-tenancy and RBAC](https://cosmonic.com/docs/operations/deploying-to-cosmonic-control/#multi-tenancy-and-rbac) for details.

### GPU HostGroups

Setting `gpu: true` on a HostGroup passes `--wasi-webgpu` to the control-host container, enabling Wasm workloads on that HostGroup to call the `wasi:webgpu` WIT interface.

For a ready-made GPU workload, see [OpenAI-Compatible LLM API](https://cosmonic.com/docs/operations/openai-compatible-llm/), which serves open-weight models through OpenAI's API.

To schedule GPU pods onto NVIDIA GPU nodes, set `runtimeClassName: nvidia`. Configure the NVIDIA device plugin and a matching Kubernetes `RuntimeClass` on the cluster beforehand; the Helm value must match the `RuntimeClass` name.

To make host-side artifacts (model files, precompiled kernels, driver libraries) available inside the HostGroup pod, set `volumes` and `volumeMounts`. These accept the standard Kubernetes [Volume](https://kubernetes.io/docs/concepts/storage/volumes/) and [VolumeMount](https://kubernetes.io/docs/reference/kubernetes-api/workload-resources/pod-v1/#volumes) specs and are available on any HostGroup, not only GPU ones:

```yaml
# hostgroup-gpu-values.yaml
hostgroup: gpu
gpu: true
runtimeClassName: nvidia
replicaCount: 1

volumes:
  - name: models
    hostPath:
      path: /opt/models
      type: Directory

volumeMounts:
  - name: models
    mountPath: /var/models
    readOnly: true
```

```shell
helm install hostgroup-gpu oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system \
  -f hostgroup-gpu-values.yaml
```

These values mount the directory into the host pod. For a workload to mount it in turn through a `hostPath` volume, also list the pod path under `hostVolumes.allowedHostPaths` (here `/var/models`); since v0.14.0 the host refuses `hostPath` volumes outside that list. See [`hostPath` volumes](https://cosmonic.com/docs/operations/host-groups/#hostpath-volumes).

### Separating the data-plane NATS

By default, the wasmCloud host inside a HostGroup pod uses one [NATS](https://nats.io/) connection — to the Nexus service — for both control-plane traffic (workload scheduling, host heartbeats) and data-plane traffic (`wasmcloud:messaging`, `wasi:keyvalue`, `wasi:blobstore`). For deployments that want to keep workload-generated NATS traffic off the control-plane bus, the HostGroup chart's `dataNats.url` value opens a second NATS connection used only for the data-plane plugins:

```yaml
# hostgroup-values.yaml
dataNats:
  url: "nats://workload-nats.shared.svc.cluster.local:4222"
```

When `dataNats.url` is empty (the default), the host reuses the Nexus connection so existing releases behave identically. When the URL points anywhere other than the Nexus URL, the host dials a fresh connection at startup; if it can't, the pod fails to come up.

Since v0.15.0 the host reconnects only to the address in `dataNats.url`, not to the member addresses a NATS cluster advertises (`natsIgnoreDiscoveredServers`, on by default). Name a Kubernetes Service or DNS name that resolves to every member of the cluster, so the connection still fails over when one member goes away.

If the data-plane NATS requires authentication, give the host its credentials with `dataNats.auth` (`nexus.auth` has the same shape for the control-plane connection). Each reads one method from an existing Secret in the release namespace: a `.creds` file, an nkey seed, a token, or a user and password:

```yaml
# hostgroup-values.yaml
dataNats:
  url: "nats://workload-nats.shared.svc.cluster.local:4222"
  auth:
    existingSecret: data-nats-auth   # kubectl create secret generic data-nats-auth --from-file=user.creds
    credentialsKey: user.creds       # or nkeyKey, tokenKey, or user with passwordKey
```

The host rereads the file when it reconnects, so a rotated Secret takes effect without a restart. Set `dataNats.tls` alongside it for a server reached over TLS; see [Key chart values](https://cosmonic.com/docs/operations/host-groups/#key-chart-values).

Typical reasons to split:

- The data-plane NATS lives outside the cluster (a managed NATS account, or a separate cluster) and you don't want workload pods talking to it via the control-plane Nexus.
- You want [JetStream KV](https://docs.nats.io/nats-concepts/jetstream/key-value-store) usage to scale independently of operator/host scheduling traffic.
- You want to size, persist, or replicate the data-plane bus differently from the control-plane bus — for example, a clustered Nexus for HA scheduling and a separate single-node NATS for ephemeral workload messaging.

`wasi:keyvalue` buckets created by workloads land on whichever NATS connection serves the data plane, so switching `dataNats.url` after workloads are running moves those buckets to the new server and the old buckets are no longer visible. Drain workloads using `wasi:keyvalue` before changing the URL.

### Passing extra args and env to the host

Three additive HostGroup values let you extend the host container without forking the chart:

- `env` — appended after the chart's own environment variables, so entries can reference earlier vars via `$(VAR)` and override them on duplicate names. Accepts the standard Kubernetes [`env`](https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/) shape including `valueFrom` for [`ConfigMap`](https://kubernetes.io/docs/concepts/configuration/configmap/) / [`Secret`](https://kubernetes.io/docs/concepts/configuration/secret/) references.
- `envFrom` — populates the host container from one or more `ConfigMap`s / `Secret`s.
- `extraArgs` — appended verbatim to the host CLI, for host flags the chart does not template (custom host builds, experimental flags).

```yaml
# hostgroup-values.yaml
env:
  - name: RUST_LOG
    value: debug
envFrom:
  - secretRef:
      name: host-extra-secrets
extraArgs:
  - "--allow-insecure-registries"
```

## Resource sizing

### Control plane

The control plane components are each deployed as single replicas. The chart exposes a `resources` block on every component. As of chart 0.7.0, each container ships default requests and limits — a memory request and limit plus a CPU request, sized conservatively for a small cluster. CPU is deliberately request-only, since a CPU limit only throttles. Override per component in a values file:

```yaml
# cosmonic-control-values.yaml
operator:
  resources:
    requests:
      cpu: 100m
      memory: 128Mi
    limits:
      memory: 512Mi

nexus:
  resources:
    requests:
      cpu: 100m
      memory: 256Mi
    limits:
      memory: 512Mi

prometheus:
  resources:
    requests:
      cpu: 100m
      memory: 512Mi
    limits:
      memory: 1Gi
```

The `resources` block is accepted under `operator`, `nexus`, `envoy`, `opentelemetryCollector`, `prometheus`, `loki`, `tempo`, `jaeger`, and `perses`. Each follows the standard Kubernetes [ResourceRequirements](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) shape. The components whose memory grows with cluster activity are the operator (informer cache scales with watched objects), Prometheus (TSDB scales with active series), and Nexus (JetStream scales with `wasi:keyvalue` and Artifact store usage) — raise those limits first if pods restart with `OOMKilled` status.

> **Note**
>
> Most control-plane components currently run as single replicas. Nexus can run as a clustered StatefulSet for HA — see [Nexus persistence and HA](https://cosmonic.com/docs/operations/deploying-to-cosmonic-control/#nexus-persistence-and-ha). For other components that need HA in production, contact [support@cosmonic.com](mailto:support@cosmonic.com).

### HostGroups

HostGroup pods run Wasm workloads in-process, so memory scales with the workloads scheduled onto each host, and these are the pods that most benefit from tuning. As of v0.9.3 the chart default is a `250m` CPU / `768Mi` memory request with a `6Gi` memory limit, and the host takes three-quarters of `limits.memory` as its guest budget. Size `resources` for your expected per-host workload density, and set the `hostMemory` knobs to match; the chart's `values.yaml` documents small/medium/large sizings, and the [host memory section](https://cosmonic.com/docs/operations/upgrading/#hostgroup-memory-defaults-changed) explains how the knobs relate. For example:

```yaml
# hostgroup-values.yaml
replicaCount: 3

resources:
  requests:
    cpu: 500m
    memory: 256Mi
  limits:
    memory: 2Gi
hostMemory:
  defaultHeapMemory: 512Mi
```

As a starting point: a single HostGroup pod can comfortably run dozens of concurrent Wasm components given their small footprint (typically sub-millisecond startup, kilobyte-scale memory per component). Scale out by increasing `replicaCount` rather than individual pod resource limits.

## Nexus persistence and HA

Nexus runs an embedded NATS server, and [JetStream](https://docs.nats.io/nats-concepts/jetstream) state — every `wasi:keyvalue` bucket created by workloads, plus the `ARTIFACTS` object store backing the [`Artifact` CRD](https://cosmonic.com/docs/custom-resources/#artifact) — lives in `/data` inside the Nexus pod. By default, `/data` is an [`emptyDir`](https://kubernetes.io/docs/concepts/storage/volumes/#emptydir) and that state is destroyed on pod restart.

### Durable single-node Nexus

For workloads that need durable `wasi:keyvalue` state but don't require failover, enable persistence with the default replica count:

```yaml
# cosmonic-control-values.yaml
nexus:
  persistence:
    enabled: true
    size: 10Gi
    storageClassName: ""   # empty = cluster default StorageClass
```

This switches Nexus from a single-replica [`Deployment`](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/) (the default `emptyDir` layout) to a [`StatefulSet`](https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/) with a `volumeClaimTemplate`. The PVC is named `data-nexus-0` and survives `helm uninstall` so a reinstall can reattach to existing JetStream state.

### Clustered Nexus for HA

For high availability, scale `nexus.replicas` to an odd number so JetStream's [RAFT](https://raft.github.io/) meta-group has a quorum:

```yaml
# cosmonic-control-values.yaml
nexus:
  replicas: 3
  persistence:
    enabled: true
    size: 10Gi
```

The chart `fail`s the install at template time if `replicas` is even, or if `replicas > 1` is paired with persistence disabled, so misconfiguration cannot reach the cluster. Each replica gets its own PVC (`data-nexus-0`, `data-nexus-1`, `data-nexus-2`); a headless `nexus-headless` Service provides per-pod DNS and cluster routes are auto-generated.

Two follow-on details when running clustered:

- The operator passes `-artifact-replicas={{ nexus.replicas }}`, so the `ARTIFACTS` object store is replicated to match. The operator reconciles the bucket's replica count on every start, so scaling Nexus from 1 to 3 brings the Artifact bucket along.
- Server clustering does not replicate `R=1` data on its own. JetStream streams and KV buckets need their replica count set at or above the desired survival threshold to outlast a node loss — the `ARTIFACTS` bucket gets this automatically, but any KV bucket the host opens on behalf of a workload keeps whatever replica count was set at its creation.

### Upgrading an existing persistent install

The v0.6.0 chart replaces the previous `Deployment` + `nexus-data` PVC layout with a `StatefulSet` + `data-nexus-0` PVC, and `nexus.persistence.existingClaim` is removed. JetStream state on the old PVC does not roll forward on its own. To preserve it, copy `/data` from the old `nexus-data` PVC into `data-nexus-0` (typically via a one-shot Job that mounts both) before scaling the StatefulSet up. See the [v0.6.x upgrade notes](https://cosmonic.com/docs/operations/upgrading/#upgrading-from-v06x-or-earlier) for where this sits in an upgrade.

## Multi-tenancy and RBAC

### Pinning workloads to a HostGroup

Every host advertises its group name as a `hostgroup` label. To pin a workload to a specific group, deploy that group with a distinct `hostgroup` name and select it with `hostSelector` in a `WorkloadDeployment`:

```yaml
# hostgroup-team-a-values.yaml
hostgroup: team-a
replicaCount: 2
```

```shell
helm install hostgroup-team-a oci://ghcr.io/cosmonic/cosmonic-control-hostgroup \
  --version 0.15.0 \
  --namespace cosmonic-system \
  -f hostgroup-team-a-values.yaml
```

Reference the group name in a `WorkloadDeployment` using the `hostSelector` field:

```yaml
spec:
  template:
    spec:
      hostSelector:
        hostgroup: team-a
```

`hostSelector` matches labels on the `Host` objects a group registers. In the current chart the `hostgroup` name is the label available for selection.

### Kubernetes RBAC

Cosmonic Control creates one `ClusterRole` for the operator service account, plus two namespace-scoped `Role` objects in `cosmonic-system`. The `ClusterRole` grants:

- `control.cosmonic.io`: `ProjectEnvironment`, `HTTPTrigger` (plus their status subresources)
- `runtime.wasmcloud.dev`: `Artifact`, `Host`, `Workload`, `WorkloadReplicaSet`, `WorkloadDeployment` (plus status and finalizers subresources)
- `""` (core): `ConfigMap`, `Secret`, `Namespace` (read-only); `Service` (read-only); `Pod` (`get`, `list`, `patch`, `watch`)

The namespace-scoped Roles cover leader election (`coordination.k8s.io/leases` in `cosmonic-system`) and host finalizer reconciliation (a second `Pod` grant scoped to `cosmonic-system`). As of v0.13.0 operator replicas also record which Envoy replicas they serve, and what each accepted, in Leases in `cosmonic-system`; the leader-election Role already covers this. If you set `rbac.create=false` and supply your own Role, grant `get`, `list`, `watch`, `create`, `patch` and `delete` on `coordination.k8s.io` `leases` there. The `Pod` permissions let the operator patch the finalizer on a wasmCloud host pod when it terminates, so workloads reschedule immediately instead of waiting for the reconciliation loop.

Tenant isolation is enforced by Kubernetes namespace-scoped RBAC. Grant teams access to their own namespaces with standard `Role`/`RoleBinding` objects scoped to the `control.cosmonic.io` and `runtime.wasmcloud.dev` API groups. See [Tenant RBAC](https://cosmonic.com/docs/operations/tenant-rbac/) for the full RBAC reference and worked examples.

## Further reading

- [Ingress and Workloads](https://cosmonic.com/docs/operations/ingress-and-workloads/) — configuring Envoy and deploying HTTP workloads
- [Component Configuration](https://cosmonic.com/docs/operations/component-configuration/) — passing config, secrets, and private registry credentials to components
- [Tenant RBAC](https://cosmonic.com/docs/operations/tenant-rbac/) — namespace-scoped RBAC for multi-team deployments
- [Air-Gapped Installation](https://cosmonic.com/docs/operations/air-gapped-installation/) — mirroring images to a private registry with ORAS
- [Upgrading](https://cosmonic.com/docs/operations/upgrading/) — `helm upgrade` procedures and version migration notes
- [Observability](https://cosmonic.com/docs/observability/) — the built-in Prometheus, Loki, Tempo, and Perses stack
- [GitOps with Argo CD](https://cosmonic.com/docs/integrations/gitops-with-argo-cd/) — a complete GitOps workflow example
- [Custom Resources](https://cosmonic.com/docs/custom-resources/) — the full CRD reference

Last updated on **Nov 10, 2026** by **Liam Randall**
