Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.rolebinding.ensure ​

Create or replace a namespaced Kubernetes RoleBinding (role_ref is immutable; existing binding with different role_ref is deleted and recreated)

Creates a namespaced Kubernetes RoleBinding; if the binding already exists and the role_ref matches, only the subjects list is patched. If the existing role_ref differs (immutable field), the binding is deleted and recreated — the output field recreated is set to True in that case.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: RoleBinding name (required)
  • role_ref: Dict with keys kind (Role|ClusterRole), name, and api_group (typically rbac.authorization.k8s.io) — required.
  • subjects: List of subject dicts. Each entry must have kind (User|Group|ServiceAccount) and name; namespace and api_group are optional — required.

Outputs:

  • existed: True if the binding already existed before this call.
  • recreated: True if the binding was deleted and recreated because the existing role_ref did not match the requested one.

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose rbac_authorization_v1 (RbacAuthorizationV1Api) with methods read_namespaced_role_binding, patch_namespaced_role_binding, delete_namespaced_role_binding, and create_namespaced_role_binding.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
role_refjsonYes——
subjectsjsonYes——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
role_refjsonNo——
subjectsjsonNo——
existedbooleanNo——
recreatedbooleanNo——
failure_reasonstringNo——
failure_typestringNo——
failed_actionstringNo——
failed_at_statestringNo——
failed_stepstringNo——
failed_layerstringNo——
errorstringNo——
error_typestringNo——

States ​

StateInitialTerminalSuccessAuto-advanceDescription
pendingYesNo—execute—
completedNoYesYes——
failedNoYesNo——

State Diagram ​

Transitions ​

FromActionToDescription
pendingexecutecompleted—
* (any state)failfailed—

API Usage ​

bash
POST /api/workflows/start
Content-Type: application/json

{
  "workflow_type": "kubernetes.rolebinding.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value",
    "role_ref": "value"
  }
}