Skip to content

Commit 7b13b9d

Browse files
authored
Allow configuration of Kueue's GenericJob Reconciller (#184)
Expose all Kueue configuration options that are passed through to instances of the jobframework's GenericReconciller as configurable options in our AppWrapperConfig struct.
1 parent edbca21 commit 7b13b9d

File tree

2 files changed

+18
-4
lines changed

2 files changed

+18
-4
lines changed

pkg/config/config.go

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ package config
1919
import (
2020
"fmt"
2121
"time"
22+
23+
"sigs.k8s.io/kueue/apis/config/v1beta1"
2224
)
2325

2426
type OperatorConfig struct {
@@ -31,12 +33,19 @@ type OperatorConfig struct {
3133
type AppWrapperConfig struct {
3234
EnableKueueIntegrations bool `json:"enableKueueIntegrations,omitempty"`
3335
DisableChildAdmissionCtrl bool `json:"disableChildAdmissionCtrl,omitempty"`
36+
KueueJobReconciller *KueueJobReconciller `json:"kueueJobReconciller,omitempty"`
3437
UserRBACAdmissionCheck bool `json:"userRBACAdmissionCheck,omitempty"`
3538
FaultTolerance *FaultToleranceConfig `json:"faultTolerance,omitempty"`
3639
SchedulerName string `json:"schedulerName,omitempty"`
3740
DefaultQueueName string `json:"defaultQueueName,omitempty"`
3841
}
3942

43+
type KueueJobReconciller struct {
44+
ManageJobsWithoutQueueName bool `json:"manageJobsWithoutQueueName,omitempty"`
45+
WaitForPodsReady *v1beta1.WaitForPodsReady `json:"waitForPodsReady,omitempty"`
46+
LabelKeysToCopy []string `json:"labelKeysToCopy,omitempty"`
47+
}
48+
4049
type FaultToleranceConfig struct {
4150
AdmissionGracePeriod time.Duration `json:"admissionGracePeriod,omitempty"`
4251
WarmupGracePeriod time.Duration `json:"warmupGracePeriod,omitempty"`
@@ -80,7 +89,12 @@ func NewAppWrapperConfig() *AppWrapperConfig {
8089
return &AppWrapperConfig{
8190
EnableKueueIntegrations: true,
8291
DisableChildAdmissionCtrl: true,
83-
UserRBACAdmissionCheck: true,
92+
KueueJobReconciller: &KueueJobReconciller{
93+
ManageJobsWithoutQueueName: true,
94+
WaitForPodsReady: &v1beta1.WaitForPodsReady{Enable: true},
95+
LabelKeysToCopy: []string{},
96+
},
97+
UserRBACAdmissionCheck: true,
8498
FaultTolerance: &FaultToleranceConfig{
8599
AdmissionGracePeriod: 1 * time.Minute,
86100
WarmupGracePeriod: 5 * time.Minute,

pkg/controller/setup.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ import (
3333
"github.com/project-codeflare/appwrapper/internal/webhook"
3434
"github.com/project-codeflare/appwrapper/pkg/config"
3535

36-
"sigs.k8s.io/kueue/apis/config/v1beta1"
3736
"sigs.k8s.io/kueue/pkg/controller/jobframework"
3837
)
3938

@@ -43,8 +42,9 @@ func SetupControllers(mgr ctrl.Manager, awConfig *config.AppWrapperConfig) error
4342
if err := workload.WorkloadReconciler(
4443
mgr.GetClient(),
4544
mgr.GetEventRecorderFor("kueue"),
46-
jobframework.WithManageJobsWithoutQueueName(true),
47-
jobframework.WithWaitForPodsReady(&v1beta1.WaitForPodsReady{Enable: true}),
45+
jobframework.WithManageJobsWithoutQueueName(awConfig.KueueJobReconciller.ManageJobsWithoutQueueName),
46+
jobframework.WithWaitForPodsReady(awConfig.KueueJobReconciller.WaitForPodsReady),
47+
jobframework.WithLabelKeysToCopy(awConfig.KueueJobReconciller.LabelKeysToCopy),
4848
).SetupWithManager(mgr); err != nil {
4949
return fmt.Errorf("workload controller: %w", err)
5050
}

0 commit comments

Comments
 (0)