Skip to content

Commit c2a1222

Browse files
authored
introduced scheduler-api, modified PodGangSet API, re-generated code and client (#25)
Signed-off-by: Madhav Bhargava <madhav.bhargava@sap.com>
1 parent 488d8e7 commit c2a1222

File tree

36 files changed

+1575
-1007
lines changed

36 files changed

+1575
-1007
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ operator/hack/tools/*
3434
operator/hack/kind/*
3535
operator/charts/crds/*
3636
scheduler-plugins/hack/tools/*
37+
scheduler-api/hack/tools/*
3738

3839
# binary directory for locally produced dev scheduler binaries
3940
operator/bin/*
4041
scheduler-plugins/bin/*
42+
scheduler-api/bin/*

operator/api/core/crds/embed.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ var (
99
podGangSetCRD string
1010
)
1111

12-
// PodCliqueCRD returns the embedded PodClique CRD
12+
// PodCliqueCRD returns the PodClique CRD
1313
func PodCliqueCRD() string {
1414
return podCliqueCRD
1515
}
1616

17-
// PodGangSetCRD returns the embedded PodGangSet CRD
17+
// PodGangSetCRD returns the PodGangSet CRD
1818
func PodGangSetCRD() string {
1919
return podGangSetCRD
2020
}

operator/api/core/crds/grove.io_podcliques.yaml

Lines changed: 256 additions & 270 deletions
Large diffs are not rendered by default.

operator/api/core/crds/grove.io_podgangsets.yaml

Lines changed: 266 additions & 318 deletions
Large diffs are not rendered by default.

operator/api/core/v1alpha1/podclique.go

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,6 @@ type PodCliqueSpec struct {
3939
Spec corev1.PodSpec `json:"spec"`
4040
// Replicas is the number of replicas of the pods in the clique.
4141
Replicas int32 `json:"replicas"`
42-
// MinAvailable is the minimum number of pods that must be available at any given time.
43-
// If it is not specified then it will be defaulted to spec.Replicas for the PodClique.
44-
// +optional
45-
MinAvailable *int32 `json:"minAvailable"`
4642
// StartsAfter provides you a way to explicitly define the startup dependencies amongst cliques.
4743
// If CliqueStartupType in PodGang has been set to 'CliqueStartupTypeExplicit', then to create an ordered start amongst PorClique's StartsAfter can be used.
4844
// A forest of DAG's can be defined to model any start order dependencies. If there are more than one PodClique's defined and StartsAfter is not set for any of them,
@@ -52,9 +48,32 @@ type PodCliqueSpec struct {
5248
// 2. If StartsAfter is defined and does not identify any PodClique then it will be flagged as a validation error.
5349
// +optional
5450
StartsAfter []string `json:"startsAfter,omitempty"`
55-
// HPAConfig is the horizontal pod autoscaler configuration for a PodClique.
51+
// ScaleConfig is the horizontal pod autoscaler configuration for a PodClique.
52+
// +optional
53+
ScaleConfig *AutoScalingConfig `json:"autoScalingConfig,omitempty"`
54+
}
55+
56+
// AutoScalingConfig defines the configuration for the horizontal pod autoscaler for a PodClique.
57+
type AutoScalingConfig struct {
58+
// minReplicas is the lower limit for the number of replicas to which the autoscaler
59+
// can scale down. It defaults to 1 pod. minReplicas is not allowed to be 0.
60+
// Scaling is active as long as at least one metric value is available.
61+
// +optional
62+
MinReplicas *int32 `json:"minReplicas,omitempty"`
63+
// maxReplicas is the upper limit for the number of replicas to which the autoscaler can scale up.
64+
// It cannot be less that minReplicas.
65+
MaxReplicas int32 `json:"maxReplicas"`
66+
// Metrics contains the specifications for which to use to calculate the
67+
// desired replica count (the maximum replica count across all metrics will
68+
// be used). The desired replica count is calculated multiplying the
69+
// ratio between the target value and the current value by the current
70+
// number of pods. Ergo, metrics used must decrease as the pod count is
71+
// increased, and vice versa. See the individual metric source types for
72+
// more information about how each type of metric must respond.
73+
// If not set, the default metric will be set to 80% average CPU utilization.
74+
// +listType=atomic
5675
// +optional
57-
HPAConfig *autoscalingv2.HorizontalPodAutoscalerSpec `json:"hpaConfig,omitempty"`
76+
Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty" protobuf:"bytes,4,rep,name=metrics"`
5877
}
5978

6079
// PodCliqueStatus defines the status of a PodClique.

operator/api/core/v1alpha1/podgangset.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ import (
1313
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.hpaPodSelector
1414
// +kubebuilder:resource:shortName={pgs}
1515

16-
// PodGangSet is a set of PodGangs defining specification on how to spread and manage PodGangs and monitoring their status.
16+
// PodGangSet is a set of PodGangs defining specification on how to spread and manage a gang of pods and monitoring their status.
1717
type PodGangSet struct {
1818
metav1.TypeMeta `json:",inline"`
1919
metav1.ObjectMeta `json:",inline"`
2020
// Spec defines the specification of the PodGangSet.
2121
Spec PodGangSetSpec `json:"spec"`
2222
// Status defines the status of the PodGangSet.
23-
Status PodGangSetStatus `json:"status"`
23+
Status PodGangSetStatus `json:"status,omitempty"`
2424
}
2525

2626
// +kubebuilder:object:root=true

operator/api/core/v1alpha1/zz_generated.deepcopy.go

Lines changed: 31 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/charts/templates/pgs-validating-webhook-config.yaml

Whitespace-only changes.

operator/client/clientset/versioned/clientset.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

operator/client/clientset/versioned/typed/core/v1alpha1/core_client.go

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)