mirror of
https://github.com/actions-runner-controller/actions-runner-controller.git
synced 2026-09-30 06:11:37 +02:00
Set listener qps and burst (#4558)
This commit is contained in:
@@ -82,6 +82,9 @@ type AutoscalingListenerSpec struct {
|
||||
|
||||
// +optional
|
||||
RoleBindingMetadata *ResourceMeta `json:"roleBindingMetadata,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerConfig *ListenerConfig `json:"listenerConfig,omitempty"`
|
||||
}
|
||||
|
||||
func (s *AutoscalingListenerSpec) Hash() string {
|
||||
|
||||
@@ -121,6 +121,9 @@ type AutoscalingRunnerSetSpec struct {
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum:=0
|
||||
MinRunners *int `json:"minRunners,omitempty"`
|
||||
|
||||
// +optional
|
||||
ListenerConfig *ListenerConfig `json:"listenerConfig,omitempty"`
|
||||
}
|
||||
|
||||
type TLSConfig struct {
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
package v1alpha1
|
||||
|
||||
// ListenerConfig holds configuration for the ghalistener pod.
|
||||
type ListenerConfig struct {
|
||||
// +optional
|
||||
Scaler *ScalerConfig `json:"scaler,omitempty"`
|
||||
}
|
||||
|
||||
// GetScaler returns the ScalerConfig, or nil if not set.
|
||||
func (c *ListenerConfig) GetScaler() *ScalerConfig {
|
||||
if c == nil {
|
||||
return nil
|
||||
}
|
||||
return c.Scaler
|
||||
}
|
||||
|
||||
// ScalerConfig configures the Kubernetes client used by the ghalistener scaler.
|
||||
type ScalerConfig struct {
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum:=1
|
||||
QPS *int `json:"qps,omitempty"`
|
||||
|
||||
// +optional
|
||||
// +kubebuilder:validation:Minimum:=1
|
||||
Burst *int `json:"burst,omitempty"`
|
||||
}
|
||||
@@ -138,6 +138,11 @@ func (in *AutoscalingListenerSpec) DeepCopyInto(out *AutoscalingListenerSpec) {
|
||||
*out = new(ResourceMeta)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.ListenerConfig != nil {
|
||||
in, out := &in.ListenerConfig, &out.ListenerConfig
|
||||
*out = new(ListenerConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingListenerSpec.
|
||||
@@ -308,6 +313,11 @@ func (in *AutoscalingRunnerSetSpec) DeepCopyInto(out *AutoscalingRunnerSetSpec)
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.ListenerConfig != nil {
|
||||
in, out := &in.ListenerConfig, &out.ListenerConfig
|
||||
*out = new(ListenerConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoscalingRunnerSetSpec.
|
||||
@@ -627,6 +637,26 @@ func (in *HistogramMetric) DeepCopy() *HistogramMetric {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ListenerConfig) DeepCopyInto(out *ListenerConfig) {
|
||||
*out = *in
|
||||
if in.Scaler != nil {
|
||||
in, out := &in.Scaler, &out.Scaler
|
||||
*out = new(ScalerConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ListenerConfig.
|
||||
func (in *ListenerConfig) DeepCopy() *ListenerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ListenerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *MetricsConfig) DeepCopyInto(out *MetricsConfig) {
|
||||
*out = *in
|
||||
@@ -764,6 +794,31 @@ func (in *ResourceMeta) DeepCopy() *ResourceMeta {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *ScalerConfig) DeepCopyInto(out *ScalerConfig) {
|
||||
*out = *in
|
||||
if in.QPS != nil {
|
||||
in, out := &in.QPS, &out.QPS
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
if in.Burst != nil {
|
||||
in, out := &in.Burst, &out.Burst
|
||||
*out = new(int)
|
||||
**out = **in
|
||||
}
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ScalerConfig.
|
||||
func (in *ScalerConfig) DeepCopy() *ScalerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(ScalerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *TLSCertificateSource) DeepCopyInto(out *TLSCertificateSource) {
|
||||
*out = *in
|
||||
|
||||
Reference in New Issue
Block a user