Slide 7
Slide 7 text
apiVersion: apps/v
1
kind: Deployment
metadata:
name: example
spec:
replicas:
2
selector:
matchLabels:
app: example
template:
metadata:
labels:
app: example
spec:
a
ffi
nity:
podAntiA
ff i
nity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight:
1
podA
ff
i
nityTerm:
labelSelector:
matchExpressions:
- key: app
operator: In
values:
- nginx
topologyKey: "kubernetes.io/hostname"
containers:
- name: nginx
image: nginx
ports:
- containerPort:
8 0
2台をpreferredDuringSchedulingIgnoredDuringExecutionで分散配置してるのでworkerノードに1台ずつ配置されるはず
Deployment