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: support reloading the cloud controller manager based on the changes of the config file #769
Conversation
klog.Infof("RunFileWatcherOrDie: found file update event: %v", event) | ||
updateChan <- struct{}{} | ||
|
||
if strings.EqualFold(event.Name, path) && event.Op&fsnotify.Remove == fsnotify.Remove { |
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's better to have a retry (e.g. try 5 times with 1 second interval) to avoid rapid die on the config file changes manually (for example, cluster operator may want to delete the file and copy it to the same filename again)
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.
done
fs.StringVar(&o.CloudConfigSecretNamespace, "cloud-config-secret-namespace", "kube-system", "The k8s namespace of the cloud config secret, default to 'kube-system'") | ||
fs.StringVar(&o.CloudConfigKey, "cloud-config-key", "cloud-config", "The key of the config data in the cloud config secret, default to 'cloud-config'") | ||
fs.BoolVar(&o.EnableDynamicReloading, "enable-dynamic-reloading", false, "Enable re-configuring cloud controller manager from secret without restarting.") | ||
//fs.StringVar(&o.CloudConfigFilePath, "cloud-config-file-path", "", "The absolute path to the cloud config file.") |
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.
is this test only? let's remove it if so
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.
done
@@ -64,7 +65,7 @@ func (o *DynamicReloadingOptions) Validate() []error { | |||
func defaultDynamicReloadingOptions() *DynamicReloadingOptions { | |||
return &DynamicReloadingOptions{ | |||
EnableDynamicReloading: false, | |||
CloudConfigSecretName: "azure-cloud-provider", | |||
CloudConfigSecretName: "", |
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.
could we keep the default secret name same as before?
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.
yeah we could keep it since it won't break the logic.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: feiskyer, nilo19 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Cherry pick of #769: feat: reloading ccm when the config file changes
Cherry pick of #769: feat: reloading ccm when the config file changes
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Release note: