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

Fix autoscaler watch namespaces #356

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@ spec:
command:
- /usr/local/bin/autoscaler
args:
{{- if .Values.watchNamespaces }}
- --watch-namespaces={{ .Values.watchNamespaces }}
{{- end }}
- --concurrent-autoscaler-syncs={{ .Values.concurrentAutoscalerSyncs }}
- --health-probe-bind-address=:8091
- --metrics-bind-address=:8090
Expand Down
2 changes: 1 addition & 1 deletion charts/nebula-operator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enableKruiseScheme: false
# Period at which the controller forces the repopulation of its local object stores. (default 0h30m0s)
syncPeriod: 0h30m0s

# Namespaces restricts the controller watches for updates to Kubernetes objects. If empty, all namespaces are watched.
# Namespaces restricts the controller-manager watches for updates to Kubernetes objects. If empty, all namespaces are watched.
# e.g. ns1,ns2,ns3
watchNamespaces: ""

Expand Down
3 changes: 2 additions & 1 deletion cmd/autoscaler/app/autoscaler.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ func Run(ctx context.Context, opts *options.Options) error {

Cache: cache.Options{
SyncPeriod: &opts.HPAOpts.HorizontalPodAutoscalerSyncPeriod.Duration,
Namespaces: opts.Namespaces,
// FIXME: *cache.multiNamespaceInformer missing method GetController
//Namespaces: opts.Namespaces,
},
Controller: config.Controller{
GroupKindConcurrency: map[string]int{
Expand Down
2 changes: 1 addition & 1 deletion cmd/autoscaler/app/options/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,5 +112,5 @@ func (o *Options) AddFlags(flags *pflag.FlagSet) {
flags.StringVar(&o.MetricsBindAddress, "metrics-bind-address", ":8080", "The TCP address that the controller should bind to for serving prometheus metrics(e.g. 127.0.0.1:8080, :8080). It can be set to \"0\" to disable the metrics serving.")
flags.StringVar(&o.HealthProbeBindAddress, "health-probe-bind-address", ":8081", "The TCP address that the controller should bind to for serving health probes.(e.g. 127.0.0.1:8081, :8081). It can be set to \"0\" to disable the health probe serving.")

flags.StringSliceVar(&o.Namespaces, "watch-namespaces", nil, "Namespaces restricts the controller watches for updates to Kubernetes objects. If empty, all namespaces are watched. Multiple namespaces seperated by comma.(e.g. ns1,ns2,ns3).")
//flags.StringSliceVar(&o.Namespaces, "watch-namespaces", nil, "Namespaces restricts the controller watches for updates to Kubernetes objects. If empty, all namespaces are watched. Multiple namespaces seperated by comma.(e.g. ns1,ns2,ns3).")
}