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

Export various stats about services in the metrics exported by this c… #1943

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
7 changes: 7 additions & 0 deletions cmd/glbc/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import (
"k8s.io/ingress-gce/pkg/l4lb"
"k8s.io/ingress-gce/pkg/psc"
"k8s.io/ingress-gce/pkg/serviceattachment"
"k8s.io/ingress-gce/pkg/servicemetrics"
"k8s.io/ingress-gce/pkg/svcneg"
"k8s.io/klog/v2"

Expand Down Expand Up @@ -293,6 +294,12 @@ func runControllers(ctx *ingctx.ControllerContext) {
klog.V(0).Infof("PSC Controller started")
}

if flags.F.EnableServiceMetrics {
metricsController := servicemetrics.NewController(ctx, flags.F.MetricsExportInterval, stopCh)
go metricsController.Run()
klog.V(0).Infof("Service Metrics Controller started")
}

var zoneGetter negtypes.ZoneGetter
zoneGetter = lbc.Translator
// In NonGCP mode, use the zone specified in gce.conf directly.
Expand Down
2 changes: 2 additions & 0 deletions pkg/flags/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ var (
EnablePinhole bool
EnableL4ILBDualStack bool
EnableMultipleIGs bool
EnableServiceMetrics bool
MaxIGSize int
}{
GCERateLimitScale: 1.0,
Expand Down Expand Up @@ -244,6 +245,7 @@ L7 load balancing. CSV values accepted. Example: -node-port-ranges=80,8080,400-5
flag.BoolVar(&F.RunIngressController, "run-ingress-controller", true, `Optional, whether or not to run IngressController as part of glbc. If set to false, ingress resources will not be processed. Only the L4 Service controller will be run, if that flag is set to true.`)
flag.BoolVar(&F.RunL4Controller, "run-l4-controller", false, `Optional, whether or not to run L4 Service Controller as part of glbc. If set to true, services of Type:LoadBalancer with Internal annotation will be processed by this controller.`)
flag.BoolVar(&F.RunL4NetLBController, "run-l4-netlb-controller", false, `Optional, f enabled then the L4NetLbController will be run.`)
flag.BoolVar(&F.EnableServiceMetrics, "enable-service-metrics", false, `Optional, if enabled then the service metrics controller will be run.`)
flag.BoolVar(&F.EnableBackendConfigHealthCheck, "enable-backendconfig-healthcheck", false, "Enable configuration of HealthChecks from the BackendConfig")
flag.BoolVar(&F.EnablePSC, "enable-psc", false, "Enable PSC controller")
flag.BoolVar(&F.EnableIngressGAFields, "enable-ingress-ga-fields", false, "Enable using Ingress Class GA features")
Expand Down
Loading