OS
Schema Hub

Affinity

Affinity is a group of affinity scheduling rules.

Schema URL
https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/core.api.k8s.io/Affinity_v1.json
Usage examples
VS Code / yaml-language-server
# yaml-language-server: $schema=https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/core.api.k8s.io/Affinity_v1.json
kubeconform
kubeconform -schema-location 'https://raw.githubusercontent.com/nlamirault/schema-hub/main/schemas/{{ .Group }}/{{ .ResourceKind }}_{{ .ResourceAPIVersion }}.json' manifest.yaml

Resource Structure

nodeAffinityobject
Describes node affinity scheduling rules for the pod.
podAffinityobject
Describes pod affinity scheduling rules (e.g. co-locate this pod in the same node, zone, etc. as some other pod(s)).
podAntiAffinityobject
Describes pod anti-affinity scheduling rules (e.g. avoid putting this pod in the same node, zone, etc. as some other pod(s)).