K8SROLE: K8s Role
A Kubernetes Role or ClusterRole defining a set of permissions (API verbs on resources) that can be bound to users, groups, or service accounts.
Default definition. This article describes the default
K8SROLE 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 K8SROLE.Entity properties
| Property | Value |
|---|---|
| Entity code | K8SROLE |
| Display name | K8s Role |
| Plural | K8s Roles |
| Level | 411 |
Use cases
K8SROLE covers both namespace-scoped Roles and cluster-scoped ClusterRoles via the roleScope field. When roleScope is Role, the namespace objectLookup is relevant; for ClusterRole it should be hidden via visibility. The rules textarea holds the JSON array of PolicyRule objects.
Fields
Role Information
| Field | Type | Required | Notes |
|---|---|---|---|
name | text | Yes | Name |
roleScope | enum | Yes | Role Scope Valid ids: 1 (Role), 2 (ClusterRole). |
namespace | reference → K8SNAMESPACE | Namespace | |
description | text (multi-line) | Description |
Metadata
| Field | Type | Required | Notes |
|---|---|---|---|
labels | text (multi-line) | JSON key-value pairs | |
annotations | text (multi-line) | JSON key-value pairs |
Permission Rules
| Field | Type | Required | Notes |
|---|---|---|---|
rules | text (multi-line) | JSON array of PolicyRule objects: [{apiGroups, resources, verbs, resourceNames}] | |
apiGroups | text | Comma-separated API groups (e.g. '', apps, batch) | |
resources | text | Comma-separated resources (e.g. pods, deployments, services) | |
verbs | multiselect | Verbs | |
resourceNames | text | Comma-separated specific resource names (optional) |
ClusterRole Aggregation
| Field | Type | Required | Notes |
|---|---|---|---|
aggregationEnabled | boolean | Aggregation Enabled | |
aggregationLabels | text (multi-line) | JSON label selector for aggregating other ClusterRoles |
Relationships
- Lookups:
namespacepoints at aK8SNAMESPACErecord. - Related lists:
K8SROLEBINDING(formatSUB|K8SROLE).
Creating a K8s Role via the API
POST /v1/objects
Authorization: Bearer <your-pat>
Content-Type: application/json
{
"entity": "K8SROLE",
"level": 411,
"comboKey": "SUB:<your-sub-id>|ENT:",
"name": "Example",
"roleScope": "1",
"namespace": "",
"description": "Example text."
}
Listing K8s Roles records
# All k8s roles in your tenant
GET /v1/entities/K8SROLE/SUB