@@ -80,17 +80,19 @@ func createCRDs() {
8080 _ = testutils .CreateObjsFromYaml (testConfig , gieCRDs , "" )
8181}
8282
83- // createEndPointPicker creates the scheduling ConfigMap and EPP Deployment (plus
84- // its ServiceAccount, RoleBinding, and Service) from the supplied EPP config and
85- // waits for the EPP Deployment to become ready. Returns the created object ids
86- // for cleanup.
83+ // createEndPointPicker creates the scheduling ConfigMap and EPP Deployment from
84+ // the supplied EPP config and waits for the EPP Deployment to become ready. Its
85+ // ServiceAccount, RoleBinding, and Service are created once by createStableInfra.
86+ // Returns the created object ids for cleanup.
8787func createEndPointPicker (config string ) []string {
8888 const cmName = "epp-config"
8989 createEPPConfigMap (cmName , config )
9090
9191 objects := make ([]string , 1 , 8 )
9292 objects [0 ] = "ConfigMap/" + cmName
93- objects = append (objects , applyManifest (eppManifest , eppSubstitutions ())... )
93+ // The Service, ServiceAccount, and RoleBinding are created once by
94+ // createStableInfra; recreate only the Deployment per spec.
95+ objects = append (objects , applyManifest (eppManifest , eppSubstitutions (), "Service" , "ServiceAccount" , "RoleBinding" )... )
9496 podsInDeploymentsReady (objects )
9597 return objects
9698}
@@ -144,8 +146,8 @@ func createModelServers(encodeReplicas, prefillReplicas, decodeReplicas int) []s
144146}
145147
146148// createCoordinator builds the coordinator ConfigMap from the given pipeline
147- // config, deploys the coordinator component ( Deployment + Service + SA), and
148- // waits for readiness .
149+ // config, deploys the coordinator Deployment, and waits for readiness. Its
150+ // Service and ServiceAccount are created once by createStableInfra .
149151func createCoordinator (config string ) []string {
150152 nsName := getNamespace ()
151153 coordinatorYAML := e2eutil .SubstituteMany ([]string {config }, map [string ]string {
@@ -167,7 +169,9 @@ func createCoordinator(config string) []string {
167169 objects [0 ] = "ConfigMap/llm-d-coordinator-config"
168170
169171 docs := e2eutil .RunKustomize (coordinatorComponentDir )
170- docs = e2eutil .FilterKinds (docs , "ConfigMap" )
172+ // Service and ServiceAccount are created once by createStableInfra; recreate
173+ // only the Deployment per spec.
174+ docs = e2eutil .FilterKinds (docs , "ConfigMap" , "Service" , "ServiceAccount" )
171175 docs = e2eutil .SubstituteMany (docs , coordinatorSubstitutions ())
172176 docs = e2eutil .RemoveEmptyArgs (docs )
173177 objects = append (objects , testutils .CreateObjsFromYaml (testConfig , docs , nsName )... )
@@ -178,8 +182,11 @@ func createCoordinator(config string) []string {
178182}
179183
180184// waitForCoordinatorReady polls /readyz through Envoy until it returns 200,
181- // catching Envoy's STRICT_DNS resolution lagging behind the per-test Service
182- // (podsInDeploymentsReady already confirms the coordinator pod itself is ready).
185+ // confirming the freshly recreated coordinator pod is reachable through the
186+ // gateway before the test sends its request. The gateway Service is stable
187+ // across specs (see createStableInfra), so this waits only for the new pod to
188+ // appear behind it. (podsInDeploymentsReady already confirms the coordinator
189+ // pod itself is ready.)
183190func waitForCoordinatorReady () {
184191 ginkgo .By ("Waiting for coordinator to be reachable via gateway" )
185192 gomega .Eventually (func () bool {
@@ -212,13 +219,31 @@ func createEPPConfigMap(name, content string) {
212219 }
213220}
214221
215- func applyManifest (path string , subs map [string ]string ) []string {
222+ func applyManifest (path string , subs map [string ]string , excludeKinds ... string ) []string {
216223 docs := testutils .ReadYaml (path )
217224 docs = e2eutil .SubstituteMany (docs , subs )
218225 docs = e2eutil .RemoveEmptyArgs (docs )
226+ docs = e2eutil .FilterKinds (docs , excludeKinds ... )
219227 return testutils .CreateObjsFromYaml (testConfig , docs , getNamespace ())
220228}
221229
230+ // createStableInfra creates the coordinator and EPP Services, ServiceAccounts,
231+ // and RoleBindings once, up front. It appends each created id to
232+ // stableInfraObjects as it goes rather than returning them at the end, so a
233+ // partial failure still leaves the already-created objects tracked for suite
234+ // teardown. Envoy fronts the Services via STRICT_DNS clusters and outlives the
235+ // per-spec workload; recreating a Service each spec would rotate its ClusterIP and
236+ // force Envoy to re-resolve, so only the Deployments behind them churn per spec.
237+ func createStableInfra () {
238+ docs := e2eutil .RunKustomize (coordinatorComponentDir )
239+ docs = e2eutil .FilterKinds (docs , "ConfigMap" , "Deployment" )
240+ docs = e2eutil .SubstituteMany (docs , coordinatorSubstitutions ())
241+ docs = e2eutil .RemoveEmptyArgs (docs )
242+ stableInfraObjects = append (stableInfraObjects , testutils .CreateObjsFromYaml (testConfig , docs , getNamespace ())... )
243+
244+ stableInfraObjects = append (stableInfraObjects , applyManifest (eppManifest , eppSubstitutions (), "Deployment" )... )
245+ }
246+
222247func eppSubstitutions () map [string ]string {
223248 return map [string ]string {
224249 "${EPP_NAME}" : eppName ,
0 commit comments