-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
feat: Linux node config #782
feat: Linux node config #782
Conversation
Thanks for the PR! 🚀 |
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.
"sysctls") ? [1] : [] | ||
|
||
content { | ||
sysctls = merge(local.node_pools_linux_node_configs["all"], local.node_pools_linux_node_configs[each.value["name"]])["sysctls"] |
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.
for a config like
all = {
sysctls = {
"foo" = 1
}
}
pool-01 = {
sysctls = {
"bar" = 2
}
}
Wouldn't merge of the second map override the key sysctls
from the first unless we do
sysctls = merge(lookup(local.node_pools_linux_node_configs["all"],"sysctls",{}),lookup(local.node_pools_linux_node_configs[each.value["name"]],"sysctls",{}))
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.
Yes, you are right. Are you in favour of keeping this structure and doing this more complex "deep" merge or do you prefer to flatten the structure one level because sysctls is currently the only key in this map?
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.
@m10ev I think it makes sense to flatten as only sysctls
is available.
I'm just guessing about the test assertion right now because I don't have an existing cluster in order to see the output format of the describe command. If you have access to view the output from the integration tests, could you help me with that? |
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.
The tests LGTM, there was a small typo.
"config" => including( | ||
"linuxNodeConfig" => including( | ||
"sysctls" => including( | ||
"net.core.netdev_max_backlog" => "10000" |
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.
"net.core.netdev_max_backlog" => "10000" | |
"net.core.netdev_max_backlog" => "10000", |
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.
We can probably assert the whole object instead of including
because there should not be any other keys in sysctls
.
"linuxNodeConfig" => including(
"sysctls" => {
"net.core.netdev_max_backlog" => "10000",
"net.core.rmem_max" => "10000"
}
)
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.
Actually, it's preferable to use including
as asserting the whole object is more brittle to API changes.
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.
@morgante In this particular case, wouldn't the API including additional configs within sysctls
be an error? My reasoning for suggesting whole object for sysctls
was in case of any bug being introduced in the logic where we merge all
and nodepool specific config.
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.
It could be an API error, but it could also be a new default that we haven't included. In either case we couldn't fix it in the module so I'd prefer to avoid brittle logic.
Co-authored-by: Tencho Tenev <[email protected]>
Hello, I'm keen to use this feature, too. Is it blocked waiting for one more approval from the owners or it needs extra work? |
* Add linux node config * Add variable node_pools_linux_node_configs * Generate modules * Fix dynamic block * Generate modules * Deep merge for sysctls maps * Generate modules * Add sysctls to node_pool example and test * Flatten sysctls map * Generate modules * Fix typo in test * Fix trailing whitespace * Fix parens * Update autogen/main/cluster.tf.tmpl Co-authored-by: Tencho Tenev <[email protected]> * Generate modules Co-authored-by: Tencho Tenev <[email protected]> Co-authored-by: Bharath KKB <[email protected]>
Not sure if this is the right approach but thought I'd give it a try.
References: