Skip to content

Commit

Permalink
Fix autoscaler watch namespaces (#356)
Browse files Browse the repository at this point in the history
* remove autoscaler watch-namespaces flag

* remove flag
  • Loading branch information
MegaByte875 authored Oct 19, 2023
1 parent bd369e2 commit 817850d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
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).")
}

0 comments on commit 817850d

Please sign in to comment.