Skip to content
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

deprecate the flag --max-worker and replace it for max-concurrent-reconciles and use the num of CPU as default value. #3360

Closed
camilamacedo86 opened this issue Jul 8, 2020 · 6 comments · Fixed by #3452
Assignees
Labels
kubebuilder-integration Relates to rewriting the SDK in Kubebuilder plugin form language/ansible Issue is related to an Ansible operator project language/helm Issue is related to a Helm operator project
Milestone

Comments

@camilamacedo86
Copy link
Contributor

camilamacedo86 commented Jul 8, 2020

The --max-workers flag does not align well with the name of the option it configures on the controllers and the new layout. So, we need to deprecate the flag --max-worker and replace it for max-concurrent-reconciles. Also, note the default size should runtime.NumCPU().

Note that we need to update the implementation in cmd/helm|ansible-operator/main.go which is used to generate bin. See: #3331

Example:

	//   (MaxConcurrentReconciles). Flag `--max-concurrent-reconciles` should be used instead.
	pflag.IntVar(&defaultMaxWorkers, "max-workers", runtime.NumCPU(), "Default maximum number of concurrent reconciles for controllers.")
	if err := pflag.CommandLine.MarkHidden("max-workers"); err != nil {
		setupLog.Error(err, "failed to hide --max-workers flag")
		os.Exit(1)
	}

....

	// Deprecated: --max-workers flag does not align well with the name of the option it configures on the controller
	//   (MaxConcurrentReconciles). Flag `--max-concurrent-reconciles` should be used instead.
	if pflag.Lookup("max-workers").Changed {
		setupLog.Info("flag --max-workers has been deprecated, use --max-concurrent-reconciles instead")
		if pflag.Lookup("max-concurrent-reconciles").Changed {
			setupLog.Info("ignoring --max-workers since --max-concurrent-reconciles is set")
		} else {
			defaultMaxConcurrentReconciles = defaultMaxWorkers
		}
	}

...

@camilamacedo86 camilamacedo86 added this to the v1.0.0 milestone Jul 8, 2020
@camilamacedo86 camilamacedo86 added language/ansible Issue is related to an Ansible operator project language/helm Issue is related to a Helm operator project kubebuilder-integration Relates to rewriting the SDK in Kubebuilder plugin form labels Jul 8, 2020
@camilamacedo86 camilamacedo86 changed the title deprecated the flag --max-worker and replace it for max-concurrent-reconciles deprecate the flag --max-worker and replace it for max-concurrent-reconciles and use the num of CPU as default value. Jul 8, 2020
@tengqm
Copy link
Contributor

tengqm commented Jul 17, 2020

This can be closed?

@camilamacedo86
Copy link
Contributor Author

Hi @tengqm,

it cannot be closed yet. This need was addressed by @varshaprasad96 for Ansible in #3435 but we still requering to do the same for Helm.

@varshaprasad96
Copy link
Member

PR for modifications in ansible: #3435 (closed)
PR for modifications in helm: #3452

@camilamacedo86
Copy link
Contributor Author

Just to register, after a discussion, was decide we no longer support --max-worker for 1.0.0.

@tengqm
Copy link
Contributor

tengqm commented Jul 18, 2020

my bad. the prs are still under review.

@camilamacedo86
Copy link
Contributor Author

hi @tengqm,

All fine, btw really tks for your contributions. 🥇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kubebuilder-integration Relates to rewriting the SDK in Kubebuilder plugin form language/ansible Issue is related to an Ansible operator project language/helm Issue is related to a Helm operator project
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants