Conversation
Allow GKE clusters created as InfraBox job services to persist after the job ends by setting keepAlive: true in the GKECluster spec. - Add KeepAlive field to GKEClusterSpec in types.go - Tag keepAlive clusters with GCP label infrabox-keep-alive=true at creation - Skip cluster deletion in deleteGKECluster when keepAlive=true - Exclude labeled clusters from GC loop to prevent auto-cleanup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a
keepAliveoption to theGKEClusterservice spec, allowing clusters to persist after the InfraBox job ends. This enables teams to use long-running GKE clusters for debugging without needing manual provisioning.Closes DM01-6276 — Vsystem team needs a long-running GKE 1.37 cluster to debug InfraBox job compatibility issues.
Changes
types.go: AddKeepAlive boolfield toGKEClusterSpechandler.gocreateCluster: Append--labels infrabox-keep-alive=trueto thegcloudcreate command whenkeepAlive: truehandler.godeleteGKECluster: Skip cluster deletion and only remove the CRD whenkeepAlive: truehandler.gogetOutdatedClusters: Exclude clusters withinfrabox-keep-alive=truelabel from GC loopUsage
After the job ends, the GKE cluster continues running in GCP. The user is responsible for manually deleting it via
gcloud container clusters delete.Test plan
keepAlive: trueand verify cluster is not deleted after job finisheskeepAlive: false(default) and verify cluster is deleted as beforeinfrabox-keep-alive=trueclusterVersionfield works together withkeepAlive