@@ -45,11 +45,6 @@ import (
4545
4646const ControllerName = "launcher-pool-populator"
4747
48- const (
49- LauncherComponentAnnotationKey = "dual-pods.llm-d.ai/component"
50- LauncherComponentAnnotationValue = "launcher"
51- )
52-
5348type Controller interface {
5449 Start (context.Context ) error
5550}
@@ -76,17 +71,11 @@ func NewController(
7671 lcInformer : fmaInformerFactory .Fma ().V1alpha1 ().LauncherConfigs ().Informer (),
7772 lcLister : fmaInformerFactory .Fma ().V1alpha1 ().LauncherConfigs ().Lister (),
7873 }
79- err := ctl .podInformer .AddIndexers (cache.Indexers {
80- launcherPodIndexName : launcherIndexFunc ,
81- })
82- if err != nil { //impossible
83- return nil , err
84- }
8574
8675 // Use a single worker thread to ensure sequential processing of LauncherPopulationPolicy updates
8776 // Prevents race conditions when multiple threads simultaneously modify the same node/configuration pairs
8877 ctl .QueueAndWorkers = genctlr .NewQueueAndWorkers (ControllerName , 1 , ctl .process )
89- _ , err = ctl .podInformer .AddEventHandler (ctl )
78+ _ , err : = ctl .podInformer .AddEventHandler (ctl )
9079 if err != nil {
9180 panic (err )
9281 }
@@ -134,17 +123,6 @@ type lppItem struct {
134123 cache.ObjectName
135124}
136125
137- const launcherPodIndexName = "launcher"
138-
139- func launcherIndexFunc (obj any ) ([]string , error ) {
140- pod := obj .(* corev1.Pod )
141- if pod .Annotations [LauncherComponentAnnotationKey ] == LauncherComponentAnnotationValue {
142- return []string {string (pod .UID )}, nil
143- }
144-
145- return []string {}, nil
146- }
147-
148126func (ctl * controller ) OnAdd (obj any , isInInitialList bool ) {
149127 switch typed := obj .(type ) {
150128 case * fmav1alpha1.LauncherPopulationPolicy :
@@ -321,8 +299,8 @@ func (ctl *controller) reconcileLaunchersOnNode(ctx context.Context, key NodeLau
321299// getCurrentLaunchersOnNode returns launcher pods for a specific config on a specific node
322300func (ctl * controller ) getCurrentLaunchersOnNode (ctx context.Context , key NodeLauncherKey ) ([]corev1.Pod , error ) {
323301 launcherLabels := map [string ]string {
324- LauncherComponentAnnotationKey : LauncherComponentAnnotationValue ,
325- "app.kubernetes.io/launcher-config-name" : key .LauncherConfigName ,
302+ ComponentLabelKey : LauncherComponentLabelValue ,
303+ LauncherConfigNameLabelKey : key .LauncherConfigName ,
326304 }
327305 // Use podLister's List method with label selector
328306 pods , err := ctl .podLister .List (labels .SelectorFromSet (launcherLabels ))
@@ -399,8 +377,9 @@ func (ctl *controller) buildPodFromTemplate(template corev1.PodTemplateSpec, key
399377 if pod .Labels == nil {
400378 pod .Labels = make (map [string ]string )
401379 }
402- pod .Labels ["app.kubernetes.io/component" ] = "launcher"
403- pod .Labels ["app.kubernetes.io/launcher-config-name" ] = key .LauncherConfigName
380+ pod .Labels [ComponentLabelKey ] = LauncherComponentLabelValue
381+ pod .Labels [LauncherGeneratedByLabelKey ] = LauncherGeneratedByLabelValue
382+ pod .Labels [LauncherConfigNameLabelKey ] = key .LauncherConfigName
404383 // Assign to specific node
405384 pod .Spec .NodeName = key .NodeName
406385 return pod
0 commit comments