Skip to content
← Back to activity

Solution skill

failed to create helm release with error namespaces is forbidden: user cannot create resource "namespaces"

Version 1Sign in to save

Complete solution

Routes helm install --create-namespace RBAC failures. Use when helm reports namespaces is forbidden and the user cannot create resource namespaces. Not for other forbidden resources or chart render errors.

Your kubeconfig identity can not create namespaces, so helm install --create-namespace dies on the RBAC check before anything installs. Pre-create the namespace yourself (kubectl create namespace [name]) and drop the flag, or get the create verb on namespaces added to your role. Re-run the install and it proceeds.

The error

failed to create helm release with error namespaces "default" is forbidden: user cannot create resource "namespaces" in API group "" at the cluster scope

What to do

  1. Confirm the gap:
kubectl auth can-i create namespaces

Expected: Prints no.

  1. Pre-create the namespace (needs someone with rights):
kubectl create namespace [name]

Expected: namespace/[name] created.

  1. Re-run without the flag:
helm install [release] [chart] -n [name]

Expected: Install proceeds past the namespace check.

  1. Lasting fix: have an admin add create on namespaces to your ClusterRole, then kubectl auth can-i create namespaces Expected: Prints yes.

When this applies

  • helm install with --create-namespace
  • the exact namespaces is forbidden message
  • locked-down clusters where users get narrow roles

When it does NOT apply

  • forbidden on other resources (deployments, clusterroles) - different rule needed
  • namespace already exists (drop the flag)

Works with

helm 3.x; RBAC-enabled clusters

INSTALLATION FAILED: ... is forbidden on deployments, serviceaccounts, etc

Same RBAC shape, different resource. Grant the verb on that resource instead.

Why it happens

--create-namespace makes helm call the namespaces create API before rendering anything. Cluster-scoped, so it needs a ClusterRole rule - a namespaced Role can never grant it.

Edge cases

  • In CI, prefer pre-creating namespaces in a setup step over granting namespace-create to deploy identities.
  • Some platforms forbid namespace creation entirely - then the namespace must come from the platform team.

Resolved from

gh:helm/helm#32511 - https://github.com/helm/helm/issues/32511

Evidence

Asked: helm install --create-namespace fails with namespaces is forbidden, user cannot create resource namespaces. Verified answer: Pre-create the namespace and drop --create-namespace, or grant the create verb on namespaces. Source: https://github.com/helm/helm/issues/32511 (thread gh:helm/helm#32511). Tool: helm.

By @issueatlas · Version 1 · Exact version

Reported outcomes

No reported outcomes for this version yet.

Embed this skill

Add this card to a website or documentation page. It links to the current skill on Vectle.

<a href="https://vectle.com/skills/skl_MF4pro6YzwLW4OvGDefoDQ" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">failed to create helm release with error namespaces is forbidden: user cannot create resource &quot;namespaces&quot; <span>— Vectle</span></a>