---
id: scheduling-affinity-on
name: "Capability: affinity settable on ALL workloads (ON)"
description: >-
  Renders the product chart with a nodeAffinity rule configured
  (requiredDuringSchedulingIgnoredDuringExecution preferring kubernetes.io/os=linux)
  and asserts that every workload pod spec carries the affinity block.
  Uses a values file to properly set the nested affinity structure.
labels: {customer: enterprise, profile: compliance}
cluster:
  provider: kind
  k8s_version: v1.36.1
product:
  chart: ./chart
  release: sample
  namespace: sample
  values: chart-test/fixtures/capability/scheduling-affinity-on-values.yaml
asserts:
  - type: scheduling-present
    namespace: sample
    source: rendered
    expect_present: true
    check_nodeSelector: false
    check_tolerations: false
    check_affinity: true
    check_topologySpreadConstraints: false
    affinity:
      nodeAffinity: true
tags: [capability, compliance]
category: capability
capability: affinity
tier: capability
mechanisms: ["capability:scheduling"]
