Skip to content

Instantly share code, notes, and snippets.

@tanmay-bhat
Created December 18, 2021 11:50
Show Gist options
  • Save tanmay-bhat/8f7777b4846bdb0b173ceb1c6a295c03 to your computer and use it in GitHub Desktop.
Save tanmay-bhat/8f7777b4846bdb0b173ceb1c6a295c03 to your computer and use it in GitHub Desktop.
Deployment file to distrubute pods inside replicaset to both SPOT and ON_DEMAND instance nodes or node-groups.
kind: Deployment
metadata:
name: nginx
spec:
replicas: 10
selector:
matchLabels:
app: nginx
template:
metadata:
labels:
app: nginx
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 40
preference:
matchExpressions:
- key: eks.amazonaws.com/capacityType
operator: In
values:
- SPOT
- weight: 60
preference:
matchExpressions:
- key: eks.amazonaws.com/capacityType
operator: In
values:
- "ON_DEMAND"
containers:
- image: nginx
name: nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment