---
title: "Kubernetes (Namespaced) | Speedscale Docs"
description: "Install Speedscale confined to a single Kubernetes namespace, with no cluster-scoped permissions, CRDs, or admission webhooks, for clusters that cannot grant the classic operator install."
canonical: "https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced/"
---

[Documentation index](https://docs.speedscale.com/getting-started/llms.txt) | [Markdown](https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced/index.md) | [Canonical page](https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced/)

# Namespace-scoped installation

The public `speedscale-operator` chart has a namespaced mode for clusters where the [classic Speedscale Operator](https://docs.speedscale.com/getting-started/installation/install/kubernetes-operator/) cannot be installed: environments that forbid cluster-scoped grants, `CustomResourceDefinition`s, or admission webhooks. Set `namespaced.enabled=true` in chart version 2.5.1133 or later. Use 2.5.1145 or later for restricted egress and mocked replay on a RollingUpdate Deployment. This mode renders a forwarder, inspector, and replay coordinator in one existing namespace. The coordinator drives replays from labeled `ConfigMap`s instead of a `TrafficReplay` custom resource.

<a id="who-this-is-for"></a>

## Who this is for

Use this install if your platform or security team will not grant:

*   a `ClusterRole` or cluster role binding of any kind
*   a `CustomResourceDefinition`
*   a `MutatingWebhookConfiguration` / `ValidatingWebhookConfiguration`
*   a `DaemonSet` (which rules out [eBPF capture](https://docs.speedscale.com/reference/ebpf-traffic-collection/))

Everything this chart renders is scoped to one namespace. If your cluster has no such restriction, install the [classic operator](https://docs.speedscale.com/getting-started/installation/install/kubernetes-operator/) instead: it captures with eBPF by default, supports every workload the namespaced install does plus `DaemonSet`s, and needs less day-to-day CLI interaction.

Compare both paths in [Kubernetes installation options](https://docs.speedscale.com/getting-started/installation/install/kubernetes/). Review [limitations and compatibility](https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced-limitations/) before installing; keep [uninstall and recovery](https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced-runbooks/) available when removing a release.

Two capture mechanisms, one flag

The namespaced install captures traffic by injecting a `goproxy` sidecar, the same mutation the classic install's admission webhook performs, computed and applied by `proxymock` itself with your own kubeconfig. See the [sidecar capture guide](https://docs.speedscale.com/guides/capture/sidecar-namespaced/) for the full `inject` / `uninject` / `status` workflow.

<a id="prerequisites"></a>

## Prerequisites

<a id="the-namespace-must-already-exist"></a>

### The namespace must already exist

The chart renders **no `Namespace` object**. Create the target namespace out of band, with whatever process already governs namespaces in your cluster:

```bash
kubectl create namespace banking-app
```

Do not use `helm install --create-namespace`

It works, and that is the problem: it makes the install look like it needs namespace-create rights, which is exactly the permission a namespaced install is meant to prove it does not need. Create the namespace separately and install into it.

<a id="an-api-key-secret-must-already-exist"></a>

### An API key Secret must already exist

The namespaced mode **never creates** the API key Secret; it references one by name (`namespaced.apiKeySecret`, default `speedscale-apikey`). Use a service account API key and load it from a protected file:

```bash
kubectl -n banking-app create secret generic speedscale-apikey \
  --from-file=SPEEDSCALE_API_KEY=/secure/path/to/key \
  --from-literal=SPEEDSCALE_APP_URL=app.speedscale.com
```

Point `namespaced.apiKeySecret` at a different name if your platform provisions credentials elsewhere (sealed-secrets, external-secrets, a Vault agent).

If outbound access to Speedscale Cloud goes through a Kerberos-authenticated proxy, use chart version 2.5.1169 or later and follow the [namespaced chart proxy setup](https://docs.speedscale.com/reference/proxy_config/#namespaced-chart-setup).

<a id="a-pod-security-exemption-for-the-instrumented-namespace"></a>

### A Pod Security exemption for the instrumented namespace

The Speedscale control plane (forwarder, inspector, replay coordinator) runs under the **`restricted`** Pod Security Standard with no changes needed, with one caveat: turning on `tls.createJKS` (off by default) adds a `post-install` Job that runs as root to write a Java keystore, so a namespace enforcing `restricted` must either leave `createJKS` off or exempt that one Job. The namespace holding the **workloads you capture or replay against** is different: the injected sidecar's init container needs `NET_ADMIN` and `NET_RAW` to redirect the workload's traffic through the proxy, which neither `restricted` nor `baseline` allows.

Label that namespace to allow it:

```yaml
pod-security.kubernetes.io/enforce: privileged
```

This is a namespace-wide exemption

`pod-security.kubernetes.io/enforce: privileged` permits every pod in the namespace to request any capability, not only Speedscale's sidecar. If your policy needs to scope the exemption to pods actually carrying the Speedscale sidecar, use your admission controller instead of the built-in PSA label:

*   **Gatekeeper**: a constraint that exempts pods carrying the `sidecar.speedscale.com/injected` label from your capability-restricting `ConstraintTemplate`.
*   **Kyverno**: a `policy exception` (or `exclude` block, pre-1.11) scoped to the same label, on the policy that would otherwise reject `NET_ADMIN` / `NET_RAW`.

Both need the exemption authored once per cluster by whoever owns that policy engine; Speedscale's chart does not and cannot render it.

<a id="openshift-needs-a-one-time-cluster-admin-grant"></a>

### OpenShift needs a one-time cluster-admin grant

The chart deliberately renders **no `SecurityContextConstraints`**: an SCC is cluster-scoped, which is exactly the kind of grant this install exists to avoid asking for. On OpenShift, a cluster administrator has to apply an SCC allowing `NET_ADMIN` / `NET_RAW` once, out of band, before capture or replay can inject a sidecar. See the [SCC example in the OpenShift install guide](https://docs.speedscale.com/getting-started/installation/install/openshift/#securitycontextconstraint-example) and scope it to the workload namespace's service accounts rather than cluster-wide.

This is worth surfacing to your security reviewer up front: "nothing outside your namespace" is true of everything the chart itself renders, but an OpenShift cluster still needs this one cluster-admin action before capture works.

<a id="kubernetes-121-helm-3"></a>

### Kubernetes 1.21+, Helm 3+

<a id="install-the-public-chart"></a>

## Install the public chart

The namespaced and classic modes use the same public `speedscale-operator` chart. This command uses the released 2.5.1169 chart and component images. Install into the existing application namespace without `--create-namespace`:

```bash
helm repo add speedscale https://speedscale.github.io/operator-helm/
helm repo update
helm upgrade --install speedscale-operator speedscale/speedscale-operator \
  --version 2.5.1169 \
  --namespace banking-app \
  --set namespaced.enabled=true \
  --set namespaced.clusterName=banking-cluster \
  --set namespaced.appUrl=app.speedscale.com \
  --set namespaced.forwarder.primaryTransport=cloud
```

`namespaced.forwarder.primaryTransport=cloud` sends captured records to Speedscale Cloud. For customer-owned S3 or S3-compatible storage, use `namespaced.forwarder.primaryTransport=byoc` and the [BYOC Kubernetes configuration](https://docs.speedscale.com/byoc/configure-kubernetes/#customer-owned-s3-replay-storage). The Kubernetes permission scope and storage destination are separate choices. With Cloud transport, the released 2.5.1145 chart passed a minikube test behind default-deny egress and a proxy allowing only `app.speedscale.com`, `staging.speedscale.com`, and `dev.speedscale.com`. See the [restricted-egress results](https://docs.speedscale.com/getting-started/installation/install/kubernetes-namespaced-limitations/#restricted-egress-in-251145). Your firewall or proxy must enforce the allowed destinations and restrict which Pods can use that route. The default chart installation remains the classic operator; always set `namespaced.enabled=true` for this mode.

For an outbound proxy, set the root `http_proxy`, `https_proxy`, and `no_proxy` chart values in a values file. Include local Services, DNS, and the Kubernetes API in `no_proxy` as required by your network. The released chart passes these values to all three namespaced control-plane components. The Helm namespace and workload namespace must match.

The installer needs permission to create and manage the namespace-scoped Deployments, Services, ConfigMaps, Secrets, Jobs, ServiceAccounts, Roles, and RoleBindings the chart renders, plus permission to grant the rules in those Roles. It needs no permission to create a CRD, webhook, ClusterRole, or resource in another namespace. Review the exact render before installing:

```bash
helm template speedscale-operator speedscale/speedscale-operator \
  --version 2.5.1169 --namespace banking-app \
  --set namespaced.enabled=true --include-crds > namespaced-rendered.yaml
```

The namespaced render contains no Speedscale CRD, admission webhook, ClusterRole, ClusterRoleBinding, DaemonSet, or Namespace object. Review the rendered RBAC against the installer identity before applying it. The default classic render has cluster-scoped resources. The rendered YAML includes a generated TLS private key; store or discard it according to your secret-handling policy.

<a id="verify"></a>

## Verify

```bash
proxymock cluster status --speedscale-namespace banking-app
```

This is read-only end to end (every permission probe is a `SelfSubjectAccessReview`, which asks the API server's authorizer a question rather than changing anything), and it always produces a full report, even against a cluster it cannot reach. It checks, in order:

1.  which kube context and Speedscale namespace the command resolved to
2.  which components (forwarder, inspector, replay coordinator) are deployed and whether their pods are ready
3.  whether the forwarder and inspector are actually reachable over a port-forward, naming the failing hop when they are not
4.  whether your kubeconfig has the permissions `proxymock` needs in this namespace (denies are reported as warnings, not failures)
5.  whether Speedscale cloud is configured and reachable

When the inspector is not reachable, the report also lists what depends on it: logs, events, Services, dependencies, capture readiness verification, and the web UI's workload detail tabs all need it.

```bash
proxymock cluster status --speedscale-namespace banking-app -o json
```

`$SPEEDSCALE_NAMESPACE` works the same as `--speedscale-namespace`, so a shell session or CI job can set it once instead of repeating the flag on every command. Every capture and replay verb in the [sidecar capture](https://docs.speedscale.com/guides/capture/sidecar-namespaced/) and [namespaced replay](https://docs.speedscale.com/guides/replay/namespaced/) guides accepts the same flag.

<a id="what-runs-and-what-deliberately-does-not"></a>

## What runs, and what deliberately does not

| Runs | Does not run |
| --- | --- |
| **forwarder**: receives captured traffic from sidecars and writes it to the selected Cloud or customer-owned storage destination | `Namespace`: installing one needs cluster-scoped write |
| **inspector**: read-only workload inventory (pods, deployments, statefulsets, logs, events) for `proxymock` and the dashboard | `CustomResourceDefinition`: cluster-scoped, and shared with every other install |
| **replay coordinator**: drives replays from labeled `ConfigMap`s, injects and restores the sidecar on the workload under test | `MutatingWebhookConfiguration` / `ValidatingWebhookConfiguration`: intercepts every API call in the cluster |
|  | `ClusterRole` / cluster role bindings: the exact grant this chart exists to avoid |
|  | `DaemonSet`: no eBPF (`nettap`) capture; schedules a pod on every node |
|  | `SecurityContextConstraints`, `PriorityClass`: cluster-scoped policy |

Every `Role` and `RoleBinding` the chart renders in this mode is scoped to the release namespace. Review the render for your exact chart version and values before granting access.

Two settings are opt-in on purpose because they can make the chart un-installable for the exact user it is written for: `namespaced.inspector.metricsEnabled` and `namespaced.replayRuntime.metricsEnabled` each add a `metrics.k8s.io/pods` read rule, and both default to **off**. Kubernetes refuses to let an installing identity create a `Role` granting a permission it does not itself hold, so an unconditional rule would make `helm install` fail outright for a namespace admin who was never granted `metrics.k8s.io/pods`. Turn either on only if the installing identity already holds that read; leaving them off costs per-pod CPU/memory enrichment in reports and nothing else.
