我正在使用ECK运算符在库伯内特斯上部署ES集群。它工作得很好,但是现在我想对ESpod有容差,以便这些pod被安排来纠正库伯内特斯节点。我正在使用下面的yaml来部署它。
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elastic-data-factory
spec:
version: 7.14.0
nodeSets:
- name: master
count: 1
config:
node.master: true
node.data: false
node.ingest: false
podTemplate:
spec:
tolerations:
- key: "dedicated"
operator: "Equal"
value: "esdfnp"
effect: "NoSchedule"
containers:
- name: elasticsearch
resources:
requests:
memory: 8Gi
limits:
memory: 8Gi
- name: data
count: 3
config:
node.master: false
node.data: true
node.ingest: true
podTemplate:
spec:
tolerations:
- key: "dedicated"
operator: "Equal"
value: "esdfnp"
effect: "NoSchedule"
containers:
- name: elasticsearch
resources:
requests:
memory: 8Gi
limits:
memory: 8Gi
这会创建有状态集,但对它们没有任何容差,与生成的pod相同。我不明白添加容差的正确方法是什么。
PS:当我在YAML上应用时没有错误。
适用于eck运算符版本2.4.0
和k8s版本1.23.0
。
这是一个适合我的ElasticSearch自定义资源示例:
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
name: elasticsearch
spec:
version: 8.4.3
nodeSets:
- count: 1
name: master
podTemplate:
spec:
tolerations:
- effect: NoSchedule
key: elasticsearch
value: 'true'