Back to Portainer

Kubernetes roles and bindings

advanced/kubernetes-roles-and-bindings.md

1.23.215.1 KB
Original Source

Kubernetes roles and bindings

{% hint style="info" %} Role-Based Access Control is only available in Portainer Business Edition. {% endhint %}

When managing a Kubernetes environment with Portainer, the Role-Based Access Control (RBAC) configuration is based on two components:

  • Kubernetes' cluster roles and namespace roles (which restrict access to Kubernetes itself)
  • Portainer's authorization flags (which restrict access to Portainer's functionality)

The following tables provide a reference for how our Portainer roles map to capabilities within Kubernetes.

Role Allocations <a href="#role-allocations" id="role-allocations"></a>

Portainer RoleCluster Role BindingNamespace Role Binding
Environment Administratorcluster-admin (k8s system)N/A
Operatorportainer-operator, portainer-helpdeskportainer-view (all non-system namespaces)
Userportainer-basicportainer-edit, portainer-view (only assigned namespaces)
Helpdeskportainer-helpdeskportainer-view (all non-system namespaces)
Read-Onlyportainer-basicportainer-view (only assigned namespaces)

Cluster Roles <a href="#cluster-roles" id="cluster-roles"></a>

portainer-basic <a href="#portainer-basic" id="portainer-basic"></a>

API GroupResourcesVerbs
(Empty)namespaces, nodesget, list
storage.k8s.iostorageclasseslist
metrics.k8s.ionamespaces, pods, nodesget, list
networking.k8s.ioingressclasseslist

portainer-helpdesk <a href="#portainer-helpdesk" id="portainer-helpdesk"></a>

API GroupResourcesVerbs
(Empty)componentstatuses, endpoints, events, namespaces, nodesget, list, watch
storage.k8s.iostorageclassesget, list, watch
networking.k8s.ioingressesget, watch
networking.k8s.ioingressclasseslist
metrics.k8s.iopods, nodes, nodes/stats, namespaceget, list, watch

portainer-operator <a href="#portainer-operator" id="portainer-operator"></a>

API GroupResourcesVerbs
(Empty)configmapsupdate
(Empty)podsdelete
appsdaemonsets, deployments, statefulsetspatch
metrics.k8s.iopods, nodes, nodes/stats, namespacesget, list, watch

Namespace Roles <a href="#namespace-roles" id="namespace-roles"></a>

portainer-edit <a href="#portainer-edit" id="portainer-edit"></a>

API GroupResourcesVerbs
(Empty)configmaps, endpoints, persistentvolumeclaims, pods, pods/attach, pods/exec, pods/portforward, pods/proxy, replicationcontrollers, replicationcontrollers/scale, secrets, serviceaccounts, services, services/proxycreate, delete, deletecollection, patch, update
(Empty)pods/attach, pods/exec, pods/portforward, pods/proxy, secrets, services/proxyget, list, watch
appsdaemonsets, deployments, deployments/rollback, deployments/scale, replicasets, replicasets/scale, statefulsets, statefulsets/scalecreate, delete, deletecollection, patch, update
autoscalinghorizontalpodautoscalerscreate, delete, deletecollection, patch, update
batchcronjobs, jobscreate, delete, deletecollection, patch, update
extensionsdaemonsets, deployments, deployments/rollback, deployments/scale, ingresses, networkpolicies, replicasets, replicasets/scale, replicationcontrollers/scalecreate, delete, deletecollection, patch, update
networking.k8s.ioingresses, networkpoliciescreate, delete, deletecollection, patch, update
policypoddisruptionbudgetscreate, delete, deletecollection, patch, update

portainer-view <a href="#portainer-view" id="portainer-view"></a>

API GroupResourcesVerbs
(Empty)bindings, componentstatuses, configmaps, endpoints, events, limitranges, namespaces, namespaces/status, persistentvolumeclaims, persistentvolumeclaims/status, pods, pods/log, pods/status, replicationcontrollers, replicationcontrollers/scale, replicationcontrollers/status, resourcequotas, resourcequotas/status, secrets, serviceaccounts, services, services/statusget, list, watch
appscontrollerrevisions, daemonsets, daemonsets/status, deployments, deployments/scale, deployments/status, replicasets, replicasets/scale, replicasets/status, statefulsets, statefulsets/scale, statefulsets/statusget, list, watch
autoscalinghorizontalpodautoscalers, horizontalpodautoscalers/statusget, list, watch
batchcronjobs, cronjobs/status, jobs, jobs/statusget, list, watch
extensionsdaemonsets, daemonsets/status, deployments, deployments/scale, deployments/status, ingresses, ingresses/status, networkpolicies, replicasets, replicasets/scale, replicasets/status, replicationcontrollers/scaleget, list, watch
networking.k8s.ioingresses, ingresses/status, networkpoliciesget, list, watch
policypoddisruptionbudgets, poddisruptionbudgets/statusget, list, watch

Portainer Access Restrictions <a href="#portainer-access-restrictions" id="portainer-access-restrictions"></a>

FunctionEndpoint adminOperatorHelpdeskStandard UserRead-only User
Namespace ScopeAllAll, EXCEPT SystemAll, EXCEPT SystemDefault + AssignedDefault + Assigned
NamespacesRWRRRR
Namespace DetailsRWRRRR
Namespace Access ManagementRW
ApplicationsRWRRRWR
Application DetailsRWRRRWR
Pod DeleteYesYes
Application ConsoleRWRW
Advanced DeploymentRWRW
ConfigMaps & SecretsRWRRRWR
ConfigMap & Secret DetailsRWRWRRWR
VolumesRWRRRWR
Volume DetailsRWRRRWR
ClusterRWRR
Cluster Node ViewRWRR
Cluster SetupRW
Application Error DetailsRRR
Storage Class DisabledRRR

Community Edition

The following tables cover the two roles available in Portainer Community Edition (CE). Note there is no Portainer access restriction in Portainer CE.

Portainer RoleCluster Role BindingNamespace Role Binding
Admin(no restriction)(no restriction)
Userportainer-cr-useredit (default k8s role, only assigned namespaces)

portainer-cr-user

API GroupResourcesVerbs
(Empty)namespaces, nodeslist
storage.k8s.iostorageclasseslist
networking.k8s.ioingresseslist