-
Notifications
You must be signed in to change notification settings - Fork 717
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
Conversation
There was a problem hiding this 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 ?
@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) |
There was a problem hiding this comment.
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.attr
s 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?
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.