mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-09-30 01:21:30 +02:00
Add default and per-controller max-concurrent-reconciles flags (#4626)
Signed-off-by: KR Ravindra <42912207+KR-Ravindra@users.noreply.github.com>
This commit is contained in:
+14
-2
@@ -47,8 +47,20 @@ args:
|
||||
{{- with .Values.controller.manager.config.watchSingleNamespace }}
|
||||
- "--watch-single-namespace={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.controller.manager.config.runnerMaxConcurrentReconciles }}
|
||||
- "--runner-max-concurrent-reconciles={{ . }}"
|
||||
{{- with .Values.controller.manager.config.defaultMaxConcurrentReconciles }}
|
||||
- "--default-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.controller.manager.config.autoscalingRunnerSetMaxConcurrentReconciles }}
|
||||
- "--autoscaling-runner-set-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.controller.manager.config.autoscalingListenerMaxConcurrentReconciles }}
|
||||
- "--autoscaling-listener-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.controller.manager.config.ephemeralRunnerSetMaxConcurrentReconciles }}
|
||||
- "--ephemeral-runner-set-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.controller.manager.config.ephemeralRunnerMaxConcurrentReconciles }}
|
||||
- "--ephemeral-runner-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- if .Values.controller.metrics }}
|
||||
{{- with .Values.controller.metrics }}
|
||||
|
||||
+51
@@ -73,3 +73,54 @@ tests:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--listener-metrics-endpoint=/metrics"
|
||||
|
||||
- it: should omit every max-concurrent-reconciles flag by default
|
||||
release:
|
||||
name: "test-arc"
|
||||
namespace: "test-ns"
|
||||
asserts:
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--ephemeral-runner-max-concurrent-reconciles=1"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--default-max-concurrent-reconciles=1"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--autoscaling-runner-set-max-concurrent-reconciles=1"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--autoscaling-listener-max-concurrent-reconciles=1"
|
||||
- notContains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--ephemeral-runner-set-max-concurrent-reconciles=1"
|
||||
|
||||
- it: should include every max-concurrent-reconciles flag when configured
|
||||
set:
|
||||
controller:
|
||||
manager:
|
||||
config:
|
||||
defaultMaxConcurrentReconciles: 4
|
||||
autoscalingRunnerSetMaxConcurrentReconciles: 3
|
||||
autoscalingListenerMaxConcurrentReconciles: 5
|
||||
ephemeralRunnerSetMaxConcurrentReconciles: 6
|
||||
ephemeralRunnerMaxConcurrentReconciles: 20
|
||||
release:
|
||||
name: "test-arc"
|
||||
namespace: "test-ns"
|
||||
asserts:
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--default-max-concurrent-reconciles=4"
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--autoscaling-runner-set-max-concurrent-reconciles=3"
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--autoscaling-listener-max-concurrent-reconciles=5"
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--ephemeral-runner-set-max-concurrent-reconciles=6"
|
||||
- contains:
|
||||
path: spec.template.spec.containers[0].args
|
||||
content: "--ephemeral-runner-max-concurrent-reconciles=20"
|
||||
|
||||
@@ -28,8 +28,15 @@ controller:
|
||||
# Defaults to watch all namespaces when unset.
|
||||
watchSingleNamespace: ""
|
||||
|
||||
# The maximum number of concurrent reconciles which can be run by the EphemeralRunner controller.
|
||||
runnerMaxConcurrentReconciles: 2
|
||||
# The maximum number of concurrent reconciles applied to every controller that does not
|
||||
# set its own value below. Defaults to 1 when unset.
|
||||
defaultMaxConcurrentReconciles: null
|
||||
|
||||
# Per-controller overrides. Each defaults to defaultMaxConcurrentReconciles when unset.
|
||||
autoscalingRunnerSetMaxConcurrentReconciles: null
|
||||
autoscalingListenerMaxConcurrentReconciles: null
|
||||
ephemeralRunnerSetMaxConcurrentReconciles: null
|
||||
ephemeralRunnerMaxConcurrentReconciles: null
|
||||
|
||||
# List of label prefixes that should NOT be propagated to internal resources.
|
||||
excludeLabelPropagationPrefixes: []
|
||||
|
||||
@@ -67,8 +67,20 @@ spec:
|
||||
{{- with .Values.flags.watchSingleNamespace }}
|
||||
- "--watch-single-namespace={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.flags.runnerMaxConcurrentReconciles }}
|
||||
- "--runner-max-concurrent-reconciles={{ . }}"
|
||||
{{- with .Values.flags.defaultMaxConcurrentReconciles }}
|
||||
- "--default-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.flags.autoscalingRunnerSetMaxConcurrentReconciles }}
|
||||
- "--autoscaling-runner-set-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.flags.autoscalingListenerMaxConcurrentReconciles }}
|
||||
- "--autoscaling-listener-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.flags.ephemeralRunnerSetMaxConcurrentReconciles }}
|
||||
- "--ephemeral-runner-set-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- with .Values.flags.ephemeralRunnerMaxConcurrentReconciles }}
|
||||
- "--ephemeral-runner-max-concurrent-reconciles={{ . }}"
|
||||
{{- end }}
|
||||
{{- if .Values.metrics }}
|
||||
{{- with .Values.metrics }}
|
||||
|
||||
@@ -366,7 +366,6 @@ func TestTemplate_ControllerDeployment_Defaults(t *testing.T) {
|
||||
"--metrics-addr=0",
|
||||
"--listener-metrics-addr=0",
|
||||
"--listener-metrics-endpoint=",
|
||||
"--runner-max-concurrent-reconciles=2",
|
||||
}
|
||||
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
|
||||
|
||||
@@ -518,7 +517,6 @@ func TestTemplate_ControllerDeployment_Customize(t *testing.T) {
|
||||
"--listener-metrics-addr=0",
|
||||
"--listener-metrics-endpoint=",
|
||||
"--metrics-addr=0",
|
||||
"--runner-max-concurrent-reconciles=2",
|
||||
}
|
||||
|
||||
assert.ElementsMatch(t, expectArgs, deployment.Spec.Template.Spec.Containers[0].Args)
|
||||
@@ -646,7 +644,6 @@ func TestTemplate_EnableLeaderElection(t *testing.T) {
|
||||
"--listener-metrics-addr=0",
|
||||
"--listener-metrics-endpoint=",
|
||||
"--metrics-addr=0",
|
||||
"--runner-max-concurrent-reconciles=2",
|
||||
}
|
||||
|
||||
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
|
||||
@@ -687,7 +684,6 @@ func TestTemplate_ControllerDeployment_ForwardImagePullSecrets(t *testing.T) {
|
||||
"--listener-metrics-addr=0",
|
||||
"--listener-metrics-endpoint=",
|
||||
"--metrics-addr=0",
|
||||
"--runner-max-concurrent-reconciles=2",
|
||||
}
|
||||
|
||||
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
|
||||
@@ -777,7 +773,6 @@ func TestTemplate_ControllerDeployment_WatchSingleNamespace(t *testing.T) {
|
||||
"--listener-metrics-addr=0",
|
||||
"--listener-metrics-endpoint=",
|
||||
"--metrics-addr=0",
|
||||
"--runner-max-concurrent-reconciles=2",
|
||||
}
|
||||
|
||||
assert.ElementsMatch(t, expectedArgs, deployment.Spec.Template.Spec.Containers[0].Args)
|
||||
@@ -796,6 +791,42 @@ func TestTemplate_ControllerDeployment_WatchSingleNamespace(t *testing.T) {
|
||||
assert.Equal(t, "/tmp", deployment.Spec.Template.Spec.Containers[0].VolumeMounts[0].MountPath)
|
||||
}
|
||||
|
||||
func TestTemplate_ControllerDeployment_MaxConcurrentReconciles(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
// Path to the helm chart we will test
|
||||
helmChartPath, err := filepath.Abs("../../gha-runner-scale-set-controller")
|
||||
require.NoError(t, err)
|
||||
|
||||
releaseName := "test-arc"
|
||||
namespaceName := "test-" + strings.ToLower(random.UniqueID())
|
||||
|
||||
options := &helm.Options{
|
||||
Logger: logger.Discard,
|
||||
SetValues: map[string]string{
|
||||
"flags.defaultMaxConcurrentReconciles": "4",
|
||||
"flags.autoscalingRunnerSetMaxConcurrentReconciles": "3",
|
||||
"flags.autoscalingListenerMaxConcurrentReconciles": "5",
|
||||
"flags.ephemeralRunnerSetMaxConcurrentReconciles": "6",
|
||||
"flags.ephemeralRunnerMaxConcurrentReconciles": "20",
|
||||
},
|
||||
KubectlOptions: k8s.NewKubectlOptions("", "", namespaceName),
|
||||
}
|
||||
|
||||
output := helm.RenderTemplateContext(t, t.Context(), options, helmChartPath, releaseName, []string{"templates/deployment.yaml"})
|
||||
|
||||
var deployment appsv1.Deployment
|
||||
helm.UnmarshalK8SYaml(t, output, &deployment)
|
||||
|
||||
assert.Len(t, deployment.Spec.Template.Spec.Containers, 1)
|
||||
args := deployment.Spec.Template.Spec.Containers[0].Args
|
||||
assert.Contains(t, args, "--default-max-concurrent-reconciles=4")
|
||||
assert.Contains(t, args, "--autoscaling-runner-set-max-concurrent-reconciles=3")
|
||||
assert.Contains(t, args, "--autoscaling-listener-max-concurrent-reconciles=5")
|
||||
assert.Contains(t, args, "--ephemeral-runner-set-max-concurrent-reconciles=6")
|
||||
assert.Contains(t, args, "--ephemeral-runner-max-concurrent-reconciles=20")
|
||||
}
|
||||
|
||||
func TestTemplate_ControllerContainerEnvironmentVariables(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
|
||||
@@ -114,10 +114,16 @@ flags:
|
||||
## Defaults to watch all namespaces when unset.
|
||||
# watchSingleNamespace: ""
|
||||
|
||||
## The maximum number of concurrent reconciles which can be run by the EphemeralRunner controller.
|
||||
# Increase this value to improve the throughput of the controller.
|
||||
## The maximum number of concurrent reconciles applied to every controller that does not set its own value below.
|
||||
# Increase this value to improve the throughput of the controller when running many runner scale sets.
|
||||
# It may also increase the load on the API server and the external service (e.g. GitHub API).
|
||||
runnerMaxConcurrentReconciles: 2
|
||||
# defaultMaxConcurrentReconciles: 1
|
||||
|
||||
## Per-controller overrides. Each defaults to defaultMaxConcurrentReconciles when unset.
|
||||
# autoscalingRunnerSetMaxConcurrentReconciles: 1
|
||||
# autoscalingListenerMaxConcurrentReconciles: 1
|
||||
# ephemeralRunnerSetMaxConcurrentReconciles: 1
|
||||
# ephemeralRunnerMaxConcurrentReconciles: 1
|
||||
|
||||
## Defines a list of prefixes that should not be propagated to internal resources.
|
||||
## This is useful when you have labels that are used for internal purposes and should not be propagated to internal resources.
|
||||
|
||||
@@ -10,9 +10,25 @@ import (
|
||||
// Options is the optional configuration for the controllers, which can be
|
||||
// set via command-line flags or environment variables.
|
||||
type Options struct {
|
||||
// RunnerMaxConcurrentReconciles is the maximum number of concurrent Reconciles which can be run
|
||||
// by the EphemeralRunnerController.
|
||||
RunnerMaxConcurrentReconciles int
|
||||
// DefaultMaxConcurrentReconciles is the maximum number of concurrent Reconciles
|
||||
// applied to every controller that does not have its own value set below.
|
||||
DefaultMaxConcurrentReconciles int
|
||||
|
||||
// AutoscalingRunnerSetMaxConcurrentReconciles is the maximum number of concurrent Reconciles
|
||||
// which can be run by the AutoscalingRunnerSetController. Zero means DefaultMaxConcurrentReconciles.
|
||||
AutoscalingRunnerSetMaxConcurrentReconciles int
|
||||
|
||||
// AutoscalingListenerMaxConcurrentReconciles is the maximum number of concurrent Reconciles
|
||||
// which can be run by the AutoscalingListenerController. Zero means DefaultMaxConcurrentReconciles.
|
||||
AutoscalingListenerMaxConcurrentReconciles int
|
||||
|
||||
// EphemeralRunnerSetMaxConcurrentReconciles is the maximum number of concurrent Reconciles
|
||||
// which can be run by the EphemeralRunnerSetController. Zero means DefaultMaxConcurrentReconciles.
|
||||
EphemeralRunnerSetMaxConcurrentReconciles int
|
||||
|
||||
// EphemeralRunnerMaxConcurrentReconciles is the maximum number of concurrent Reconciles
|
||||
// which can be run by the EphemeralRunnerController. Zero means DefaultMaxConcurrentReconciles.
|
||||
EphemeralRunnerMaxConcurrentReconciles int
|
||||
}
|
||||
|
||||
// OptionsWithDefault returns the default options.
|
||||
@@ -20,10 +36,31 @@ type Options struct {
|
||||
// rather than having to correlate those in multiple places.
|
||||
func OptionsWithDefault() Options {
|
||||
return Options{
|
||||
RunnerMaxConcurrentReconciles: 2,
|
||||
DefaultMaxConcurrentReconciles: 1,
|
||||
}
|
||||
}
|
||||
|
||||
// Resolve returns a copy of the options where a DefaultMaxConcurrentReconciles
|
||||
// of zero or less is replaced by 1, and every per-controller
|
||||
// MaxConcurrentReconciles that is left at zero is replaced by
|
||||
// DefaultMaxConcurrentReconciles.
|
||||
func (o Options) Resolve() Options {
|
||||
if o.DefaultMaxConcurrentReconciles <= 0 {
|
||||
o.DefaultMaxConcurrentReconciles = 1
|
||||
}
|
||||
orDefault := func(n int) int {
|
||||
if n > 0 {
|
||||
return n
|
||||
}
|
||||
return o.DefaultMaxConcurrentReconciles
|
||||
}
|
||||
o.AutoscalingRunnerSetMaxConcurrentReconciles = orDefault(o.AutoscalingRunnerSetMaxConcurrentReconciles)
|
||||
o.AutoscalingListenerMaxConcurrentReconciles = orDefault(o.AutoscalingListenerMaxConcurrentReconciles)
|
||||
o.EphemeralRunnerSetMaxConcurrentReconciles = orDefault(o.EphemeralRunnerSetMaxConcurrentReconciles)
|
||||
o.EphemeralRunnerMaxConcurrentReconciles = orDefault(o.EphemeralRunnerMaxConcurrentReconciles)
|
||||
return o
|
||||
}
|
||||
|
||||
type Option func(*controller.Options)
|
||||
|
||||
// WithMaxConcurrentReconciles sets the maximum number of concurrent Reconciles which can be run.
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
package actionsgithubcom
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
)
|
||||
|
||||
func TestOptionsResolve(t *testing.T) {
|
||||
t.Parallel()
|
||||
|
||||
t.Run("unset per-controller values fall back to the default", func(t *testing.T) {
|
||||
got := OptionsWithDefault().Resolve()
|
||||
assert.Equal(t, 1, got.DefaultMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.AutoscalingRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.AutoscalingListenerMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.EphemeralRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.EphemeralRunnerMaxConcurrentReconciles)
|
||||
})
|
||||
|
||||
t.Run("a default of zero or less is replaced by 1", func(t *testing.T) {
|
||||
for _, n := range []int{0, -1} {
|
||||
opts := Options{DefaultMaxConcurrentReconciles: n}
|
||||
got := opts.Resolve()
|
||||
assert.Equal(t, 1, got.DefaultMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.AutoscalingRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.AutoscalingListenerMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.EphemeralRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 1, got.EphemeralRunnerMaxConcurrentReconciles)
|
||||
}
|
||||
})
|
||||
|
||||
t.Run("a changed default applies to every unset controller", func(t *testing.T) {
|
||||
opts := OptionsWithDefault()
|
||||
opts.DefaultMaxConcurrentReconciles = 4
|
||||
opts.EphemeralRunnerMaxConcurrentReconciles = 20
|
||||
got := opts.Resolve()
|
||||
assert.Equal(t, 4, got.AutoscalingRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 4, got.AutoscalingListenerMaxConcurrentReconciles)
|
||||
assert.Equal(t, 4, got.EphemeralRunnerSetMaxConcurrentReconciles)
|
||||
assert.Equal(t, 20, got.EphemeralRunnerMaxConcurrentReconciles)
|
||||
})
|
||||
}
|
||||
@@ -151,7 +151,11 @@ func main() {
|
||||
flag.DurationVar(&defaultScaleDownDelay, "default-scale-down-delay", actionssummerwindnet.DefaultScaleDownDelay, "The approximate delay for a scale down followed by a scale up, used to prevent flapping (down->up->down->... loop)")
|
||||
flag.IntVar(&port, "port", 9443, "The port to which the admission webhook endpoint should bind")
|
||||
flag.DurationVar(&syncPeriod, "sync-period", 1*time.Minute, "Determines the minimum frequency at which K8s resources managed by this controller are reconciled.")
|
||||
flag.IntVar(&opts.RunnerMaxConcurrentReconciles, "runner-max-concurrent-reconciles", opts.RunnerMaxConcurrentReconciles, "The maximum number of concurrent reconciles which can be run by the EphemeralRunner controller. Increase this value to improve the throughput of the controller, but it may also increase the load on the API server and the external service (e.g. GitHub API).")
|
||||
flag.IntVar(&opts.DefaultMaxConcurrentReconciles, "default-max-concurrent-reconciles", opts.DefaultMaxConcurrentReconciles, "The maximum number of concurrent reconciles applied to every controller that does not set its own --<controller>-max-concurrent-reconciles flag. Increase this value to improve the throughput of the controller, but it may also increase the load on the API server and the external service (e.g. GitHub API).")
|
||||
flag.IntVar(&opts.AutoscalingRunnerSetMaxConcurrentReconciles, "autoscaling-runner-set-max-concurrent-reconciles", 0, "The maximum number of concurrent reconciles which can be run by the AutoscalingRunnerSet controller. Defaults to --default-max-concurrent-reconciles.")
|
||||
flag.IntVar(&opts.AutoscalingListenerMaxConcurrentReconciles, "autoscaling-listener-max-concurrent-reconciles", 0, "The maximum number of concurrent reconciles which can be run by the AutoscalingListener controller. Defaults to --default-max-concurrent-reconciles.")
|
||||
flag.IntVar(&opts.EphemeralRunnerSetMaxConcurrentReconciles, "ephemeral-runner-set-max-concurrent-reconciles", 0, "The maximum number of concurrent reconciles which can be run by the EphemeralRunnerSet controller. Defaults to --default-max-concurrent-reconciles.")
|
||||
flag.IntVar(&opts.EphemeralRunnerMaxConcurrentReconciles, "ephemeral-runner-max-concurrent-reconciles", 0, "The maximum number of concurrent reconciles which can be run by the EphemeralRunner controller. Defaults to --default-max-concurrent-reconciles.")
|
||||
flag.Var(&commonRunnerLabels, "common-runner-labels", "Runner labels in the K1=V1,K2=V2,... format that are inherited all the runners created by the controller. See https://github.com/actions/actions-runner-controller/issues/321 for more information")
|
||||
flag.StringVar(&namespace, "watch-namespace", "", "The namespace to watch for custom resources. Set to empty for letting it watch for all namespaces.")
|
||||
flag.StringVar(&watchSingleNamespace, "watch-single-namespace", "", "Restrict to watch for custom resources in a single namespace.")
|
||||
@@ -165,6 +169,7 @@ func main() {
|
||||
flag.StringVar(&workqueueRateLimiter, "workqueue-rate-limiter", "", `The workqueue rate limiter to use. Valid values are "bucket_rate_limiter" (default) and "typed_rate_limiter" (per-item only, no global token bucket).`)
|
||||
flag.Parse()
|
||||
|
||||
opts = opts.Resolve()
|
||||
runnerPodDefaults.RunnerImagePullSecrets = runnerImagePullSecrets
|
||||
|
||||
log, err := logging.NewLogger(logLevel, logFormat)
|
||||
@@ -174,7 +179,13 @@ func main() {
|
||||
}
|
||||
c.Log = &log
|
||||
|
||||
log.Info("Using options", "runner-max-concurrent-reconciles", opts.RunnerMaxConcurrentReconciles)
|
||||
log.Info("Using options",
|
||||
"default-max-concurrent-reconciles", opts.DefaultMaxConcurrentReconciles,
|
||||
"autoscaling-runner-set-max-concurrent-reconciles", opts.AutoscalingRunnerSetMaxConcurrentReconciles,
|
||||
"autoscaling-listener-max-concurrent-reconciles", opts.AutoscalingListenerMaxConcurrentReconciles,
|
||||
"ephemeral-runner-set-max-concurrent-reconciles", opts.EphemeralRunnerSetMaxConcurrentReconciles,
|
||||
"ephemeral-runner-max-concurrent-reconciles", opts.EphemeralRunnerMaxConcurrentReconciles,
|
||||
)
|
||||
|
||||
if !autoScalingRunnerSetOnly {
|
||||
ghClient, err = c.NewClient()
|
||||
@@ -324,6 +335,7 @@ func main() {
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
autoscalingRunnerSetOpts := append(controllerOpts, actionsgithubcom.WithMaxConcurrentReconciles(opts.AutoscalingRunnerSetMaxConcurrentReconciles))
|
||||
if err = (&actionsgithubcom.AutoscalingRunnerSetReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: log.WithName("AutoscalingRunnerSet").WithValues("version", build.Version),
|
||||
@@ -332,33 +344,35 @@ func main() {
|
||||
DefaultRunnerScaleSetListenerImage: managerImage,
|
||||
DefaultRunnerScaleSetListenerImagePullSecrets: autoScalerImagePullSecrets,
|
||||
ResourceBuilder: rb,
|
||||
}).SetupWithManager(mgr, controllerOpts...); err != nil {
|
||||
}).SetupWithManager(mgr, autoscalingRunnerSetOpts...); err != nil {
|
||||
log.Error(err, "unable to create controller", "controller", "AutoscalingRunnerSet")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
runnerOpts := append(controllerOpts, actionsgithubcom.WithMaxConcurrentReconciles(opts.RunnerMaxConcurrentReconciles))
|
||||
ephemeralRunnerOpts := append(controllerOpts, actionsgithubcom.WithMaxConcurrentReconciles(opts.EphemeralRunnerMaxConcurrentReconciles))
|
||||
if err = (&actionsgithubcom.EphemeralRunnerReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: log.WithName("EphemeralRunner").WithValues("version", build.Version),
|
||||
Scheme: mgr.GetScheme(),
|
||||
PublishMetrics: metricsAddr != "0",
|
||||
ResourceBuilder: rb,
|
||||
}).SetupWithManager(mgr, runnerOpts...); err != nil {
|
||||
}).SetupWithManager(mgr, ephemeralRunnerOpts...); err != nil {
|
||||
log.Error(err, "unable to create controller", "controller", "EphemeralRunner")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
ephemeralRunnerSetOpts := append(controllerOpts, actionsgithubcom.WithMaxConcurrentReconciles(opts.EphemeralRunnerSetMaxConcurrentReconciles))
|
||||
if err = (&actionsgithubcom.EphemeralRunnerSetReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: log.WithName("EphemeralRunnerSet").WithValues("version", build.Version),
|
||||
Scheme: mgr.GetScheme(),
|
||||
ResourceBuilder: rb,
|
||||
}).SetupWithManager(mgr, controllerOpts...); err != nil {
|
||||
}).SetupWithManager(mgr, ephemeralRunnerSetOpts...); err != nil {
|
||||
log.Error(err, "unable to create controller", "controller", "EphemeralRunnerSet")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
autoscalingListenerOpts := append(controllerOpts, actionsgithubcom.WithMaxConcurrentReconciles(opts.AutoscalingListenerMaxConcurrentReconciles))
|
||||
if err = (&actionsgithubcom.AutoscalingListenerReconciler{
|
||||
Client: mgr.GetClient(),
|
||||
Log: log.WithName("AutoscalingListener").WithValues("version", build.Version),
|
||||
@@ -366,7 +380,7 @@ func main() {
|
||||
ListenerMetricsAddr: listenerMetricsAddr,
|
||||
ListenerMetricsEndpoint: listenerMetricsEndpoint,
|
||||
ResourceBuilder: rb,
|
||||
}).SetupWithManager(mgr, controllerOpts...); err != nil {
|
||||
}).SetupWithManager(mgr, autoscalingListenerOpts...); err != nil {
|
||||
log.Error(err, "unable to create controller", "controller", "AutoscalingListener")
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user