Skip to content

Argo Workflows Node Selector Quick Fix - Pod Scheduling

DodaTech Updated 2026-06-26 1 min read

Argo Workflows node selector controls where workflow pods run. Incorrect node selection causes pending pods or failed scheduling. This guide covers the fix.

Quick Fix

Wrong

- name: gpu-job
  container:
    image: tensorflow:latest
  nodeSelector:
    gpu: true

The issue: node selector key gpu: true matches nodes with that label, but GPU-enabled nodes may have additional taints that block pod scheduling. The pod stays Pending.

- name: gpu-job
  container:
    image: tensorflow:latest
  nodeSelector:
    accelerator: nvidia-tesla-k80
  tolerations:
  - key: nvidia.com/gpu
    operator: Exists
    effect: NoSchedule
  affinity:
    nodeAffinity:
      preferredDuringSchedulingIgnoredDuringExecution:
      - weight: 100
        preference:
          matchExpressions:
          - key: topology.kubernetes.io/zone
            operator: In
            values:
            - us-east1-c
# Expected output after applying the fix
# Pod scheduled on node with accelerator=nvidia-tesla-k80
# Tolerations allow scheduling despite GPU taints
# Node affinity prefers us-east1-c zone
# Pod status: Running on correct node

Prevention

  • Add tolerations for nodes with taints
  • Use specific node label values instead of boolean
  • Use nodeAffinity for soft scheduling preferences
  • Verify node labels with kubectl get nodes --show-labels
  • Test scheduling with --dry-run=server flag

DodaTech Tools

Doda Browser's scheduling analyzer shows node availability and pod placement. DodaZIP archives scheduling configurations for capacity planning. Durga Antivirus Pro validates node selector expressions for correctness.

FAQ

What happens if no node matches the nodeSelector?

The pod stays in Pending state indefinitely. The scheduler cannot find a matching node. Check node labels and taints to resolve. ||| Can I use both nodeSelector and affinity together? Yes, but nodeSelector is simpler for hard requirements while affinity supports both hard (required) and soft (preferred) rules. ||| How do I schedule work to specific instance types? Use nodeSelector with instance type labels like node.Kubernetes.io/instance-type: n2-standard-4 for Google Cloud or beta.Kubernetes.io/instance-type: m5.large for AWS.

Built by the developers of DodaTech

Doda Browser, DodaZIP & Durga Antivirus Pro