2

I am using ECK operator to deploy ES cluster on Kubernetes. It is working fine, but now I want to have tolerations for the ES pods so that these pods get scheduled to correct Kubernetes nodes. I am using following yaml to deploy it.

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

This creates stateful sets but does not have any tolerations on them, same with the resulting pods. I am not understanding what is the correct way to add tolerations.

PS: there are no errors when I apply above YAML.

Ojas Kale
  • 2,067
  • 2
  • 24
  • 39

1 Answers1

0

Works fine for me for eck operator version 2.4.0 and k8s version 1.23.0.

Here is an example of ElasticSearch custom resource that works for me:

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'
sorjef
  • 554
  • 5
  • 15