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 ​
| Property | Value |
|---|---|
| Workflow type | Atomic |
| Library | App-kubernetes |
| Version | 1.0 |
Input Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | Yes | — | — |
name | string | Yes | — | — |
labels | json | No | — | — |
workflow_run_id | string | No | — | Engine workflow run id for DAG step execution |
organization_uuid | uuid | No | — | — |
Output Schema ​
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
connection_uuid | uuid | No | — | — |
organization_uuid | uuid | No | — | — |
name | string | No | — | — |
labels | json | No | — | — |
existed | boolean | No | — | — |
workflow_run_id | string | No | — | Engine workflow run id for DAG step execution |
failure_reason | string | No | — | — |
failure_type | string | No | — | — |
failed_action | string | No | — | — |
failed_at_state | string | No | — | — |
failed_step | string | No | — | — |
failed_layer | string | No | — | — |
error | string | No | — | — |
error_type | string | No | — | — |
States ​
| State | Initial | Terminal | Success | Auto-advance | Description |
|---|---|---|---|---|---|
pending | Yes | No | — | execute | — |
completed | No | Yes | Yes | — | — |
failed | No | Yes | No | — | — |
State Diagram ​
Transitions ​
| From | Action | To | Description |
|---|---|---|---|
pending | execute | completed | — |
* (any state) | fail | failed | — |
API Usage ​
bash
POST /api/workflows/start
Content-Type: application/json
{
"workflow_type": "kubernetes.namespace.ensure",
"initial_data": {
"connection_uuid": "value",
"name": "value"
}
}