K8SROLEBINDING: K8s Role Binding
A Kubernetes RoleBinding or ClusterRoleBinding that grants the permissions defined in a Role or ClusterRole to users, groups, or service accounts.
Default definition. This article describes the default
K8SROLEBINDING definition shipped with DemandFlow. Administrators can add, remove, rename, or re-type fields, change which ones are required, and alter the layout from the Definitions screen in Settings. Your tenant's current schema may differ from what is shown here. To read the current definition at any time, GET the DEFINITION object whose id matches K8SROLEBINDING.Entity properties
| Property | Value |
|---|---|
| Entity code | K8SROLEBINDING |
| Display name | K8s Role Binding |
| Plural | K8s Role Bindings |
| Level | 412 |
Use cases
K8SROLEBINDING covers both namespace-scoped RoleBindings and cluster-scoped ClusterRoleBindings via the bindingScope field. The role objectLookup references the K8SROLE being granted. Subjects are stored as a JSON array of {kind, name, namespace} objects representing the users, groups, or service accounts receiving the permissions.
Fields
Binding Information
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Name |
bindingScope | enum | Yes | Binding Scope Valid ids: 1 (RoleBinding), 2 (ClusterRoleBinding). |
namespace | reference → K8SNAMESPACE | Namespace | |
role | reference → K8SROLE | Yes | Role |
Metadata
| Field | Type | Required | Notes |
|---|---|---|---|
labels | text (multi-line) | Labels | |
annotations | text (multi-line) | Annotations |
Subjects
| Field | Type | Required | Notes |
|---|---|---|---|
subjects | text (multi-line) | JSON array: [{kind: 'User'|'Group'|'ServiceAccount', name: '...', namespace: '...'}] | |
subjectCount | number | Subject Count Read only. |
Summary
| Field | Type | Required | Notes |
|---|---|---|---|
userSubjects | text (multi-line) | Users Read only. | |
groupSubjects | text (multi-line) | Groups Read only. | |
saSubjects | text (multi-line) | Service Accounts Read only. |
Relationships
- Lookups:
namespacepoints at aK8SNAMESPACErecord.rolepoints at aK8SROLErecord.
Creating a K8s Role Binding via the API
POST /v1/objects
Authorization: Bearer <your-pat>
Content-Type: application/json
{
"entity": "K8SROLEBINDING",
"level": 412,
"comboKey": "SUB:<your-sub-id>|ENT:",
"name": "Example",
"bindingScope": "1",
"role": ""
}
Listing K8s Role Bindings records
# All k8s role bindings in your tenant
GET /v1/entities/K8SROLEBINDING/SUB