Skip to content

The API said no ​

Two different mechanisms refuse things, and they look different. Read the first line of the error and you know which one you are dealing with.

  • Forbidden means RBAC: you are not allowed to touch that kind of object at all. Two exceptions: a Forbidden that says exceeded quota means your namespace quota is full, see A pod will not start, and one that says the integer value of priority means the pod names a priority class it may not use, see Permissions and policies.
  • denied the request means a platform rule: your YAML is fine, but what it asks for is not permitted.

The second one matters because there is nothing to fix in the manifest. You need a different approach, and the message says which rule fired.

Forbidden on a kubectl command ​

Three causes, in the order they actually happen.

The command ran against another namespace. Your kubeconfig's context already targets your namespace, so this happens when -n names another one, or when the context's namespace was changed. Check what the current context carries:

bash
kubectl config view --minify | grep namespace

If it names another namespace, set yours back, see Access and kubectl.

The resource is not one you may touch. Your namespace grants a specific list, and everything else is denied. Ask directly rather than guessing:

bash
kubectl auth can-i create scaledobjects
kubectl auth can-i list nodes

The full list is under Permissions and policies. Some grants are read-only, notably your quota and limit ranges, so get can succeed while edit is refused on the same object.

A Certificate you write yourself ends here too, with certificates.cert-manager.io "<name>" is forbidden. Certificates come from the annotation on your HTTPRoute, see Gateway API.

Cluster-scoped reads are always refused, including harmless-looking ones:

text
Error from server (Forbidden): nodes is forbidden: User "..." cannot list
resource "nodes" in API group "" at the cluster scope

That is intended, not a broken setup. It also means you cannot run kubectl get storageclass; the two class names are on Storage.

KUBECONFIG points somewhere else. Confirm where you are:

bash
kubectl config current-context

denied the request on apply ​

A platform rule fired. Most rules answer in this shape, where the policy and rule names tell you which one it was:

text
Error from server: error when creating "app.yaml": admission webhook "<webhook>" denied the request:

resource <Kind>/<your-namespace>/<name> was blocked due to the following policies

<policy>:
  <rule>: <the rule that fired, and why>

The size bounds on pods and a few other objects answer in a second shape:

text
The pods "x" is invalid: : ValidatingAdmissionPolicy 'tenant-ksm-bounds' with binding 'tenant-ksm-bounds' denied request: Pod exceeds a platform bound: at most 16 containers and init containers combined, 32 tolerations, 16 nodeSelector entries, 16 resourceClaims, 128 volumes, 8 request and limit entries per container, image references of 512 characters, and a schedulerName and claim names of 253.

The full list of rules is under Permissions and policies. The ones that come up most often:

The message mentionsWhat it meansWhat to do
Volume type not allowedAn inline volume in the pod specAsk for storage with a PersistentVolumeClaim
Only ClusterIP Services are permittedNodePort, LoadBalancer or ExternalNameStay on ClusterIP and publish with an HTTPRoute
Hostname is not allowed in namespaceA hostname your namespace may not serveSee below
must declare at least one hostnameAn HTTPRoute with no hostnamesAdd one
Free-tier namespaces may only use the nfs-rwx StorageClassBlock storage on the free tierUse nfs-rwx, see Free tier
may not tolerate the 'ci' taintA toleration for the taint the message names, which is reserved for platform nodes, or one without a key (operator: Exists), which tolerates every taintRemove it and let the scheduler place the pod
Tolerations for reserved node taintsA toleration for the control plane or for a node that is under maintenance, still starting up or under resource pressure, or a not-ready or unreachable toleration without effect: NoExecuteRemove it, see node maintenance
karpenter.sh/do-not-disruptThe annotation on a pod, a pod template or a database, cache or job resourceRemove it and use a PodDisruptionBudget, see node maintenance
must select its pods with matchLabelsA PodDisruptionBudget with minAvailable, without maxUnavailable of at least 1, or without matchLabelsSee below
a pod covered by two budgets blocks node replacementTwo PodDisruptionBudgets that can cover the same podsSee below
may use at most 8 matchLabelsA budget selector with more than 8 matchLabels, more than 4 matchExpressions or more than 8 values in one expressionSee below
may hold at most 20 PodDisruptionBudgetsA new budget in a namespace that already holds 20See below
A disruption budget on this resourcespec.pdb on a Dragonfly or spec.podDisruptionBudget on a MariaDB or MaxScale with minAvailable or without maxUnavailable of at least 1See below
may not set spec.nodeNameA hand-picked nodeRemove it
body.maxSizeA request body limit above the cap, or zeroSet an explicit size at or below 512 MiB
may not set, add or remove the X-Robots-Tag headerAn X-Robots-Tag in the filters of a route with an itsh-apps.dev hostnameRemove it: those routes are always served with noindex, nofollow, see Free tier

A disruption budget is refused ​

Five messages, one per kind of check:

text
A PodDisruptionBudget in a tenant namespace must select its pods with
matchLabels, set maxUnavailable to at least 1 and not set minAvailable, so its
node can always be replaced. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenance
text
Another PodDisruptionBudget in this namespace can cover the same pods, and a
pod covered by two budgets blocks node replacement. Give every budget a
matchLabels key that the others also use, with a different value. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenance
text
A disruption budget on this resource must set maxUnavailable to at least 1 and
must not set minAvailable, so its node can always be replaced. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenance
text
A PodDisruptionBudget selector in a tenant namespace may use at most 8
matchLabels, and at most 4 matchExpressions with at most 8 values each. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenance
text
A tenant namespace may hold at most 20 PodDisruptionBudgets. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenance

The first one comes from a PodDisruptionBudget that sets minAvailable, sets no maxUnavailable or sets it to zero, or selects its pods without matchLabels. Switch to maxUnavailable: 1 and select with matchLabels.

The second one means another budget in the namespace could select some of the same pods. Two budgets are accepted only when a matchLabels key appears in both with different values, for example app.kubernetes.io/name: web and app.kubernetes.io/name: worker. matchExpressions do not count.

The third one is the same rule as the first, for the budget a Dragonfly (spec.pdb), MariaDB or MaxScale (spec.podDisruptionBudget) creates for you.

The fourth one means the selector is larger than the platform accepts. One matchLabels key that names the workload is usually all a budget needs.

The fifth one means the namespace already holds 20 budgets, counting the ones operators create for you. Cover each workload with one budget and remove the ones you no longer need.

Why the rules exist and how a budget should look is under node maintenance.

Hostname is not allowed in namespace ​

text
Hostname is not allowed in namespace 'tenant-7'. Tenant namespaces may only use
*.tenant-7.itsh.dev (paid) or *.tenant-7.itsh-apps.dev (free) subdomains or
hostnames listed in the itsh.dev/allowed-hostnames namespace annotation.

Your namespace owns the subdomain of its plan, <your-namespace>.itsh.dev on a paid plan or <your-namespace>.itsh-apps.dev on the free tier, and can serve any name under it immediately. Anything else has to be added in the portal first, where you prove the domain is yours with a DNS record.

Free namespaces cannot use a custom domain at all. The full rules are on Gateway API.

Exec/attach is only allowed into gVisor-sandboxed pods ​

You tried to get a shell in a managed PostgreSQL pod. Those run outside the sandbox, and exec is only permitted into sandboxed pods, so this combination is refused.

It applies to PostgreSQL only. MariaDB and Dragonfly pods take a shell like any other. To run SQL, forward the port and use a local client, which is not affected. See Databases.

What's next ​