Skip to content

Instantly share code, notes, and snippets.

@klingklangdev
Forked from chadmcrowell/pref-deployment.yaml
Created December 1, 2020 22:46
Show Gist options
  • Select an option

  • Save klingklangdev/ab08dbed56cb4a758ea49bc6ac07676d to your computer and use it in GitHub Desktop.

Select an option

Save klingklangdev/ab08dbed56cb4a758ea49bc6ac07676d to your computer and use it in GitHub Desktop.
Node Affinity | CKA Exam Course
apiVersion: apps/v1
kind: Deployment
metadata:
name: pref
spec:
selector:
matchLabels:
app: pref
replicas: 5
template:
metadata:
labels:
app: pref
spec:
affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 80
preference:
matchExpressions:
- key: availability-zone
operator: In
values:
- zone1
- weight: 20
preference:
matchExpressions:
- key: share-type
operator: In
values:
- dedicated
containers:
- args:
- sleep
- "99999"
image: busybox
name: main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment