Merge branch 'main' into feat/add-skip-tls-verify
This commit is contained in:
commit
206649de31
|
|
@ -21,5 +21,6 @@ jobs:
|
||||||
with:
|
with:
|
||||||
paths: "**/*.md"
|
paths: "**/*.md"
|
||||||
markdown: true
|
markdown: true
|
||||||
|
concurrency: 1
|
||||||
retry: true
|
retry: true
|
||||||
linksToSkip: "https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-interceptor, https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-operator, https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-scaler,http://opentelemetry-collector.open-telemetry-system:4318,http://opentelemetry-collector.open-telemetry-system:4318/v1/traces, https://www.gnu.org/software/make/"
|
linksToSkip: "https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-interceptor, https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-operator, https://github.com/kedacore/http-add-on/pkgs/container/http-add-on-scaler,http://opentelemetry-collector.open-telemetry-system:4318,http://opentelemetry-collector.open-telemetry-system:4318/v1/traces, https://www.gnu.org/software/make/"
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ linters:
|
||||||
- unconvert
|
- unconvert
|
||||||
- ineffassign
|
- ineffassign
|
||||||
- staticcheck
|
- staticcheck
|
||||||
- exportloopref
|
- copyloopvar
|
||||||
#- depguard #https://github.com/kedacore/keda/issues/4980
|
#- depguard #https://github.com/kedacore/keda/issues/4980
|
||||||
- dogsled
|
- dogsled
|
||||||
- errcheck
|
- errcheck
|
||||||
|
|
|
||||||
|
|
@ -27,6 +27,7 @@ This changelog keeps track of work items that have been completed and are ready
|
||||||
|
|
||||||
- **General**: Add configurable tracing support to the interceptor proxy ([#1021](https://github.com/kedacore/http-add-on/pull/1021))
|
- **General**: Add configurable tracing support to the interceptor proxy ([#1021](https://github.com/kedacore/http-add-on/pull/1021))
|
||||||
- **General**: Allow using HSO and SO with different names ([#1293](https://github.com/kedacore/http-add-on/issues/1293))
|
- **General**: Allow using HSO and SO with different names ([#1293](https://github.com/kedacore/http-add-on/issues/1293))
|
||||||
|
- **General**: Support profiling for KEDA components ([#4789](https://github.com/kedacore/keda/issues/4789))
|
||||||
|
|
||||||
### Improvements
|
### Improvements
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ type Serving struct {
|
||||||
TLSSkipVerify bool `envconfig:"KEDA_HTTP_PROXY_TLS_SKIP_VERIFY" default:"false"`
|
TLSSkipVerify bool `envconfig:"KEDA_HTTP_PROXY_TLS_SKIP_VERIFY" default:"false"`
|
||||||
// TLSPort is the port that the server should serve on if TLS is enabled
|
// TLSPort is the port that the server should serve on if TLS is enabled
|
||||||
TLSPort int `envconfig:"KEDA_HTTP_PROXY_TLS_PORT" default:"8443"`
|
TLSPort int `envconfig:"KEDA_HTTP_PROXY_TLS_PORT" default:"8443"`
|
||||||
|
// ProfilingAddr if not empty, pprof will be available on this address, assuming host:port here
|
||||||
|
ProfilingAddr string `envconfig:"PROFILING_BIND_ADDRESS" default:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
// Parse parses standard configs using envconfig and returns a pointer to the
|
// Parse parses standard configs using envconfig and returns a pointer to the
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
|
@ -81,6 +82,7 @@ func main() {
|
||||||
proxyPort := servingCfg.ProxyPort
|
proxyPort := servingCfg.ProxyPort
|
||||||
adminPort := servingCfg.AdminPort
|
adminPort := servingCfg.AdminPort
|
||||||
proxyTLSEnabled := servingCfg.ProxyTLSEnabled
|
proxyTLSEnabled := servingCfg.ProxyTLSEnabled
|
||||||
|
profilingAddr := servingCfg.ProfilingAddr
|
||||||
|
|
||||||
// setup the configured metrics collectors
|
// setup the configured metrics collectors
|
||||||
metrics.NewMetricsCollectors(metricsCfg)
|
metrics.NewMetricsCollectors(metricsCfg)
|
||||||
|
|
@ -218,6 +220,13 @@ func main() {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if len(profilingAddr) > 0 {
|
||||||
|
eg.Go(func() error {
|
||||||
|
setupLog.Info("enabling pprof for profiling", "address", profilingAddr)
|
||||||
|
return http.ListenAndServe(profilingAddr, nil)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
build.PrintComponentInfo(ctrl.Log, "Interceptor")
|
build.PrintComponentInfo(ctrl.Log, "Interceptor")
|
||||||
|
|
||||||
if err := eg.Wait(); err != nil && !errors.Is(err, context.Canceled) {
|
if err := eg.Wait(); err != nil && !errors.Is(err, context.Canceled) {
|
||||||
|
|
|
||||||
|
|
@ -57,11 +57,13 @@ func main() {
|
||||||
var metricsAddr string
|
var metricsAddr string
|
||||||
var enableLeaderElection bool
|
var enableLeaderElection bool
|
||||||
var probeAddr string
|
var probeAddr string
|
||||||
|
var profilingAddr string
|
||||||
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
|
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
|
||||||
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
|
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
|
||||||
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
|
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
|
||||||
"Enable leader election for controller manager. "+
|
"Enable leader election for controller manager. "+
|
||||||
"Enabling this will ensure there is only one active controller manager.")
|
"Enabling this will ensure there is only one active controller manager.")
|
||||||
|
flag.StringVar(&profilingAddr, "profiling-bind-address", "", "The address the profiling would be exposed on.")
|
||||||
opts := zap.Options{
|
opts := zap.Options{
|
||||||
Development: true,
|
Development: true,
|
||||||
}
|
}
|
||||||
|
|
@ -96,6 +98,7 @@ func main() {
|
||||||
Metrics: server.Options{
|
Metrics: server.Options{
|
||||||
BindAddress: metricsAddr,
|
BindAddress: metricsAddr,
|
||||||
},
|
},
|
||||||
|
PprofBindAddress: profilingAddr,
|
||||||
HealthProbeBindAddress: probeAddr,
|
HealthProbeBindAddress: probeAddr,
|
||||||
LeaderElection: enableLeaderElection,
|
LeaderElection: enableLeaderElection,
|
||||||
LeaderElectionID: "http-add-on.keda.sh",
|
LeaderElectionID: "http-add-on.keda.sh",
|
||||||
|
|
|
||||||
|
|
@ -57,7 +57,6 @@ func TestGetEndpoints(t *testing.T) {
|
||||||
addrLookup := map[string]*v1.EndpointAddress{}
|
addrLookup := map[string]*v1.EndpointAddress{}
|
||||||
for _, subset := range endpoints.Subsets {
|
for _, subset := range endpoints.Subsets {
|
||||||
for _, addr := range subset.Addresses {
|
for _, addr := range subset.Addresses {
|
||||||
addr := addr
|
|
||||||
key := fmt.Sprintf("http://%s:%s", addr.IP, svcPort)
|
key := fmt.Sprintf("http://%s:%s", addr.IP, svcPort)
|
||||||
addrLookup[key] = &addr
|
addrLookup[key] = &addr
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -190,8 +190,6 @@ var _ = Describe("Table", func() {
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
for _, httpso := range httpsoList.Items {
|
for _, httpso := range httpsoList.Items {
|
||||||
httpso := httpso
|
|
||||||
|
|
||||||
key := *k8s.NamespacedNameFromObject(&httpso)
|
key := *k8s.NamespacedNameFromObject(&httpso)
|
||||||
t.httpScaledObjects[key] = &httpso
|
t.httpScaledObjects[key] = &httpso
|
||||||
}
|
}
|
||||||
|
|
@ -216,8 +214,6 @@ var _ = Describe("Table", func() {
|
||||||
defer cancel()
|
defer cancel()
|
||||||
|
|
||||||
for _, httpso := range httpsoList.Items {
|
for _, httpso := range httpsoList.Items {
|
||||||
httpso := httpso
|
|
||||||
|
|
||||||
key := *k8s.NamespacedNameFromObject(&httpso)
|
key := *k8s.NamespacedNameFromObject(&httpso)
|
||||||
t.httpScaledObjects[key] = &httpso
|
t.httpScaledObjects[key] = &httpso
|
||||||
}
|
}
|
||||||
|
|
@ -285,8 +281,6 @@ var _ = Describe("Table", func() {
|
||||||
|
|
||||||
It("returns new memory based on HTTPSOs", func() {
|
It("returns new memory based on HTTPSOs", func() {
|
||||||
for _, httpso := range httpsoList.Items {
|
for _, httpso := range httpsoList.Items {
|
||||||
httpso := httpso
|
|
||||||
|
|
||||||
key := *k8s.NamespacedNameFromObject(&httpso)
|
key := *k8s.NamespacedNameFromObject(&httpso)
|
||||||
t.httpScaledObjects[key] = &httpso
|
t.httpScaledObjects[key] = &httpso
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -484,8 +484,6 @@ var _ = Describe("TableMemory", func() {
|
||||||
store: iradix.New[*httpv1alpha1.HTTPScaledObject](),
|
store: iradix.New[*httpv1alpha1.HTTPScaledObject](),
|
||||||
}
|
}
|
||||||
for _, httpso := range httpsoList.Items {
|
for _, httpso := range httpsoList.Items {
|
||||||
httpso := httpso
|
|
||||||
|
|
||||||
tm = insertTrees(tm, &httpso)
|
tm = insertTrees(tm, &httpso)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,8 @@ type config struct {
|
||||||
DeploymentCacheRsyncPeriod time.Duration `envconfig:"KEDA_HTTP_SCALER_DEPLOYMENT_INFORMER_RSYNC_PERIOD" default:"60m"`
|
DeploymentCacheRsyncPeriod time.Duration `envconfig:"KEDA_HTTP_SCALER_DEPLOYMENT_INFORMER_RSYNC_PERIOD" default:"60m"`
|
||||||
// QueueTickDuration is the duration between queue requests
|
// QueueTickDuration is the duration between queue requests
|
||||||
QueueTickDuration time.Duration `envconfig:"KEDA_HTTP_QUEUE_TICK_DURATION" default:"500ms"`
|
QueueTickDuration time.Duration `envconfig:"KEDA_HTTP_QUEUE_TICK_DURATION" default:"500ms"`
|
||||||
|
// ProfilingAddr if not empty, pprof will be available on this address, assuming host:port here
|
||||||
|
ProfilingAddr string `envconfig:"PROFILING_BIND_ADDRESS" default:""`
|
||||||
}
|
}
|
||||||
|
|
||||||
func mustParseConfig() *config {
|
func mustParseConfig() *config {
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,8 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net"
|
"net"
|
||||||
|
"net/http"
|
||||||
|
_ "net/http/pprof"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
|
|
@ -47,6 +49,7 @@ func main() {
|
||||||
deplName := cfg.TargetDeployment
|
deplName := cfg.TargetDeployment
|
||||||
targetPortStr := fmt.Sprintf("%d", cfg.TargetPort)
|
targetPortStr := fmt.Sprintf("%d", cfg.TargetPort)
|
||||||
targetPendingRequests := cfg.TargetPendingRequests
|
targetPendingRequests := cfg.TargetPendingRequests
|
||||||
|
profilingAddr := cfg.ProfilingAddr
|
||||||
|
|
||||||
opts := zap.Options{}
|
opts := zap.Options{}
|
||||||
opts.BindFlags(flag.CommandLine)
|
opts.BindFlags(flag.CommandLine)
|
||||||
|
|
@ -113,6 +116,13 @@ func main() {
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
|
||||||
|
if len(profilingAddr) > 0 {
|
||||||
|
eg.Go(func() error {
|
||||||
|
setupLog.Info("enabling pprof for profiling", "address", profilingAddr)
|
||||||
|
return http.ListenAndServe(profilingAddr, nil)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
setupLog.Info("starting the grpc server")
|
setupLog.Info("starting the grpc server")
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue