Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.statefulset.ensure ​

Create or replace a namespaced Kubernetes StatefulSet

Creates a StatefulSet in the given namespace; replaces it if it already exists (patch). Accepts a pre-built statefulset_spec dict matching the Kubernetes V1StatefulSetSpec schema so callers build the spec however they want.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: StatefulSet name (required)
  • statefulset_spec: Full V1StatefulSetSpec dict (required).

Outputs:

  • existed: True if the StatefulSet was patched, False if it was created.
  • generation: Metadata generation from the Kubernetes API response.

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose apps_v1 with read_namespaced_stateful_set, patch_namespaced_stateful_set, create_namespaced_stateful_set.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
statefulset_specjsonYes——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
statefulset_specjsonNo——
existedbooleanNo——
generationintegerNo——
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.statefulset.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value",
    "statefulset_spec": "value"
  }
}