mirror of
https://github.com/fluxcd/flagger.git
synced 2026-04-15 06:57:34 +00:00
feat: Copy slowStartConfig for Gloo upstreams
Signed-off-by: Nick Caballero <nick.caballero@offerup.com>
This commit is contained in:
@@ -22,6 +22,7 @@ type UpstreamSpec struct {
|
||||
SslConfig *UpstreamSslConfig `json:"sslConfig,omitempty"`
|
||||
CircuitBreakers *CircuitBreakerConfig `json:"circuitBreakers,omitempty"`
|
||||
ConnectionConfig *ConnectionConfig `json:"connectionConfig,omitempty"`
|
||||
LoadBalancerConfig *LoadBalancerConfig `json:"loadBalancerConfig,omitempty"`
|
||||
UseHttp2 bool `json:"useHttp2,omitempty"`
|
||||
InitialStreamWindowSize uint32 `json:"initialStreamWindowSize,omitempty"`
|
||||
InitialConnectionWindowSize uint32 `json:"initialConnectionWindowSize,omitempty"`
|
||||
@@ -109,6 +110,26 @@ type ConnectionConfig_HttpProtocolOptions struct {
|
||||
HeadersWithUnderscoresAction uint32 `json:"headersWithUnderscoresAction,omitempty"`
|
||||
}
|
||||
|
||||
type LoadBalancerConfig struct {
|
||||
RoundRobin *LoadBalancerConfigRoundRobin `json:"roundRobin,omitempty"`
|
||||
LeastRequest *LoadBalancerConfigLeastRequest `json:"leastRequest,omitempty"`
|
||||
}
|
||||
|
||||
type LoadBalancerConfigRoundRobin struct {
|
||||
SlowStartConfig *SlowStartConfig `json:"slowStartConfig,omitempty"`
|
||||
}
|
||||
|
||||
type LoadBalancerConfigLeastRequest struct {
|
||||
SlowStartConfig *SlowStartConfig `json:"slowStartConfig,omitempty"`
|
||||
ChoiceCount uint32 `json:"choiceCount,omitempty"`
|
||||
}
|
||||
|
||||
type SlowStartConfig struct {
|
||||
SlowStartWindow string `json:"slowStartWindow,omitempty"`
|
||||
Aggression float64 `json:"aggression,omitempty"`
|
||||
MinWeightPercent float64 `json:"minWeightPercent,omitempty"`
|
||||
}
|
||||
|
||||
type Duration struct {
|
||||
Seconds int64 `json:"seconds,omitempty"`
|
||||
Nanos int32 `json:"nanos,omitempty"`
|
||||
|
||||
@@ -201,6 +201,90 @@ func (in *KubeUpstream) DeepCopy() *KubeUpstream {
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LoadBalancerConfig) DeepCopyInto(out *LoadBalancerConfig) {
|
||||
*out = *in
|
||||
if in.RoundRobin != nil {
|
||||
in, out := &in.RoundRobin, &out.RoundRobin
|
||||
*out = new(LoadBalancerConfigRoundRobin)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.LeastRequest != nil {
|
||||
in, out := &in.LeastRequest, &out.LeastRequest
|
||||
*out = new(LoadBalancerConfigLeastRequest)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerConfig.
|
||||
func (in *LoadBalancerConfig) DeepCopy() *LoadBalancerConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LoadBalancerConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LoadBalancerConfigLeastRequest) DeepCopyInto(out *LoadBalancerConfigLeastRequest) {
|
||||
*out = *in
|
||||
if in.SlowStartConfig != nil {
|
||||
in, out := &in.SlowStartConfig, &out.SlowStartConfig
|
||||
*out = new(SlowStartConfig)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerConfigLeastRequest.
|
||||
func (in *LoadBalancerConfigLeastRequest) DeepCopy() *LoadBalancerConfigLeastRequest {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LoadBalancerConfigLeastRequest)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *LoadBalancerConfigRoundRobin) DeepCopyInto(out *LoadBalancerConfigRoundRobin) {
|
||||
*out = *in
|
||||
if in.SlowStartConfig != nil {
|
||||
in, out := &in.SlowStartConfig, &out.SlowStartConfig
|
||||
*out = new(SlowStartConfig)
|
||||
**out = **in
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LoadBalancerConfigRoundRobin.
|
||||
func (in *LoadBalancerConfigRoundRobin) DeepCopy() *LoadBalancerConfigRoundRobin {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(LoadBalancerConfigRoundRobin)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SlowStartConfig) DeepCopyInto(out *SlowStartConfig) {
|
||||
*out = *in
|
||||
return
|
||||
}
|
||||
|
||||
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SlowStartConfig.
|
||||
func (in *SlowStartConfig) DeepCopy() *SlowStartConfig {
|
||||
if in == nil {
|
||||
return nil
|
||||
}
|
||||
out := new(SlowStartConfig)
|
||||
in.DeepCopyInto(out)
|
||||
return out
|
||||
}
|
||||
|
||||
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
|
||||
func (in *SslParameters) DeepCopyInto(out *SslParameters) {
|
||||
*out = *in
|
||||
@@ -317,6 +401,11 @@ func (in *UpstreamSpec) DeepCopyInto(out *UpstreamSpec) {
|
||||
*out = new(ConnectionConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
if in.LoadBalancerConfig != nil {
|
||||
in, out := &in.LoadBalancerConfig, &out.LoadBalancerConfig
|
||||
*out = new(LoadBalancerConfig)
|
||||
(*in).DeepCopyInto(*out)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
@@ -302,6 +302,7 @@ func (gr *GlooRouter) getGlooUpstreamKubeService(canary *flaggerv1.Canary, svc *
|
||||
SslConfig: configSpec.SslConfig,
|
||||
CircuitBreakers: configSpec.CircuitBreakers,
|
||||
ConnectionConfig: configSpec.ConnectionConfig,
|
||||
LoadBalancerConfig: configSpec.LoadBalancerConfig,
|
||||
UseHttp2: configSpec.UseHttp2,
|
||||
InitialStreamWindowSize: configSpec.InitialStreamWindowSize,
|
||||
InitialConnectionWindowSize: configSpec.InitialConnectionWindowSize,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
set -o errexit
|
||||
|
||||
GLOO_VER="1.12.31"
|
||||
GLOO_VER="1.14.10"
|
||||
REPO_ROOT=$(git rev-parse --show-toplevel)
|
||||
|
||||
mkdir -p ${REPO_ROOT}/bin
|
||||
|
||||
@@ -40,6 +40,11 @@ spec:
|
||||
port: 80
|
||||
connectionConfig:
|
||||
maxRequestsPerConnection: 51
|
||||
loadBalancerConfig:
|
||||
roundRobin:
|
||||
slowStartConfig:
|
||||
slowStartWindow: 2m
|
||||
minWeightPercent: 5
|
||||
EOF
|
||||
|
||||
cat <<EOF | kubectl apply -f -
|
||||
|
||||
Reference in New Issue
Block a user