mirror of
https://github.com/wardviaene/kubernetes-course.git
synced 2026-07-10 22:29:16 +00:00
pod-anti-affinity
This commit is contained in:
31
affinity/pod-anti-affinity-5.yaml
Normal file
31
affinity/pod-anti-affinity-5.yaml
Normal file
@@ -0,0 +1,31 @@
|
||||
apiVersion: extensions/v1beta1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: pod-affinity-5
|
||||
spec:
|
||||
replicas: 1
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app: pod-affinity-5
|
||||
spec:
|
||||
affinity:
|
||||
podAntiAffinity:
|
||||
preferredDuringSchedulingIgnoredDuringExecution:
|
||||
- weight: 100
|
||||
podAffinityTerm:
|
||||
labelSelector:
|
||||
matchExpressions:
|
||||
- key: "app"
|
||||
operator: In
|
||||
values:
|
||||
- pod-affinity-1
|
||||
- pod-affinity-3
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
containers:
|
||||
- name: k8s-demo
|
||||
image: wardviaene/k8s-demo
|
||||
ports:
|
||||
- name: nodejs-port
|
||||
containerPort: 3000
|
||||
---
|
||||
Reference in New Issue
Block a user