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
1e6709db
Unverified
Commit
1e6709db
authored
Jul 28, 2025
by
julienmancuso
Committed by
GitHub
Jul 28, 2025
Browse files
feat: allow to override any podSpec property (#2116)
parent
096d117d
Changes
10
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
12290 additions
and
2633 deletions
+12290
-2633
deploy/cloud/helm/crds/Chart.yaml
deploy/cloud/helm/crds/Chart.yaml
+1
-1
deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml
...crds/templates/nvidia.com_dynamocomponentdeployments.yaml
+3067
-642
deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml
...elm/crds/templates/nvidia.com_dynamographdeployments.yaml
+3067
-642
deploy/cloud/helm/platform/components/operator/templates/deployment.yaml
...lm/platform/components/operator/templates/deployment.yaml
+2
-2
deploy/cloud/operator/api/dynamo/common/common.go
deploy/cloud/operator/api/dynamo/common/common.go
+2
-9
deploy/cloud/operator/api/dynamo/common/zz_generated.deepcopy.go
...cloud/operator/api/dynamo/common/zz_generated.deepcopy.go
+3
-31
deploy/cloud/operator/config/crd/bases/nvidia.com_dynamocomponentdeployments.yaml
...nfig/crd/bases/nvidia.com_dynamocomponentdeployments.yaml
+3067
-642
deploy/cloud/operator/config/crd/bases/nvidia.com_dynamographdeployments.yaml
...r/config/crd/bases/nvidia.com_dynamographdeployments.yaml
+3067
-642
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go
...ternal/controller/dynamocomponentdeployment_controller.go
+7
-20
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go
...l/controller/dynamocomponentdeployment_controller_test.go
+7
-2
No files found.
deploy/cloud/helm/crds/Chart.yaml
View file @
1e6709db
...
...
@@ -16,5 +16,5 @@ apiVersion: v2
name
:
dynamo-crds
description
:
A Helm chart for dynamo CRDs
type
:
application
version
:
0.
3.2
version
:
0.
4.0
dependencies
:
[]
\ No newline at end of file
deploy/cloud/helm/crds/templates/nvidia.com_dynamocomponentdeployments.yaml
View file @
1e6709db
This diff is collapsed.
Click to expand it.
deploy/cloud/helm/crds/templates/nvidia.com_dynamographdeployments.yaml
View file @
1e6709db
This diff is collapsed.
Click to expand it.
deploy/cloud/helm/platform/components/operator/templates/deployment.yaml
View file @
1e6709db
...
...
@@ -73,12 +73,12 @@ spec:
{{
- if .Values.natsAddr
}}
-
--natsAddr={{ .Values.natsAddr }}
{{
- else
}}
-
--natsAddr=nats://{{ .Release.Name }}-nats:4222
-
--natsAddr=nats://{{ .Release.Name }}-nats
.{{ .Release.Namespace }}
:4222
{{
- end
}}
{{
- if .Values.etcdAddr
}}
-
--etcdAddr={{ .Values.etcdAddr }}
{{
- else
}}
-
--etcdAddr={{ .Release.Name }}-etcd:2379
-
--etcdAddr={{ .Release.Name }}-etcd
.{{ .Release.Namespace }}
:2379
{{
- end
}}
{{
- if and .Values.dynamo.istio.enabled .Values.dynamo.istio.gateway
}}
-
--istio-virtual-service-gateway={{ .Values.dynamo.istio.gateway }}
...
...
deploy/cloud/operator/api/dynamo/common/common.go
View file @
1e6709db
...
...
@@ -54,13 +54,6 @@ type ExtraPodMetadata struct {
}
type
ExtraPodSpec
struct
{
SchedulerName
string
`json:"schedulerName,omitempty"`
NodeSelector
map
[
string
]
string
`json:"nodeSelector,omitempty"`
Affinity
*
corev1
.
Affinity
`json:"affinity,omitempty"`
Tolerations
[]
corev1
.
Toleration
`json:"tolerations,omitempty"`
TopologySpreadConstraints
[]
corev1
.
TopologySpreadConstraint
`json:"topologySpreadConstraints,omitempty"`
Containers
[]
corev1
.
Container
`json:"containers,omitempty"`
ServiceAccountName
string
`json:"serviceAccountName,omitempty"`
PriorityClassName
string
`json:"priorityClassName,omitempty"`
*
corev1
.
PodSpec
`json:",inline"`
MainContainer
*
corev1
.
Container
`json:"mainContainer,omitempty"`
}
deploy/cloud/operator/api/dynamo/common/zz_generated.deepcopy.go
View file @
1e6709db
...
...
@@ -118,39 +118,11 @@ func (in *ExtraPodMetadata) DeepCopy() *ExtraPodMetadata {
// DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func
(
in
*
ExtraPodSpec
)
DeepCopyInto
(
out
*
ExtraPodSpec
)
{
*
out
=
*
in
if
in
.
NodeSelector
!=
nil
{
in
,
out
:=
&
in
.
NodeSelector
,
&
out
.
NodeSelector
*
out
=
make
(
map
[
string
]
string
,
len
(
*
in
))
for
key
,
val
:=
range
*
in
{
(
*
out
)[
key
]
=
val
}
}
if
in
.
Affinity
!=
nil
{
in
,
out
:=
&
in
.
Affinity
,
&
out
.
Affinity
*
out
=
new
(
v1
.
Affinity
)
if
in
.
PodSpec
!=
nil
{
in
,
out
:=
&
in
.
PodSpec
,
&
out
.
PodSpec
*
out
=
new
(
v1
.
PodSpec
)
(
*
in
)
.
DeepCopyInto
(
*
out
)
}
if
in
.
Tolerations
!=
nil
{
in
,
out
:=
&
in
.
Tolerations
,
&
out
.
Tolerations
*
out
=
make
([]
v1
.
Toleration
,
len
(
*
in
))
for
i
:=
range
*
in
{
(
*
in
)[
i
]
.
DeepCopyInto
(
&
(
*
out
)[
i
])
}
}
if
in
.
TopologySpreadConstraints
!=
nil
{
in
,
out
:=
&
in
.
TopologySpreadConstraints
,
&
out
.
TopologySpreadConstraints
*
out
=
make
([]
v1
.
TopologySpreadConstraint
,
len
(
*
in
))
for
i
:=
range
*
in
{
(
*
in
)[
i
]
.
DeepCopyInto
(
&
(
*
out
)[
i
])
}
}
if
in
.
Containers
!=
nil
{
in
,
out
:=
&
in
.
Containers
,
&
out
.
Containers
*
out
=
make
([]
v1
.
Container
,
len
(
*
in
))
for
i
:=
range
*
in
{
(
*
in
)[
i
]
.
DeepCopyInto
(
&
(
*
out
)[
i
])
}
}
if
in
.
MainContainer
!=
nil
{
in
,
out
:=
&
in
.
MainContainer
,
&
out
.
MainContainer
*
out
=
new
(
v1
.
Container
)
...
...
deploy/cloud/operator/config/crd/bases/nvidia.com_dynamocomponentdeployments.yaml
View file @
1e6709db
This diff is collapsed.
Click to expand it.
deploy/cloud/operator/config/crd/bases/nvidia.com_dynamographdeployments.yaml
View file @
1e6709db
This diff is collapsed.
Click to expand it.
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller.go
View file @
1e6709db
...
...
@@ -1477,11 +1477,6 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
podLabels
[
commonconsts
.
KubeLabelDynamoSelector
]
=
kubeName
podSpec
:=
corev1
.
PodSpec
{
Containers
:
containers
,
Volumes
:
volumes
,
}
imagePullSecrets
:=
[]
corev1
.
LocalObjectReference
{}
if
r
.
DockerSecretRetriever
==
nil
{
...
...
@@ -1500,9 +1495,13 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
})
}
if
len
(
imagePullSecrets
)
>
0
{
podSpec
.
ImagePullSecrets
=
imagePullSecrets
podSpec
:=
&
corev1
.
PodSpec
{}
if
opt
.
dynamoComponentDeployment
.
Spec
.
ExtraPodSpec
!=
nil
&&
opt
.
dynamoComponentDeployment
.
Spec
.
ExtraPodSpec
.
PodSpec
!=
nil
{
podSpec
=
opt
.
dynamoComponentDeployment
.
Spec
.
ExtraPodSpec
.
PodSpec
.
DeepCopy
()
}
podSpec
.
Containers
=
append
(
podSpec
.
Containers
,
containers
...
)
podSpec
.
Volumes
=
append
(
podSpec
.
Volumes
,
volumes
...
)
podSpec
.
ImagePullSecrets
=
append
(
podSpec
.
ImagePullSecrets
,
imagePullSecrets
...
)
extraPodMetadata
:=
opt
.
dynamoComponentDeployment
.
Spec
.
ExtraPodMetadata
...
...
@@ -1516,18 +1515,6 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
}
}
extraPodSpec
:=
opt
.
dynamoComponentDeployment
.
Spec
.
ExtraPodSpec
if
extraPodSpec
!=
nil
{
podSpec
.
SchedulerName
=
extraPodSpec
.
SchedulerName
podSpec
.
NodeSelector
=
extraPodSpec
.
NodeSelector
podSpec
.
Affinity
=
extraPodSpec
.
Affinity
podSpec
.
Tolerations
=
extraPodSpec
.
Tolerations
podSpec
.
TopologySpreadConstraints
=
extraPodSpec
.
TopologySpreadConstraints
podSpec
.
Containers
=
append
(
podSpec
.
Containers
,
extraPodSpec
.
Containers
...
)
podSpec
.
ServiceAccountName
=
extraPodSpec
.
ServiceAccountName
}
if
podSpec
.
ServiceAccountName
==
""
{
serviceAccounts
:=
&
corev1
.
ServiceAccountList
{}
err
=
r
.
List
(
ctx
,
serviceAccounts
,
client
.
InNamespace
(
opt
.
dynamoComponentDeployment
.
Namespace
),
client
.
MatchingLabels
{
...
...
@@ -1565,7 +1552,7 @@ func (r *DynamoComponentDeploymentReconciler) generatePodTemplateSpec(ctx contex
Labels
:
podLabels
,
Annotations
:
podAnnotations
,
},
Spec
:
podSpec
,
Spec
:
*
podSpec
,
}
return
...
...
deploy/cloud/operator/internal/controller/dynamocomponentdeployment_controller_test.go
View file @
1e6709db
...
...
@@ -842,6 +842,9 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
},
},
ExtraPodSpec
:
&
dynamoCommon
.
ExtraPodSpec
{
PodSpec
:
&
corev1
.
PodSpec
{
TerminationGracePeriodSeconds
:
ptr
.
To
(
int64
(
10
)),
},
MainContainer
:
&
corev1
.
Container
{
Image
:
"test-image:latest"
,
Command
:
[]
string
{
...
...
@@ -902,6 +905,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
},
Spec
:
corev1
.
PodSpec
{
SchedulerName
:
"volcano"
,
TerminationGracePeriodSeconds
:
ptr
.
To
(
int64
(
10
)),
Containers
:
[]
corev1
.
Container
{
{
Name
:
"main"
,
...
...
@@ -953,6 +957,7 @@ func TestDynamoComponentDeploymentReconciler_generateLeaderWorkerSet(t *testing.
},
},
Spec
:
corev1
.
PodSpec
{
TerminationGracePeriodSeconds
:
ptr
.
To
(
int64
(
10
)),
SchedulerName
:
"volcano"
,
Containers
:
[]
corev1
.
Container
{
{
...
...
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