Skip to content

Commit 7ec54a6

Browse files
committed
fix: add scaling adapter
Signed-off-by: Julien Mancuso <[email protected]>
1 parent a66579a commit 7ec54a6

16 files changed

+2523
-28
lines changed

deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml

Lines changed: 596 additions & 0 deletions
Large diffs are not rendered by default.

deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml

Lines changed: 596 additions & 0 deletions
Large diffs are not rendered by default.

deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeploymentscalingadapters.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ spec:
3838
name: DGD
3939
type: string
4040
- description: Service name
41-
jsonPath: .spec.dgdRef.service
41+
jsonPath: .spec.dgdRef.serviceName
4242
name: SERVICE
4343
type: string
4444
- description: Current replicas
@@ -87,13 +87,13 @@ spec:
8787
description: Name of the DynamoGraphDeployment
8888
minLength: 1
8989
type: string
90-
service:
91-
description: Service is the key name of the service within the DGD's spec.services map to scale
90+
serviceName:
91+
description: ServiceName is the key name of the service within the DGD's spec.services map to scale
9292
minLength: 1
9393
type: string
9494
required:
9595
- name
96-
- service
96+
- serviceName
9797
type: object
9898
replicas:
9999
description: |-

deploy/cloud/operator/api/v1alpha1/common.go

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
package v1alpha1
1919

2020
import (
21+
autoscalingv2 "k8s.io/api/autoscaling/v2"
2122
corev1 "k8s.io/api/core/v1"
2223
"k8s.io/apimachinery/pkg/api/resource"
2324
)
@@ -52,6 +53,22 @@ type VolumeMount struct {
5253
UseAsCompilationCache bool `json:"useAsCompilationCache,omitempty"`
5354
}
5455

56+
// Deprecated: This field is deprecated and ignored. Use DynamoGraphDeploymentScalingAdapter
57+
// with HPA, KEDA, or Planner for autoscaling instead. See docs/kubernetes/autoscaling.md
58+
// for migration guidance. This field will be removed in a future API version.
59+
type Autoscaling struct {
60+
// Deprecated: This field is ignored.
61+
Enabled bool `json:"enabled,omitempty"`
62+
// Deprecated: This field is ignored.
63+
MinReplicas int `json:"minReplicas,omitempty"`
64+
// Deprecated: This field is ignored.
65+
MaxReplicas int `json:"maxReplicas,omitempty"`
66+
// Deprecated: This field is ignored.
67+
Behavior *autoscalingv2.HorizontalPodAutoscalerBehavior `json:"behavior,omitempty"`
68+
// Deprecated: This field is ignored.
69+
Metrics []autoscalingv2.MetricSpec `json:"metrics,omitempty"`
70+
}
71+
5572
type SharedMemorySpec struct {
5673
Disabled bool `json:"disabled,omitempty"`
5774
Size resource.Quantity `json:"size,omitempty"`

deploy/cloud/operator/api/v1alpha1/dynamocomponentdeployment_types.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,10 @@ type DynamoComponentDeploymentSharedSpec struct {
7474
// Resources requested and limits for this component, including CPU, memory,
7575
// GPUs/devices, and any runtime-specific resources.
7676
Resources *Resources `json:"resources,omitempty"`
77+
// Deprecated: This field is deprecated and ignored. Use DynamoGraphDeploymentScalingAdapter
78+
// with HPA, KEDA, or Planner for autoscaling instead. See docs/kubernetes/autoscaling.md
79+
// for migration guidance. This field will be removed in a future API version.
80+
Autoscaling *Autoscaling `json:"autoscaling,omitempty"`
7781
// Envs defines additional environment variables to inject into the component containers.
7882
Envs []corev1.EnvVar `json:"envs,omitempty"`
7983
// EnvFromSecret references a Secret whose key/value pairs will be exposed as

deploy/cloud/operator/api/v1alpha1/dynamographdeploymentscalingadapter_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ type DynamoGraphDeploymentServiceRef struct {
4141
// +kubebuilder:validation:MinLength=1
4242
Name string `json:"name"`
4343

44-
// Service is the key name of the service within the DGD's spec.services map to scale
44+
// ServiceName is the key name of the service within the DGD's spec.services map to scale
4545
// +kubebuilder:validation:Required
4646
// +kubebuilder:validation:MinLength=1
47-
Service string `json:"service"`
47+
ServiceName string `json:"serviceName"`
4848
}
4949

5050
// DynamoGraphDeploymentScalingAdapterStatus defines the observed state of DynamoGraphDeploymentScalingAdapter
@@ -68,7 +68,7 @@ type DynamoGraphDeploymentScalingAdapterStatus struct {
6868
// +kubebuilder:subresource:status
6969
// +kubebuilder:subresource:scale:specpath=.spec.replicas,statuspath=.status.replicas,selectorpath=.status.selector
7070
// +kubebuilder:printcolumn:name="DGD",type="string",JSONPath=".spec.dgdRef.name",description="DynamoGraphDeployment name"
71-
// +kubebuilder:printcolumn:name="SERVICE",type="string",JSONPath=".spec.dgdRef.service",description="Service name"
71+
// +kubebuilder:printcolumn:name="SERVICE",type="string",JSONPath=".spec.dgdRef.serviceName",description="Service name"
7272
// +kubebuilder:printcolumn:name="REPLICAS",type="integer",JSONPath=".status.replicas",description="Current replicas"
7373
// +kubebuilder:printcolumn:name="AGE",type="date",JSONPath=".metadata.creationTimestamp"
7474
// +kubebuilder:resource:shortName={dgdsa}

deploy/cloud/operator/api/v1alpha1/zz_generated.deepcopy.go

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

0 commit comments

Comments
 (0)