Support for configuring affinity for helm executor (#1989)

This commit is contained in:
Xinzhao Xu
2024-10-24 15:12:01 +08:00
committed by hongming
parent 2af9ffa61c
commit e389253a4e
5 changed files with 29 additions and 0 deletions

View File

@@ -1556,6 +1556,7 @@ func (r *InstallPlanReconciler) newExecutor(plan *corev1alpha1.InstallPlan) (hel
helm.SetExecutorNamespace(plan.Status.TargetNamespace),
helm.SetExecutorBackoffLimit(0),
helm.SetTTLSecondsAfterFinished(r.HelmExecutorOptions.JobTTLAfterFinished),
helm.SetExecutorAffinity(r.HelmExecutorOptions.Affinity),
}
if r.HelmExecutorOptions.Resources != nil {
executorOptions = append(executorOptions, helm.SetExecutorResources(corev1.ResourceRequirements{

View File

@@ -38,6 +38,7 @@ type HelmExecutorOptions struct {
HistoryMax uint `json:"historyMax,omitempty" yaml:"historyMax,omitempty" mapstructure:"historyMax,omitempty"`
JobTTLAfterFinished time.Duration `json:"jobTTLAfterFinished,omitempty" yaml:"jobTTLAfterFinished,omitempty" mapstructure:"jobTTLAfterFinished,omitempty"`
Resources *ResourceRequirements `json:"resources,omitempty" yaml:"resources,omitempty" mapstructure:"resources,omitempty"`
Affinity *corev1.Affinity `json:"affinity,omitempty" yaml:"affinity,omitempty" mapstructure:"affinity,omitempty"`
}
type ResourceRequirements struct {