Commit a8d7189e authored by Edmund Ochieng's avatar Edmund Ochieng

expose autoscaling option in GitLab spec

parent 3c2ef50b
......@@ -33,7 +33,8 @@ type GitLabSpec struct {
Database *DatabaseSpec `json:"postgres,omitempty"`
CertIssuer *ACMEOptions `json:"acme,omitempty"`
// Volume for Gitaly statefulset
Volume VolumeSpec `json:"volume,omitempty"`
Volume VolumeSpec `json:"volume,omitempty"`
AutoScaling *AutoScalingSpec `json:"autoscaling,omitempty"`
}
// RedisSpec defines Redis options
......@@ -108,6 +109,16 @@ type SMTPConfiguration struct {
DisplayName string `json:"displayName,omitempty"`
}
// AutoScalingSpec are the parameters to configure autoscaling
type AutoScalingSpec struct {
// MinReplicas is the lower limit to scale down to
MinReplicas *int32 `json:"minReplicas,omitempty"`
// MaxReplicas is the upper limit to scale up to
MaxReplicas int32 `json:"maxReplicas,omitempty"`
// TargetCPU is the CPU utilization threshold percentage
TargetCPU *int32 `json:"targetCPU,omitempty"`
}
// ACMEOptions defines the values for the
// ACME service that will provide certificates
type ACMEOptions struct {
......
......@@ -52,6 +52,31 @@ func (in *ACMEOptions) DeepCopy() *ACMEOptions {
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *AutoScalingSpec) DeepCopyInto(out *AutoScalingSpec) {
*out = *in
if in.MinReplicas != nil {
in, out := &in.MinReplicas, &out.MinReplicas
*out = new(int32)
**out = **in
}
if in.TargetCPU != nil {
in, out := &in.TargetCPU, &out.TargetCPU
*out = new(int32)
**out = **in
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new AutoScalingSpec.
func (in *AutoScalingSpec) DeepCopy() *AutoScalingSpec {
if in == nil {
return nil
}
out := new(AutoScalingSpec)
in.DeepCopyInto(out)
return out
}
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *DatabaseSpec) DeepCopyInto(out *DatabaseSpec) {
*out = *in
......@@ -238,7 +263,11 @@ func (in *GitLabSpec) DeepCopyInto(out *GitLabSpec) {
(*in).DeepCopyInto(*out)
}
out.Volume = in.Volume
in.AutoScaling.DeepCopyInto(&out.AutoScaling)
if in.AutoScaling != nil {
in, out := &in.AutoScaling, &out.AutoScaling
*out = new(AutoScalingSpec)
(*in).DeepCopyInto(*out)
}
}
// DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new GitLabSpec.
......
......@@ -1538,6 +1538,22 @@ spec:
type: object
type: array
type: object
autoscaling:
description: AutoScalingSpec are the parameters to configure autoscaling
properties:
maxReplicas:
description: MaxReplicas is the upper limit to scale up to
format: int32
type: integer
minReplicas:
description: MinReplicas is the lower limit to scale down to
format: int32
type: integer
targetCPU:
description: TargetCPU is the CPU utilization threshold percentage
format: int32
type: integer
type: object
objectStore:
description: ObjectStoreSpec defines options for Gitlab registry
properties:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment