-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Add support to make nodeSelector configurable in agent's daemonset #248
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
base: main
Are you sure you want to change the base?
Conversation
| variable "node_selector" { | ||
| description = "Map of node selector labels for the DaemonSet pods. Defaults to empty map." | ||
| type = map(string) | ||
| default = {} |
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.
If a user passed null to this, I think logic will break since its used in a for loop. Can you add nullable = false so it will not allow null to be passed?
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.
okay
ocofaigh
left a comment
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.
Can you expose it in the DA too (in the solutions/fully-configurable folder)
|
/run pipeline |
ocofaigh
left a comment
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.
Oh you will need to add the new input to the ibm_catalog.json too please. Just add it to the end of the list of inputs:
Validate ibm_catalog.json file............................................Failed
- hook id: validate_ibm_catalog_json
- exit code: 1
product_label: 'Cloud automation for Monitoring and Workload Protection agent'
flavor_label: 'Fully configurable'
working_directory: 'solutions/fully-configurable':
- the following inputs should be defined in ibm_catalog.json: ['node_selector']
helmlint..................................................................Passed
Validate ibm_catalog.json schema..........................................Passed
typos (warning only)......................................................Passed
- hook id: typos
- duration: 0.12s
main.tf
Outdated
| %{if var.max_surge != null} | ||
| "maxSurge": ${var.max_surge} | ||
| %{endif} | ||
| %{if length(var.node_selector) > 0} |
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.
Have you tested this with multiple node_selector's?
I think currently this will currently give invalid json if you provide multiple node selectors. Missing comma between selectors.
var.node_selector = { "k1" = "v1", "k2" = "v2" }
{
"nodeSelector":
"k1": "v1"
"k2": "v2"
}Instead we could do something like this:
%{if length(var.node_selector) > 0}
"nodeSelector": ${jsonencode(var.node_selector)}
%{endif}And the result be:
{
"maxSurge": 1,
"nodeSelector": {
"k1": "v1",
"k2": "v2"
}
}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.
@jor2 Yes, I did test with multiple nodeSelector's. It was working.
But using jsonencode() approach seems more robust. I will change the code to use jsonencode()
|
/run pipeline |
|
The test failed with: This is unrelated to changes in this PR, so retrying.. |
|
/run pipeline |
Description
Introduce configurable nodeSelector support for the DaemonSet to enable controlled and phased pod scheduling. This enhancement allows users to gradually deploy the DaemonSet across targeted nodes, minimizing API server load and improving cluster stability during large-scale rollouts.
Git Issue: #247
Release required?
x.x.X)x.X.x)X.x.x)Release notes content
Run the pipeline
If the CI pipeline doesn't run when you create the PR, the PR requires a user with GitHub collaborators access to run the pipeline.
Run the CI pipeline when the PR is ready for review and you expect tests to pass. Add a comment to the PR with the following text:
Checklist for reviewers
For mergers