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 node shard allocation awareness by default #3380

Merged
merged 8 commits into from
Jul 13, 2020

Conversation

anyasabo
Copy link
Contributor

@anyasabo anyasabo commented Jul 1, 2020

Fix #2827

Should fix issues where multiple pods in the same ES cluster get scheduled to the same k8s node, but ES does not know so it allocates both the primary and replica shards to pods on the same k8s node. We already have docs for setting up AZ awareness, but that would require extra information that ECK does not have. We can depend on having the node name available, so we can do this by default.

@anyasabo anyasabo added >enhancement Enhancement of existing functionality release-highlight Candidate for the ECK release highlight summary v1.3.0 labels Jul 1, 2020
Copy link
Contributor

@barkbay barkbay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I did a few tests, with several nodes deployed on a same K8S node, and it seems to be working as expected 👍

I was just wondering if it's worth updating our documentation to mention this default behavior ?

pkg/apis/elasticsearch/v1/fields.go Show resolved Hide resolved
@anyasabo
Copy link
Contributor Author

anyasabo commented Jul 6, 2020

@alaudazzi if you can take a look at the docs changes I'd appreciate it

@@ -16,6 +17,8 @@ import (
"github.com/elastic/cloud-on-k8s/pkg/controller/elasticsearch/volume"
)

var nodeAttrNodeName = fmt.Sprintf("%s.%s", esv1.NodeAttr, EnvNodeName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe typically these node.attrs are lowercase (just a nit). Also should we try to make it clear that NODE in this context does not mean the Elasticsearch node but the k8s node by maybe using a slightly different name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think just k8s_node_name? I went this way to minimize the amount of mappings you have to keep in mind between ES attr name -> env var name -> downward api value. I can see that that might not be a big advantage over your proposed approach though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I'd be +1 with k8s_node_name.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same

Copy link
Contributor

@alaudazzi alaudazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@anyasabo anyasabo merged commit bf6201f into elastic:master Jul 13, 2020
@anyasabo anyasabo deleted the awareness branch July 13, 2020 17:39
david-kow pushed a commit to david-kow/cloud-on-k8s that referenced this pull request Jul 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality release-highlight Candidate for the ECK release highlight summary v1.3.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Default node allocation awareness
5 participants