You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@uniffle.apache.org by "crain-cn (via GitHub)" <gi...@apache.org> on 2023/02/28 09:19:44 UTC
[GitHub] [incubator-uniffle] crain-cn opened a new pull request, #670: [#645]feat(operator): support manager parameter configuration
crain-cn opened a new pull request, #670:
URL: https://github.com/apache/incubator-uniffle/pull/670
### What changes were proposed in this pull request?
Support Operator Manager parameter configuration.
### Why are the changes needed?
1. It is possible to customize parameters and modify the required configuration parameters.
2. Hope to make reasonable use of Kubernetes services.
issue:#645
### Does this PR introduce _any_ user-facing change?
Because in real-world scenarios, it may be necessary to adjust some parameters, such as Namespace.
### How was this patch tested?
Manually verified.
![image](https://user-images.githubusercontent.com/45311215/221807077-9b07f00d-e88e-4cea-894c-935f4096a1e7.png)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1124145099
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -19,29 +19,52 @@ package config
import (
"flag"
+ "time"
+
+ "k8s.io/utils/pointer"
+
+ ctrl "sigs.k8s.io/controller-runtime"
"github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/constants"
"github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/utils"
)
const (
- flagWorkers = "workers"
+ flagWorkers = "workers"
+ managerLeaderElection = "leader-election"
+ managerLeaderElectionID = "leader-election-id"
+ managerLeaderElectionNamespace = "leader-election-namespace"
+ managerSyncPeriod = "sync-period"
+ managerRetryPeriod = "retry-period"
+ managerNamespace = "namespace"
)
// Config contains all configurations.
type Config struct {
- Workers int
+ Workers int
+ ManagerOptions ctrl.Options
utils.GenericConfig
}
+var syncPeriod, retryPeriod time.Duration
Review Comment:
This line should be removed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121404618
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
Review Comment:
@wangao1236 could you help check this default values is proper or not?
##########
deploy/kubernetes/operator/cmd/controller/main.go:
##########
@@ -30,17 +30,15 @@ import (
func main() {
klog.InitFlags(nil)
cfg := &config.Config{}
+ cfg.ManagerOptions = ctrl.Options{}
Review Comment:
is this necessary?
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
is this necessary? is `flag.DurationVar(c.ManagerOptions.SyncPeriod)` doesn't work?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1122670238
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
ah, I see.
you could init it with default value first. such as:
```
c.ManagerOptions.SyncPeriod = pointer.Duration(...)
```
You could use k8s.io/utils/pointer/pointer.go here.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy merged pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy merged PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1122548446
##########
deploy/kubernetes/operator/cmd/controller/main.go:
##########
@@ -30,17 +30,15 @@ import (
func main() {
klog.InitFlags(nil)
cfg := &config.Config{}
+ cfg.ManagerOptions = ctrl.Options{}
Review Comment:
This can be deleted, I didn't pay enough attention and submitted it by mistake.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1124042324
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
👌
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1122546913
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
![image](https://user-images.githubusercontent.com/45311215/222318628-5f456b07-7e32-428b-b64f-356685c5f2b3.png)
Not initializing the pointer at this position will result in a panic. How do you think it would be best to write this?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#issuecomment-1455074026
LGTM. Merging this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121466136
##########
deploy/kubernetes/operator/cmd/controller/main.go:
##########
@@ -30,17 +30,15 @@ import (
func main() {
klog.InitFlags(nil)
cfg := &config.Config{}
+ cfg.ManagerOptions = ctrl.Options{}
Review Comment:
> is this necessary?
yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121919602
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
I mean we don't need a tmp variable to proxy here.
`flag.DurationVar(c.ManagerOptions.SyncPeriod, ....)` should have the same effect with your code?
Am I missing something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] advancedxy commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "advancedxy (via GitHub)" <gi...@apache.org>.
advancedxy commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121921196
##########
deploy/kubernetes/operator/cmd/controller/main.go:
##########
@@ -30,17 +30,15 @@ import (
func main() {
klog.InitFlags(nil)
cfg := &config.Config{}
+ cfg.ManagerOptions = ctrl.Options{}
Review Comment:
cfg.ManagerOptions should be empty initialized without L33, which should be the same of L33.
Am I missing something?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] codecov-commenter commented on pull request #670: [#645]feat(operator): support manager parameter configuration
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#issuecomment-1447847369
# [Codecov](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
> Merging [#670](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (7746092) into [master](https://codecov.io/gh/apache/incubator-uniffle/commit/4fd9cad07e2943d7f3fa8b2010a43e90520325ff?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (4fd9cad) will **increase** coverage by `2.19%`.
> The diff coverage is `n/a`.
```diff
@@ Coverage Diff @@
## master #670 +/- ##
============================================
+ Coverage 60.78% 62.98% +2.19%
+ Complexity 1808 1806 -2
============================================
Files 216 202 -14
Lines 12489 10525 -1964
Branches 1055 1055
============================================
- Hits 7592 6629 -963
+ Misses 4491 3548 -943
+ Partials 406 348 -58
```
| [Impacted Files](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
|---|---|---|
| [.../java/org/apache/uniffle/server/ShuffleServer.java](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmVyL3NyYy9tYWluL2phdmEvb3JnL2FwYWNoZS91bmlmZmxlL3NlcnZlci9TaHVmZmxlU2VydmVyLmphdmE=) | `59.60% <0.00%> (-3.95%)` | :arrow_down: |
| [deploy/kubernetes/operator/pkg/utils/certs.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3V0aWxzL2NlcnRzLmdv) | | |
| [deploy/kubernetes/operator/pkg/utils/rss.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3V0aWxzL3Jzcy5nbw==) | | |
| [deploy/kubernetes/operator/pkg/utils/util.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3V0aWxzL3V0aWwuZ28=) | | |
| [...rnetes/operator/pkg/webhook/inspector/inspector.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svaW5zcGVjdG9yL2luc3BlY3Rvci5nbw==) | | |
| [...oy/kubernetes/operator/pkg/utils/shufflerserver.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3V0aWxzL3NodWZmbGVyc2VydmVyLmdv) | | |
| [...pkg/controller/sync/shuffleserver/shuffleserver.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL2NvbnRyb2xsZXIvc3luYy9zaHVmZmxlc2VydmVyL3NodWZmbGVzZXJ2ZXIuZ28=) | | |
| [...eploy/kubernetes/operator/pkg/utils/coordinator.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3V0aWxzL2Nvb3JkaW5hdG9yLmdv) | | |
| [...bernetes/operator/pkg/controller/controller/rss.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL2NvbnRyb2xsZXIvY29udHJvbGxlci9yc3MuZ28=) | | |
| [...y/kubernetes/operator/pkg/webhook/inspector/pod.go](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVwbG95L2t1YmVybmV0ZXMvb3BlcmF0b3IvcGtnL3dlYmhvb2svaW5zcGVjdG9yL3BvZC5nbw==) | | |
| ... and [5 more](https://codecov.io/gh/apache/incubator-uniffle/pull/670?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
:mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1124200259
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -19,29 +19,52 @@ package config
import (
"flag"
+ "time"
+
+ "k8s.io/utils/pointer"
+
+ ctrl "sigs.k8s.io/controller-runtime"
"github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/constants"
"github.com/apache/incubator-uniffle/deploy/kubernetes/operator/pkg/utils"
)
const (
- flagWorkers = "workers"
+ flagWorkers = "workers"
+ managerLeaderElection = "leader-election"
+ managerLeaderElectionID = "leader-election-id"
+ managerLeaderElectionNamespace = "leader-election-namespace"
+ managerSyncPeriod = "sync-period"
+ managerRetryPeriod = "retry-period"
+ managerNamespace = "namespace"
)
// Config contains all configurations.
type Config struct {
- Workers int
+ Workers int
+ ManagerOptions ctrl.Options
utils.GenericConfig
}
+var syncPeriod, retryPeriod time.Duration
Review Comment:
👌
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org
[GitHub] [incubator-uniffle] crain-cn commented on a diff in pull request #670: [#645][Improvement] feat(operator): support manager parameter configuration
Posted by "crain-cn (via GitHub)" <gi...@apache.org>.
crain-cn commented on code in PR #670:
URL: https://github.com/apache/incubator-uniffle/pull/670#discussion_r1121468544
##########
deploy/kubernetes/operator/pkg/controller/config/config.go:
##########
@@ -42,6 +54,15 @@ func (c *Config) LeaderElectionID() string {
// AddFlags adds all configurations to the global flags.
func (c *Config) AddFlags() {
flag.IntVar(&c.Workers, flagWorkers, 1, "Concurrency of the rss controller.")
+ flag.BoolVar(&c.ManagerOptions.LeaderElection, managerLeaderElection, true, "LeaderElection determines whether or not to use leader election when starting the manager.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionID, managerLeaderElectionID, c.LeaderElectionID(), "LeaderElectionID determines the name of the resource that leader election will use for holding the leader lock.")
+ flag.StringVar(&c.ManagerOptions.LeaderElectionNamespace, managerLeaderElectionNamespace, "kube-system", "LeaderElectionNamespace determines the namespace in which the leader election resource will be created.")
+ flag.StringVar(&c.ManagerOptions.Namespace, managerNamespace, "", "Namespace if specified restricts the manager's cache to watch objects in the desired namespace Defaults to all namespaces.")
+ flag.DurationVar(&syncPeriod, managerSyncPeriod, time.Hour*10, "SyncPeriod determines the minimum frequency at which watched resources are reconciled.")
Review Comment:
It is possible to adjust the synchronization time, if not set, it will remain the default.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@uniffle.apache.org
For additional commands, e-mail: issues-help@uniffle.apache.org