Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
labels:
service: nginx
name: nginx
status: {}
spec:
replicas: 3
template:
metadata:
labels:
service: nginx
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "service"
operator: In
values:
- nginx
topologyKey: "kubernetes.io/hostname"
- weight: 90
podAffinityTerm:
labelSelector:
matchExpressions:
- key: "service"
operator: In
values:
- nginx
topologyKey: "failure-domain.beta.kubernetes.io/zone"
containers:
- image: nginx
name: nginx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.