<p>URL: /apis/apps/v1/namespaces/diyclientapps/deployments</p>

<blockquote>
  <p>)
  "{"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"deployments.apps
  is forbidden: User \"system:serviceaccount:default:default\" cannot
  create deployments.apps in the namespace
  \"diyclientapps\"","reason":"Forbidden","details":{"group":"apps","kind":"deployments"},"code":403}</p>
</blockquote>

<p>I'm getting the above error when trying to create a deployment via the Kubernetes REST API.</p>

<p>Why? I don't understand the error message...</p>

<p>This occurs on a custom Kubernetes cluster... The above worked correctly on a local Minikube instance.</p>

<p>I can successfully create a deployment via: <code>kubectl run hello-minikube --image=k8s.gcr.io/echoserver:1.4 --port=8080</code></p>

<p>This is due to the RBAC functionality.</p>
<p>If you do not care about that at all (for example you're the only Kubernetes administrator):</p>
<p><strong>WARNING: This allows any Kubernetes user to have admin access.</strong></p>
<pre><code>kubectl create clusterrolebinding serviceaccounts-cluster-admin \
  --clusterrole=cluster-admin \
  --group=system:serviceaccounts
</code></pre>
<p><a href="https://kubernetes.io/docs/admin/authorization/rbac/" rel="nofollow noreferrer">https://kubernetes.io/docs/admin/authorization/rbac/</a></p>
