Skip to content

Instantly share code, notes, and snippets.

@chadmcrowell
Last active February 28, 2026 19:39
Show Gist options
  • Select an option

  • Save chadmcrowell/a8c07c1ed100fb77868a9a62cdb71852 to your computer and use it in GitHub Desktop.

Select an option

Save chadmcrowell/a8c07c1ed100fb77868a9a62cdb71852 to your computer and use it in GitHub Desktop.
Node Affinity - SSD pod
apiVersion: v1
kind: Pod
meta
name: data-processor
namespace: production
spec:
containers:
- name: data-processor
image: nginx:1.25
resources:
requests:
memory: "64Mi"
cpu: "250m"
limits:
memory: "128Mi"
cpu: "500m"
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: disk
operator: In
values:
- ssd
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 1
preference:
matchExpressions:
- key: zone
operator: In
values:
- west
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment