diff --git a/apis/v1alpha1/dcgmexpoter_types.go b/apis/v1alpha1/dcgmexpoter_types.go index 51332794b..628490a48 100644 --- a/apis/v1alpha1/dcgmexpoter_types.go +++ b/apis/v1alpha1/dcgmexpoter_types.go @@ -43,6 +43,10 @@ type DcgmExporterSpec struct { // consumed in the config file for the Collector. // +optional Env []v1.EnvVar `json:"env,omitempty"` + // Toleration to schedule DCGM Exporter pods. + // This is only relevant to daemonset, statefulset, and deployment mode + // +optional + Tolerations []v1.Toleration `json:"tolerations,omitempty"` // Volumes represents which volumes to use in the underlying collector deployment(s). // +optional // +listType=atomic diff --git a/apis/v1alpha1/neuronmonitor_types.go b/apis/v1alpha1/neuronmonitor_types.go index 8f68979e0..d684791c2 100644 --- a/apis/v1alpha1/neuronmonitor_types.go +++ b/apis/v1alpha1/neuronmonitor_types.go @@ -62,6 +62,10 @@ type NeuronMonitorSpec struct { // consumed in the config file for the Collector. // +optional Env []v1.EnvVar `json:"env,omitempty"` + // Toleration to schedule Neuron Monitor Exporter pods. + // This is only relevant to daemonset, statefulset, and deployment mode + // +optional + Tolerations []v1.Toleration `json:"tolerations,omitempty"` // Volumes represents which volumes to use in the underlying collector deployment(s). // +optional // +listType=atomic diff --git a/internal/manifests/dcgmexporter/daemonset.go b/internal/manifests/dcgmexporter/daemonset.go index 142c3c2c8..764352df6 100644 --- a/internal/manifests/dcgmexporter/daemonset.go +++ b/internal/manifests/dcgmexporter/daemonset.go @@ -40,6 +40,7 @@ func DaemonSet(params manifests.Params) *appsv1.DaemonSet { ServiceAccountName: ServiceAccountName(params.DcgmExp), Containers: []corev1.Container{Container(params.Config, params.Log, params.DcgmExp)}, Volumes: Volumes(params.DcgmExp), + Tolerations: params.DcgmExp.Spec.Tolerations, NodeSelector: params.DcgmExp.Spec.NodeSelector, Affinity: params.DcgmExp.Spec.Affinity, }, diff --git a/internal/manifests/neuronmonitor/daemonset.go b/internal/manifests/neuronmonitor/daemonset.go index b0562563f..85f6f00ea 100644 --- a/internal/manifests/neuronmonitor/daemonset.go +++ b/internal/manifests/neuronmonitor/daemonset.go @@ -40,6 +40,7 @@ func DaemonSet(params manifests.Params) *appsv1.DaemonSet { ServiceAccountName: ServiceAccountName(params.NeuronExp), Containers: []corev1.Container{Container(params.Config, params.Log, params.NeuronExp)}, Volumes: Volumes(params.NeuronExp), + Tolerations: params.NeuronExp.Spec.Tolerations, NodeSelector: params.NeuronExp.Spec.NodeSelector, Affinity: params.NeuronExp.Spec.Affinity, },