k8s deployment pod 强制、尽量分散在不同的node上
kind: DeploymentapiVersion: apps/v1metadata:name: springboot-web-app1labels:k8s-app: springboot-web-app1spec:replicas: 5template:spec:affinity:podAntiAffinity:requiredDuringSchedulingIgnoredD.
·
强制
kind: Deployment
apiVersion: apps/v1
metadata:
name: springboot-web-app1
labels:
k8s-app: springboot-web-app1
spec:
replicas: 5
template:
spec:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- springboot-web-app1
topologyKey: kubernetes.io/hostname
尽量
kind: Deployment
apiVersion: apps/v1
metadata:
name: springboot-web-app1
labels:
k8s-app: springboot-web-app1
spec:
replicas: 5
template:
spec:
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values:
- springboot-web-app1
topologyKey: kubernetes.io/hostname
更多推荐
已为社区贡献18条内容
所有评论(0)