Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for the "node.roles" setting #3324

Closed
barkbay opened this issue Jun 26, 2020 · 1 comment
Closed

Add support for the "node.roles" setting #3324

barkbay opened this issue Jun 26, 2020 · 1 comment
Assignees
Labels
>enhancement Enhancement of existing functionality

Comments

@barkbay
Copy link
Contributor

barkbay commented Jun 26, 2020

With Elasticsearch 7.9 the individual settings node.* are deprecated in favor of a node.roles setting.

Related ES PR:

We need to update several places in the code where ECK relies on the node.* attributes to detect the nature of a node:

  • Validation function
  • When we set the labels on the Pods

Note that it is not possible for the user to use both the legacy method and the new one:

e.g.

config:
node.master: true
node.roles:
    - data

produces the following error:

java.lang.IllegalArgumentException: can not explicitly configure node roles and use legacy role setting [node.master]=[true]

See https://github.com/elastic/elasticsearch/blob/master/server/src/main/java/org/elasticsearch/cluster/node/DiscoveryNode.java#L57 for implementation details

A concern I have is that it does not seem possible to render an empty array with ucfg, I did a few tests and the following manifest:

apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: quickstart
spec:
  version: 8.0.0
  image: docker.elastic.co/elasticsearch/elasticsearch:8.0.0-SNAPSHOT
  nodeSets:
    - name: coordinating
      podTemplate:
        spec:
          securityContext:
            runAsUser: 1000
            fsGroup: 1000
      count: 1
      config:
        node.roles: []
        node.store.allow_mmap: false
...

is rendered as:

node:
  roles: null
  store:
    allow_mmap: false

Which produces the following error:

Exception in thread "main" org.elasticsearch.ElasticsearchParseException: null-valued setting found for key [node.roles] found at line number [10], column number [10]
@botelastic botelastic bot added the triage label Jun 26, 2020
@barkbay barkbay added the >enhancement Enhancement of existing functionality label Jun 26, 2020
@botelastic botelastic bot removed the triage label Jun 26, 2020
@barkbay barkbay self-assigned this Jun 29, 2020
@pebrc
Copy link
Collaborator

pebrc commented Jul 16, 2020

I believe #3387 fixes this issue. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality
Projects
None yet
Development

No branches or pull requests

2 participants