Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
dynamo
Commits
6f8ce176
"docs/design-docs/discovery-plane.md" did not exist on "bbe82f182a09c8776e57dca5935f85360d97f3e1"
Unverified
Commit
6f8ce176
authored
Aug 26, 2025
by
mohammedabdulwahhab
Committed by
GitHub
Aug 27, 2025
Browse files
fix: add label to persist DGD name on downstream pods (#2729)
parent
490cdc18
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
80 deletions
+118
-80
deploy/cloud/operator/internal/consts/consts.go
deploy/cloud/operator/internal/consts/consts.go
+1
-0
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go
...ternal/controller/dynamocomponentdeployment_controller.go
+3
-0
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go
...l/controller/dynamocomponentdeployment_controller_test.go
+4
-2
deploy/cloud/operator/internal/dynamo/graph.go
deploy/cloud/operator/internal/dynamo/graph.go
+2
-0
deploy/cloud/operator/internal/dynamo/graph_test.go
deploy/cloud/operator/internal/dynamo/graph_test.go
+108
-78
No files found.
deploy/cloud/operator/internal/consts/consts.go
View file @
6f8ce176
...
...
@@ -23,6 +23,7 @@ const (
KubeAnnotationEnableGrove
=
"nvidia.com/enable-grove"
KubeLabelDynamoGraphDeploymentName
=
"nvidia.com/dynamo-graph-deployment-name"
KubeLabelDynamoComponent
=
"nvidia.com/dynamo-component"
KubeLabelDynamoNamespace
=
"nvidia.com/dynamo-namespace"
KubeLabelDynamoDeploymentTargetType
=
"nvidia.com/dynamo-deployment-target-type"
...
...
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go
View file @
6f8ce176
...
...
@@ -1146,6 +1146,9 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
podLabels
[
commonconsts
.
KubeLabelMetricsEnabled
]
=
commonconsts
.
KubeLabelValueTrue
}
// Add label for the dynamo graph deployment on the pods themselves
podLabels
[
commonconsts
.
KubeLabelDynamoGraphDeploymentName
]
=
opt
.
dynamoComponentDeployment
.
Spec
.
Labels
[
commonconsts
.
KubeLabelDynamoGraphDeploymentName
]
// Add component type label if specified
if
opt
.
dynamoComponentDeployment
.
Spec
.
ComponentType
!=
""
{
podLabels
[
commonconsts
.
KubeLabelDynamoComponentType
]
=
opt
.
dynamoComponentDeployment
.
Spec
.
ComponentType
...
...
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go
View file @
6f8ce176
...
...
@@ -783,6 +783,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
"role"
:
"leader"
,
"nvidia.com/label1"
:
"label1"
,
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
""
,
},
Annotations
:
map
[
string
]
string
{
"scheduling.k8s.io/group-name"
:
"test-lws-deploy-0"
,
...
...
@@ -892,6 +893,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
"role"
:
"worker"
,
"nvidia.com/label1"
:
"label1"
,
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
""
,
},
Annotations
:
map
[
string
]
string
{
"scheduling.k8s.io/group-name"
:
"test-lws-deploy-0"
,
...
...
deploy/cloud/operator/internal/dynamo/graph.go
View file @
6f8ce176
...
...
@@ -138,6 +138,7 @@ func GenerateDynamoComponentsDeployments(ctx context.Context, parentDynamoGraphD
deployment
.
Labels
=
labels
labels
[
commonconsts
.
KubeLabelDynamoComponent
]
=
componentName
labels
[
commonconsts
.
KubeLabelDynamoNamespace
]
=
graphDynamoNamespace
labels
[
commonconsts
.
KubeLabelDynamoGraphDeploymentName
]
=
parentDynamoGraphDeployment
.
Name
// Propagate metrics annotation from parent deployment if present
if
parentDynamoGraphDeployment
.
Annotations
!=
nil
{
...
...
@@ -960,6 +961,7 @@ func GenerateGrovePodGangSet(
func
generateLabels
(
component
*
v1alpha1
.
DynamoComponentDeploymentOverridesSpec
,
dynamoDeployment
*
v1alpha1
.
DynamoGraphDeployment
,
componentName
string
)
(
map
[
string
]
string
,
error
)
{
labels
:=
make
(
map
[
string
]
string
)
labels
[
commonconsts
.
KubeLabelDynamoSelector
]
=
GetDynamoComponentName
(
dynamoDeployment
,
componentName
)
labels
[
commonconsts
.
KubeLabelDynamoGraphDeploymentName
]
=
dynamoDeployment
.
Name
if
component
.
ComponentType
!=
""
{
labels
[
commonconsts
.
KubeLabelDynamoComponentType
]
=
component
.
ComponentType
}
...
...
deploy/cloud/operator/internal/dynamo/graph_test.go
View file @
6f8ce176
...
...
@@ -101,6 +101,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -120,6 +121,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Autoscaling
:
nil
,
},
...
...
@@ -132,6 +134,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -142,6 +145,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Resources
:
&
common
.
Resources
{
Requests
:
&
common
.
ResourceItem
{
...
...
@@ -209,6 +213,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -228,6 +233,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Autoscaling
:
nil
,
},
...
...
@@ -240,6 +246,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -250,6 +257,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Resources
:
&
common
.
Resources
{
Requests
:
&
common
.
ResourceItem
{
...
...
@@ -367,6 +375,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -386,6 +395,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Autoscaling
:
nil
,
Ingress
:
&
v1alpha1
.
IngressSpec
{
...
...
@@ -402,6 +412,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -412,6 +423,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Resources
:
&
common
.
Resources
{
Requests
:
&
common
.
ResourceItem
{
...
...
@@ -485,6 +497,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -510,6 +523,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Autoscaling
:
nil
,
Envs
:
[]
corev1
.
EnvVar
{
...
...
@@ -528,6 +542,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -538,6 +553,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"dynamo-test-dynamographdeployment"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Resources
:
&
common
.
Resources
{
Requests
:
&
common
.
ResourceItem
{
...
...
@@ -618,6 +634,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -638,6 +655,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service1"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Autoscaling
:
nil
,
ExtraPodSpec
:
&
common
.
ExtraPodSpec
{
...
...
@@ -656,6 +674,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
},
Spec
:
v1alpha1
.
DynamoComponentDeploymentSpec
{
...
...
@@ -667,6 +686,7 @@ func TestGenerateDynamoComponentsDeployments(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoComponent
:
"service2"
,
commonconsts
.
KubeLabelDynamoNamespace
:
"default"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamographdeployment"
,
},
Resources
:
&
common
.
Resources
{
Requests
:
&
common
.
ResourceItem
{
...
...
@@ -1217,6 +1237,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-frontend"
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeFrontend
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
"nvidia.com/label1"
:
"label1"
,
"nvidia.com/label2"
:
"label2"
,
},
...
...
@@ -1357,6 +1378,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-planner"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
},
Annotations
:
map
[
string
]
string
{},
Spec
:
grovev1alpha1
.
PodCliqueSpec
{
...
...
@@ -1713,6 +1735,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-worker-ldr"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
"nvidia.com/label1"
:
"label1"
,
"nvidia.com/label2"
:
"label2"
,
},
...
...
@@ -1862,6 +1885,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-worker-wkr"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
"nvidia.com/label1"
:
"label1"
,
"nvidia.com/label2"
:
"label2"
,
},
...
...
@@ -1976,6 +2000,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-frontend"
,
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeFrontend
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
},
Annotations
:
map
[
string
]
string
{},
Spec
:
grovev1alpha1
.
PodCliqueSpec
{
...
...
@@ -2111,6 +2136,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-planner"
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
},
Annotations
:
map
[
string
]
string
{},
Spec
:
grovev1alpha1
.
PodCliqueSpec
{
...
...
@@ -2491,6 +2517,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-worker-ldr"
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
"nvidia.com/label1"
:
"label1"
,
"nvidia.com/label2"
:
"label2"
,
},
...
...
@@ -2628,6 +2655,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeWorker
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-worker-wkr"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
"nvidia.com/label1"
:
"label1"
,
"nvidia.com/label2"
:
"label2"
,
},
...
...
@@ -2742,6 +2770,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
commonconsts
.
KubeLabelDynamoComponentType
:
commonconsts
.
ComponentTypeFrontend
,
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-frontend"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
},
Annotations
:
map
[
string
]
string
{},
Spec
:
grovev1alpha1
.
PodCliqueSpec
{
...
...
@@ -2877,6 +2906,7 @@ func TestGenerateGrovePodGangSet(t *testing.T) {
Labels
:
map
[
string
]
string
{
commonconsts
.
KubeLabelMetricsEnabled
:
commonconsts
.
KubeLabelValueTrue
,
commonconsts
.
KubeLabelDynamoSelector
:
"test-dynamo-graph-deployment-planner"
,
commonconsts
.
KubeLabelDynamoGraphDeploymentName
:
"test-dynamo-graph-deployment"
,
},
Annotations
:
map
[
string
]
string
{},
Spec
:
grovev1alpha1
.
PodCliqueSpec
{
...
...
@@ -4493,7 +4523,7 @@ func TestGenerateBasePodSpec_Worker(t *testing.T) {
VolumeSource
:
corev1
.
VolumeSource
{
EmptyDir
:
&
corev1
.
EmptyDirVolumeSource
{
Medium
:
corev1
.
StorageMediumMemory
,
SizeLimit
:
func
()
*
resource
.
Quantity
{
q
:=
resource
.
MustParse
(
"
512M
i"
);
return
&
q
}(),
SizeLimit
:
func
()
*
resource
.
Quantity
{
q
:=
resource
.
MustParse
(
"
8G
i"
);
return
&
q
}(),
},
},
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment