Added the label to YAML to excute the pods on another node

This commit is contained in:
pb 2025-05-28 10:53:15 +02:00
parent 7c913bec0e
commit 411effb000

View File

@ -59,6 +59,9 @@ type Spec struct {
Volumes []VolumeClaimTemplate `yaml:"volumeClaimTemplates,omitempty"` Volumes []VolumeClaimTemplate `yaml:"volumeClaimTemplates,omitempty"`
Templates []Template `yaml:"templates"` Templates []Template `yaml:"templates"`
Timeout int `yaml:"activeDeadlineSeconds,omitempty"` Timeout int `yaml:"activeDeadlineSeconds,omitempty"`
NodeSelector struct{
NodeRole string `yaml:"node-role"`
} `yaml:"nodeSelector"`
} }
// TODO: found on a processing instance linked to storage // TODO: found on a processing instance linked to storage
@ -73,6 +76,7 @@ func (b *ArgoBuilder) CreateDAG(namespace string, write bool) ( int, []string, [
if b.Timeout > 0 { if b.Timeout > 0 {
b.Workflow.Spec.Timeout = b.Timeout b.Workflow.Spec.Timeout = b.Timeout
} }
b.Workflow.Spec.NodeSelector.NodeRole = "worker"
b.Workflow.Spec.ServiceAccountName = "sa-"+namespace b.Workflow.Spec.ServiceAccountName = "sa-"+namespace
b.Workflow.Spec.Entrypoint = "dag" b.Workflow.Spec.Entrypoint = "dag"
b.Workflow.ApiVersion = "argoproj.io/v1alpha1" b.Workflow.ApiVersion = "argoproj.io/v1alpha1"