Skip to content

Argo Resource Task Quick Fix - Kubernetes Resource Management

DodaTech Updated 2026-06-26 1 min read

Argo Workflows resource templates create, update, and delete Kubernetes resources as workflow steps. Misconfigured resource operations cause API errors or unintended changes. This guide covers the fix.

Quick Fix

Wrong

- name: create-config
  resource:
    action: create
    manifest: |
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: my-config

The issue: action: create fails if the ConfigMap already exists. No successCondition defined, and missing flags for namespace specification. The step fails on re-runs.

- name: create-config
  resource:
    action: apply
    manifest: |
      apiVersion: v1
      kind: ConfigMap
      metadata:
        name: my-config
        namespace: "{{workflow.parameters.namespace}}"
      data:
        key: value
    successCondition: "{{resource.status.status}} == 'True'"
# Expected output after applying the fix
# ConfigMap my-config created/updated
# Action: apply (idempotent - safe for re-runs)
# Namespace set from workflow parameter
# Step succeeds after resource becomes ready

Prevention

  • Use action: apply instead of create for idempotent operations
  • Set namespace via parameters for multi-namespace workflows
  • Add successCondition for resources that take time to become ready
  • Use action: delete with deletePropagationPolicy: Background
  • Validate resource manifests with kubectl apply --dry-run=client

DodaTech Tools

Doda Browser's resource inspector shows resource status and events for each workflow step. DodaZIP archives resource manifests for change tracking. Durga Antivirus Pro validates resource manifests against security policies.

FAQ

What actions are available for resource templates?

Supported actions include create, apply, patch, delete, get, and replace. Use apply for idempotent resource management in workflows. ||| Can I reference the created resource in subsequent steps? Yes, resource output is available as {{steps.<name>.outputs.*}}. Use {{steps.<name>.outputs.name}} for the created resource name. ||| How do I handle resource deletion in cleanup steps? Use action: delete with the manifest of the resource to delete. Set deletePropagationPolicy: Background for non-blocking deletion.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro