Skip to content
Proud to collaborate with Microsoft for Startups

kubernetes.serviceaccount.ensure ​

Create or replace a namespaced Kubernetes ServiceAccount

Creates a ServiceAccount in the given namespace; patches it if it already exists. Supports optional image_pull_secrets (list of secret name strings), automount_service_account_token, and labels (dict of key/value pairs).

Inputs:

  • connection_uuid: Cloud connection UUID (required)
  • namespace: Target namespace (required)
  • name: ServiceAccount name (required)
  • image_pull_secrets: List of secret name strings mapped to spec.imagePullSecrets=[{name}] (optional)
  • automount_service_account_token: Whether to automount the service account token (optional)
  • labels: Dict of label key->value pairs applied to metadata.labels (optional)

Outputs:

  • existed: True if the ServiceAccount 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_service_account, patch_namespaced_service_account, create_namespaced_service_account.

Overview ​

PropertyValue
Workflow typeAtomic
LibraryApp-kubernetes
Version1.0

Input Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidYes——
namespacestringYes——
namestringYes——
image_pull_secretsjsonNo——
automount_service_account_tokenbooleanNo——
labelsjsonNo——
organization_uuiduuidNo——

Output Schema ​

FieldTypeRequiredDefaultDescription
connection_uuiduuidNo——
organization_uuiduuidNo——
namespacestringNo——
namestringNo——
image_pull_secretsjsonNo——
automount_service_account_tokenbooleanNo——
labelsjsonNo——
existedbooleanNo——
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.serviceaccount.ensure",
  "initial_data": {
    "connection_uuid": "value",
    "namespace": "value",
    "name": "value"
  }
}