@@ -94,9 +94,9 @@ func main() {
94
94
GCPForceOnDemand bool `envconfig:"GCP_FORCE_ON_DEMAND" default:"false"`
95
95
96
96
// NodeMinLifespan is the amount of time that should pass between a Node object
97
- // creation and a cleanup of that Node. This needs to be long enough to allow
98
- // the node to become Ready and for a pending Pod to be scheduled on it .
99
- NodeMinLifespan time.Duration `envconfig:"NODE_MIN_LIFESPAN" default:"3m "`
97
+ // creation and a cleanup of that Node. This is mostly irrelevant now that JobSet
98
+ // existance is checked before deleting a NodePool .
99
+ NodeMinLifespan time.Duration `envconfig:"NODE_MIN_LIFESPAN" default:"10s "`
100
100
101
101
NodepoolDeletionDelay time.Duration `envconfig:"NODEPOOL_DELETION_DELAY" default:"30s"`
102
102
@@ -198,30 +198,37 @@ func main() {
198
198
"podToNodeLabels" , cfg .GCPPodToNodeLabels ,
199
199
)
200
200
201
+ clusterCtx := cloud.GKEContext {
202
+ ProjectID : cfg .GCPProjectID ,
203
+ ClusterLocation : cfg .GCPClusterLocation ,
204
+ Cluster : cfg .GCPCluster ,
205
+ NodeZone : cfg .GCPZone ,
206
+ NodeServiceAccount : cfg .GCPNodeServiceAccount ,
207
+ NodeAdditionalNetworks : cfg .GCPNodeAdditionalNetworks ,
208
+ NodeSecondaryDisk : cfg .GCPNodeSecondaryDisk ,
209
+ NodeTags : cfg .GCPNodeTags ,
210
+ NodeDiskType : cfg .GCPNodeDiskType ,
211
+ NodeConfidentialStorage : cfg .GCPNodeConfidentialStorage ,
212
+ NodeBootDiskKMSKey : cfg .GCPNodeBootDiskKMSKey ,
213
+ PodToNodeLabels : cfg .GCPPodToNodeLabels ,
214
+ NodeSecureBoot : cfg .GCPNodeSecureBoot ,
215
+ ForceOnDemand : cfg .GCPForceOnDemand ,
216
+ }
217
+
201
218
containers , err := containerv1beta1 .NewService (context .Background () /*, option.WithCredentials(creds)*/ )
202
219
if err != nil {
203
220
setupLog .Error (err , "unable to create gke client" )
204
221
os .Exit (1 )
205
222
}
223
+ nodePoolsService := & cloud.GKENodePoolService {
224
+ ClusterContext : clusterCtx ,
225
+ Service : containers ,
226
+ }
227
+
206
228
provider = & cloud.GKE {
207
- Service : containers ,
208
- ClusterContext : cloud.GKEContext {
209
- ProjectID : cfg .GCPProjectID ,
210
- ClusterLocation : cfg .GCPClusterLocation ,
211
- Cluster : cfg .GCPCluster ,
212
- NodeZone : cfg .GCPZone ,
213
- NodeServiceAccount : cfg .GCPNodeServiceAccount ,
214
- NodeAdditionalNetworks : cfg .GCPNodeAdditionalNetworks ,
215
- NodeSecondaryDisk : cfg .GCPNodeSecondaryDisk ,
216
- NodeTags : cfg .GCPNodeTags ,
217
- NodeDiskType : cfg .GCPNodeDiskType ,
218
- NodeConfidentialStorage : cfg .GCPNodeConfidentialStorage ,
219
- NodeBootDiskKMSKey : cfg .GCPNodeBootDiskKMSKey ,
220
- PodToNodeLabels : cfg .GCPPodToNodeLabels ,
221
- NodeSecureBoot : cfg .GCPNodeSecureBoot ,
222
- ForceOnDemand : cfg .GCPForceOnDemand ,
223
- },
224
- Recorder : mgr .GetEventRecorderFor ("tpu-provisioner" ),
229
+ NodePools : nodePoolsService ,
230
+ ClusterContext : clusterCtx ,
231
+ Recorder : mgr .GetEventRecorderFor ("tpu-provisioner" ),
225
232
}
226
233
case "mock" :
227
234
provider = & cloud.Mock {}
0 commit comments