Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.pvc.ensure ​

Create or replace a namespaced Kubernetes PersistentVolumeClaim

Creates a PersistentVolumeClaim in the given namespace; patches it if it already exists. Accepts a pre-built pvc_spec dict matching the Kubernetes V1PersistentVolumeClaimSpec schema so callers build the spec however they want.

Note: PVC spec is mostly immutable after creation. Only resources.requests.storage can be grown if the storage class supports volume expansion. A patch that attempts to change an immutable field will be rejected by the API server and the workflow will transition to FAILED — this is intentional; the caller must delete and re-create the PVC in that case.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: PVC name (required)
  • pvc_spec: V1PersistentVolumeClaimSpec dict (required). Must include at minimum accessModes and resources.requests.storage. Optional keys: storageClassName, volumeName, etc.

Outputs:

  • existed: True if the PVC was patched, False if it was created.

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose core_v1 with read_namespaced_persistent_volume_claim, patch_namespaced_persistent_volume_claim, create_namespaced_persistent_volume_claim.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

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

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
pvc_specjsonNo——
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.pvc.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value",
    "pvc_spec": "value"
  }
}