[v2][Bugfix] Applying K8s manifests to GKE clusters via URL #4352
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.
Fix: Correctly apply Kubernetes manifests from remote URLs
NOTE: We had re-raise this PR due to a regression found in the original PR #4292 . The root cause was identified:
This PR resolves a bug that caused Terraform to fail with an
Invalid count argument
error when applying a Kubernetes manifest from a remote URL. The issue occurred when thekubectl-apply
module had a dependency on another resource i.e. GKE cluster, being created in the same run.The root cause was a Terraform plan/apply lifecycle conflict. The module was trying to fetch the URL content after the cluster was created (in the apply phase), but other parts of the plan depended on that content before the apply could start.
This fix refactors the
kubectl-apply
module with the following strategy:terraform plan
phase.This change allows for the robust and predictable deployment of URL-based manifests.
How to Test and Verify
Configure a Blueprint: Use a blueprint that calls the workload-manager-install module (modules/management/kubectl-apply).
Use a URL Source: In the settings, disable the internal Kueue installation and provide the Kueue manifest via a URL in the apply_manifests list. This configuration specifically targets the fixed logic.
YAML
Deploy: Run the deployment command (e.g., ./gcluster deploy ...).
Expected Result:
The terraform plan and terraform apply phases should complete successfully without any "Invalid count" or other planning errors.
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.