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.
Forbiddenmeans RBAC: you are not allowed to touch that kind of object at all. Two exceptions: aForbiddenthat saysexceeded quotameans your namespace quota is full, see A pod will not start, and one that saysthe integer value of prioritymeans the pod names a priority class it may not use, see Permissions and policies.denied the requestmeans 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:
kubectl config view --minify | grep namespaceIf 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:
kubectl auth can-i create scaledobjects
kubectl auth can-i list nodesThe 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:
Error from server (Forbidden): nodes is forbidden: User "..." cannot list
resource "nodes" in API group "" at the cluster scopeThat 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:
kubectl config current-contextdenied 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:
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:
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 mentions | What it means | What to do |
|---|---|---|
| Volume type not allowed | An inline volume in the pod spec | Ask for storage with a PersistentVolumeClaim |
| Only ClusterIP Services are permitted | NodePort, LoadBalancer or ExternalName | Stay on ClusterIP and publish with an HTTPRoute |
| Hostname is not allowed in namespace | A hostname your namespace may not serve | See below |
| must declare at least one hostname | An HTTPRoute with no hostnames | Add one |
| Free-tier namespaces may only use the nfs-rwx StorageClass | Block storage on the free tier | Use nfs-rwx, see Free tier |
| may not tolerate the 'ci' taint | A toleration for the taint the message names, which is reserved for platform nodes, or one without a key (operator: Exists), which tolerates every taint | Remove it and let the scheduler place the pod |
| Tolerations for reserved node taints | A 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: NoExecute | Remove it, see node maintenance |
| karpenter.sh/do-not-disrupt | The annotation on a pod, a pod template or a database, cache or job resource | Remove it and use a PodDisruptionBudget, see node maintenance |
| must select its pods with matchLabels | A PodDisruptionBudget with minAvailable, without maxUnavailable of at least 1, or without matchLabels | See below |
| a pod covered by two budgets blocks node replacement | Two PodDisruptionBudgets that can cover the same pods | See below |
| may use at most 8 matchLabels | A budget selector with more than 8 matchLabels, more than 4 matchExpressions or more than 8 values in one expression | See below |
| may hold at most 20 PodDisruptionBudgets | A new budget in a namespace that already holds 20 | See below |
| A disruption budget on this resource | spec.pdb on a Dragonfly or spec.podDisruptionBudget on a MariaDB or MaxScale with minAvailable or without maxUnavailable of at least 1 | See below |
| may not set spec.nodeName | A hand-picked node | Remove it |
| body.maxSize | A request body limit above the cap, or zero | Set an explicit size at or below 512 MiB |
| may not set, add or remove the X-Robots-Tag header | An X-Robots-Tag in the filters of a route with an itsh-apps.dev hostname | Remove it: those routes are always served with noindex, nofollow, see Free tier |
A disruption budget is refused
Five messages, one per kind of check:
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-maintenanceAnother 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-maintenanceA 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-maintenanceA 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-maintenanceA tenant namespace may hold at most 20 PodDisruptionBudgets. See
https://itsh.dev/docs/en/kubernetes/permissions#node-maintenanceThe 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
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
- Permissions and policies for the complete list
- A pod will not start if the manifest applied but nothing came up