-
Notifications
You must be signed in to change notification settings - Fork 39
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
controller: add support for global persistent configuration #364
Conversation
9cc7642
to
926b09b
Compare
cmd/manager/main.go
Outdated
@@ -49,6 +50,7 @@ var ( | |||
|
|||
const ( | |||
defaultTimeout = time.Minute * 3 | |||
configFile = "/run/config/csi-addons-config.json" |
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.
why use a file, and not the Kubernetes API to access the ConfigMap directly? Users can then place keys directly in the ConfigMap, and do not need to worry about weird indirect json syntax.
a64b409
to
0f3737f
Compare
0f3737f
to
6348d42
Compare
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, a little more cleaning up is possible now. It would be nice to have a single place to configure default values.
6348d42
to
9bf0fcf
Compare
cmd/manager/main.go
Outdated
@@ -39,6 +39,8 @@ import ( | |||
controllers "github.com/csi-addons/kubernetes-csi-addons/controllers/csiaddons" | |||
replicationController "github.com/csi-addons/kubernetes-csi-addons/controllers/replication.storage" | |||
"github.com/csi-addons/kubernetes-csi-addons/internal/connection" | |||
"github.com/csi-addons/kubernetes-csi-addons/internal/util" | |||
"k8s.io/client-go/kubernetes" |
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.
add a new line
"reclaim-space-timeout": "5m" | ||
"max-concurrent-reconciles": "50" |
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.
match the values for what we have in default , if the user just creates this configmap should not have any impact unless he/she modifies the values
docs/csi-addons-config.md
Outdated
| `reclaim-space-timeout` | `"3m"` | Timeout for reclaimspace operation | | ||
| `max-concurrent-reconciles` | `"100"` | Maximum number of concurrent reconciles | | ||
|
||
## Example |
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.
let's not duplicate the configmap here as it adds a burden to maintain at 2 places, just add a reference to the configmap here.
internal/util/config.go
Outdated
cm, err := kubeClient.CoreV1().ConfigMaps(cfg.Namespace). | ||
Get(context.Background(), csiAddonsConfigMapName, metav1.GetOptions{}) |
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.
Instead of creating a new context here, create one context in the main and use it.
9bf0fcf
to
1e9e762
Compare
@Mergifyio rebase |
This commits adds support for configuration options consumed through a optional configmap. This will enable users to create a configmap to supply options that are persisted throughout upgrades. Current support parameters are `"reclaim-space-timeout"` and `"max-concurrent-reconciles"`. Signed-off-by: Rakshith R <[email protected]>
✅ Branch has been successfully rebased |
1e9e762
to
fcaf757
Compare
@@ -31,6 +31,7 @@ spec: | |||
memory: 64Mi | |||
- name: manager | |||
args: | |||
- "--namespace=$(POD_NAMESPACE)" |
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 the env
section is missing here?
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 the
env
section is missing here?
its added above in manager.yaml . https://github.com/csi-addons/kubernetes-csi-addons/pull/364/files/fcaf7571fe7ee850410e6f2da6fb853daa0a023f#diff-ce0d597a9e5f20a8fe61c3ba5e6185a6b90cfef2c00bb5b5ef3e97b15b79f480
This yaml patches & overrides the manager container args, so I added the namespace arg here.
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.
Ah, right!
@@ -31,6 +31,7 @@ spec: | |||
memory: 64Mi | |||
- name: manager | |||
args: | |||
- "--namespace=$(POD_NAMESPACE)" |
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.
Ah, right!
This commits adds support for configuration options consumed through a optional configmap. This will enable users to create a configmap to supply options that are persisted throughout upgrades.
Current support parameters are
"reclaim-space-timeout"
and"max-concurrent-reconciles"
.Closes: #347