<p>I'm new  in Kubernetes and I have a code error 403 trying the access.</p>

<pre><code>kubectl cluster info
Kubernetes master is running at https://x.x.x.x:6443
KubeDNS is running at https://x.x.x.x:6443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

"status": "Failure",
  "message": "namespaces is forbidden: User \"system:anonymous\" cannot list namespaces at the cluster scope",
  "reason": "Forbidden",
  "details": {
    "kind": "namespaces"
  },
  "code": 403   


kubectl get pods --all-namespaces


kube-system   calico-etcd-6629s                                      1/1       Running   0          10h
kube-system   calico-kube-controllers-675684d4bb-5h28d               1/1       Running   0          10h
kube-system   calico-node-r75wv                                      2/2       Running   0          10h
kube-system   etcd-sp2013a....                                        1/1       Running   0          10h
kube-system   kube-apiserver-sp2013a ...                              1/1       Running   0          10h
kube-system   kube-controller-manager-sp2013a....                     1/1       Running   0          10h
kube-system   kube-dns-6f4....df-fcqvt                               3/3       Running   0          10h
kube-system   kube-proxy-mpf2j                                       1/1       Running   0          10h
kube-system   kube-scheduler-sp2013a......                            1/1       Running   0          10h
</code></pre>

<p>everything is running..</p>

<p>That sounds like you're being blocked by the cluster's RBAC policies. The <code>system:anonymous</code> user is being prevented from listing the namespaces in the cluster. 
(Along the lines of <code>kubectl get namespaces</code>)</p>

<p>Running <code>kubectl create clusterrolebinding cluster-system-anonymous --clusterrole=cluster-admin --user=system:anonymous</code> would create a <code>clusterrolebinding</code> that adds the <code>system:anonymous</code> user to the <code>cluster-admin</code> role. </p>

<p>Blindly elevating accounts to <code>cluster-admin</code> is <em>not</em> recommended in a production cluster but since you are new, this should get you up and running. </p>

<p>All clusters need some form of authorization before accessing the API-server (accessing <code>kubectl</code>) like certificate authentication. RBAC is a way to <em>limit</em> the actions that users (both human users and service accounts) can take <em>in</em> the cluster. </p>

<p>A great RBAC primer from the CNCF can be found <a href="https://www.cncf.io/blog/2018/08/01/demystifying-rbac-in-kubernetes/" rel="noreferrer" title="Demystifying RBAC in Kubernetes">here</a> and the official <a href="https://kubernetes.io/docs/reference/access-authn-authz/rbac/" rel="noreferrer" title="RBAC Docs">docs</a> are great too! Good Luck! </p>
