Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.service.ensure ​

Create or replace a namespaced Kubernetes Service

Creates a Service in the given namespace; replaces it if it already exists. Accepts a pre-built service_spec dict matching the Kubernetes V1Service schema so callers build the spec however they want (ClusterIP, NodePort, LoadBalancer, headless, etc.).

When replacing, spec.cluster_ip is preserved from the existing object — Kubernetes rejects spec updates that try to change a previously-assigned cluster IP.

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: Service name (required)
  • service_spec: Full V1Service dict (required).

Outputs:

  • namespace, name, existed: bool

Plugin required: context.get_plugin("connection").kubernetes_runner_clients(connection_uuid, organization_uuid) must expose core_v1 with read_namespaced_service, create_namespaced_service, replace_namespaced_service.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

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

Output Schema ​

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