Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.clusterrolebinding.ensure ​

Create or replace a ClusterRoleBinding (cluster-scoped). role_ref is immutable; existing binding with different role_ref is deleted and recreated.

Create or replace a ClusterRoleBinding (cluster-scoped). role_ref is immutable; an existing binding with a different role_ref is deleted and recreated.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • name: ClusterRoleBinding name (required, cluster-scoped — no namespace)
  • role_ref: JSON dict {kind, name, apiGroup} (required). Typically {kind: "ClusterRole", name: "<role>", apiGroup: "rbac.authorization.k8s.io"}.
  • subjects: JSON list of {kind, name, namespace?, apiGroup?} (required)

Outputs:

  • existed: True if a binding already existed under that name.
  • recreated: True if the existing binding was deleted+recreated because its role_ref differed from the requested one.

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose rbac_authorization_v1 (RbacAuthorizationV1Api) with read_cluster_role_binding, patch_cluster_role_binding, delete_cluster_role_binding, and create_cluster_role_binding.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

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

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
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.clusterrolebinding.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "name": "value",
    "role_ref": "value",
    "subjects": "value"
  }
}