Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.namespace.ensure ​

Create a Kubernetes Namespace if it does not exist

Creates a Namespace if it does not exist. Namespaces are non-namespaced (cluster- scoped) so there is no parent namespace field. If the Namespace already exists, the existing object is returned unchanged — Namespaces have no spec worth re-applying via this primitive.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • name: Namespace name (required)
  • labels: Optional dict of metadata labels to set on creation only

Outputs:

  • name, existed: bool

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose core_v1 with read_namespace and create_namespace.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namestringYes——
labelsjsonNo——
workflow_run_idstringNo—Engine workflow run id for DAG step execution
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namestringNo——
labelsjsonNo——
existedbooleanNo——
workflow_run_idstringNo—Engine workflow run id for DAG step execution
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.namespace.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "name": "value"
  }
}