diff --git a/pkg/apis/common/v1/types.go b/pkg/apis/common/v1/types.go index 0b894b26..6cb97c75 100644 --- a/pkg/apis/common/v1/types.go +++ b/pkg/apis/common/v1/types.go @@ -69,8 +69,17 @@ type ReplicaStatus struct { type ReplicaSpec struct { // Replicas is the desired number of replicas of the given template. // If unspecified, defaults to 1. + // +optional Replicas *int32 `json:"replicas,omitempty"` + // minReplicas is the lower limit for the number of replicas to which the training job + // can scale down. It defaults to nil. + // +optional + MinReplicas *int32 `json:"minReplicas,omitempty"` + // upper limit for the number of pods that can be set by the autoscaler; cannot be smaller than MinReplicas, defaults to nil. + // +optional + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + // Template is the object that describes the pod that // will be created for this replica. RestartPolicy in PodTemplateSpec // will be overide by RestartPolicy in ReplicaSpec diff --git a/pkg/apis/common/v1/zz_generated.deepcopy.go b/pkg/apis/common/v1/zz_generated.deepcopy.go index 3d76bf20..4452b2f0 100644 --- a/pkg/apis/common/v1/zz_generated.deepcopy.go +++ b/pkg/apis/common/v1/zz_generated.deepcopy.go @@ -99,6 +99,16 @@ func (in *ReplicaSpec) DeepCopyInto(out *ReplicaSpec) { *out = new(int32) **out = **in } + if in.MinReplicas != nil { + in, out := &in.MinReplicas, &out.MinReplicas + *out = new(int32) + **out = **in + } + if in.MaxReplicas != nil { + in, out := &in.MaxReplicas, &out.MaxReplicas + *out = new(int32) + **out = **in + } in.Template.DeepCopyInto(&out.Template) return }