All Tools View Categories About Contact Privacy

ClusterRole and ClusterRoleBinding YAML Generator

Build a valid Kubernetes ClusterRole and ClusterRoleBinding (rbac.authorization.k8s.io/v1) - cluster-scoped rules plus subjects.

Runs entirely in your browser - nothing is uploaded and no cluster connection is made.
0
rules
0
subjects
Your generated ClusterRole and ClusterRoleBinding YAML will appear here.

About ClusterRole and ClusterRoleBinding YAML Generator

A ClusterRole grants permissions across the entire cluster and a ClusterRoleBinding attaches it to subjects. The ClusterRole and ClusterRoleBinding YAML Generator writes both documents in one file so you do not have to recall the rbac.authorization.k8s.io/v1 schema.

You set the ClusterRole name, then list one or more rules, one per line as apiGroups|resources|verbs (empty apiGroup = core). You then set the ClusterRoleBinding name and subjects, one per line as kind|name|namespace, where kind is User, Group or ServiceAccount. The tool wires up the roleRef automatically. Because these are cluster-scoped, there is no namespace on the resources themselves. The resulting YAML is valid rbac.authorization.k8s.io/v1.

Names are validated as RFC 1123 labels, at least one rule and one subject are required, and each rule needs resources and verbs. Problems are reported in a clear panel. Everything runs locally and nothing is uploaded.

Features

  • ClusterRole - name and label-based permissions, no namespace.
  • Rules - one per line as apiGroups|resources|verbs.
  • ClusterRoleBinding - name and roleRef wired to the ClusterRole.
  • Subjects - one per line as kind|name|namespace.
  • rbac.authorization.k8s.io/v1 - correct schema.
  • Validation - RFC 1123 names, rules and subjects.
  • Copy / Download / Print - get clusterrole-clusterrolebinding.yaml wherever you need it.

How to Use

  1. Name the ClusterRole. Type a valid RFC 1123 name.
  2. Add rules. One per line: apiGroups|resources|verbs.
  3. Set the binding name and subjects. kind|name|namespace per line.
  4. Watch the preview and export.

Examples

Example 1 - nodes read. rule ""|nodes|get,list,watch.

Example 2 - storage. rule storage.k8s.io|persistentvolumes|get,list.

Example 3 - service accounts. Subject ServiceAccount|reader|default.

Example 4 - user. Subject User|admin|.

Example 5 - group. Subject Group|cluster-admins|.

Benefits

  • Correct schema - valid rbac.authorization.k8s.io/v1 ClusterRole + ClusterRoleBinding.
  • Cluster scope - no namespace on the resources.
  • Line-based rules - easy multi-rule input.
  • Validated - names, rules and subjects checked.
  • Private - everything runs in the browser.
  • Copy, download or print - get the manifest where you need it.

Frequently Asked Questions

How is this different from Role and RoleBinding?
ClusterRole and ClusterRoleBinding are cluster-scoped, so they have no namespace and can grant permissions across the whole cluster, including non-namespaced resources such as nodes.
What does this tool generate?
It emits two documents in one file: a ClusterRole that grants permissions, and a ClusterRoleBinding that attaches that ClusterRole to subjects.
What is an apiGroup?
Core resources like nodes use an empty group ""; others such as apps or storage.k8s.io use their name.
What are resources and verbs?
resources are the objects (pods, nodes, persistentvolumes) and verbs are the actions (get, list, watch, create, delete). Use commas to list several.
What are subjects?
They are who the ClusterRole is bound to: a User, a Group, or a ServiceAccount. ServiceAccounts need a namespace.
Is the name validated?
Yes. Both names must be valid RFC 1123 labels (lowercase letters, numbers and hyphens).
Does this connect to a cluster?
No. Everything is assembled in your browser and nothing is uploaded.
Can I download it?
Yes. Copy the YAML, download clusterrole-clusterrolebinding.yaml, or print it.