@@ -183,7 +183,7 @@ export async function provisionEVault(w3id: string, eVaultId: string) {
183
183
kind : "Service" ,
184
184
metadata : { name : "evault-service" } ,
185
185
spec : {
186
- type : "LoadBalancer " ,
186
+ type : "NodePort " ,
187
187
selector : { app : "evault" } ,
188
188
ports : [
189
189
{
@@ -195,20 +195,23 @@ export async function provisionEVault(w3id: string, eVaultId: string) {
195
195
} ,
196
196
} ) ;
197
197
198
- // Wait for LoadBalancer IP
199
- let externalIP = null ;
200
- for ( let i = 0 ; i < 30 ; i ++ ) {
201
- const svc = await coreApi . readNamespacedService ( {
202
- name : "evault-service" ,
203
- namespace : namespaceName ,
204
- } ) ;
205
- const ingress = svc . status ?. loadBalancer ?. ingress ?. [ 0 ] ;
206
- if ( ingress ?. ip || ingress ?. hostname ) {
207
- externalIP = ingress . ip || ingress . hostname ;
208
- const port = svc . spec ?. ports ?. [ 0 ] ?. port ;
209
- return `http://${ externalIP } :${ port } ` ;
210
- }
211
- await new Promise ( ( r ) => setTimeout ( r , 2000 ) ) ;
212
- }
213
- throw new Error ( "Failed to get LoadBalancer IP after 60 seconds" ) ;
198
+ // Get the service and node info
199
+ const svc = await coreApi . readNamespacedService ( {
200
+ name : "evault-service" ,
201
+ namespace : namespaceName ,
202
+ } ) ;
203
+ const nodePort = svc . spec ?. ports ?. [ 0 ] ?. nodePort ;
204
+ if ( ! nodePort ) throw new Error ( "No NodePort assigned" ) ;
205
+
206
+ // Get the node's external IP
207
+ const nodes = await coreApi . listNode ( ) ;
208
+ const node = nodes . items [ 0 ] ;
209
+ if ( ! node ) throw new Error ( "No nodes found in cluster" ) ;
210
+
211
+ const externalIP = node . status ?. addresses ?. find (
212
+ addr => addr . type === "ExternalIP"
213
+ ) ?. address ;
214
+
215
+ if ( ! externalIP ) throw new Error ( "No external IP found on node" ) ;
216
+ return `http://${ externalIP } :${ nodePort } ` ;
214
217
}
0 commit comments