Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added TF DNS config options to prevent Autopilot destroy / create on existing cluster #3330

Merged
merged 3 commits into from Aug 17, 2023

Conversation

abmarcum
Copy link
Contributor

What type of PR is this?
/kind bug

What this PR does / Why we need it:
Prevents re-creating Autopilot clusters if they already exist.

Special notes for your reviewer:

@github-actions github-actions bot added the kind/bug These are bugs. label Aug 17, 2023
@markmandel
Copy link
Member

Deferring to @zmerlynn and @gongmax who have been doing more of the autopilot work than I have.

@zmerlynn
Copy link
Collaborator

@abmarcum Thanks for the contribution! Can you describe the problem in more detail? Is our TF config recreating DNS settings? This seems like a flaw in the Google TF module, if so - if not, could you explain why not? Thanks!

@abmarcum
Copy link
Contributor Author

After creating a cluster using the Agones GKE Autopilot module, if I re-run terraform, I get the following on the cluster:

  - dns_config { # forces replacement
      - cluster_dns        = "CLOUD_DNS" -> null
      - cluster_dns_domain = "cluster.local" -> null
      - cluster_dns_scope  = "CLUSTER_SCOPE" -> null
    }

This indicates to me that Google is adding this configuration after the cluster is installed but because Terraform does not know about it, trys resets the configuration values to zero when run again. This then forces Terraform to destroy and re-create the Autopilot GKE cluster.

By adding these values to the Terraform code, this prevents Terraform for destroying/creating the cluster.

This may be an issue with what Terraform is expecting from Google (and should not destroy the cluster) but I tried this out on the latest Google Provider 4.78.0 and the issue still persists.

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 05319555-bc49-4aca-ba7f-ca13bf9d6177

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3330/head:pr_3330 && git checkout pr_3330
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-85b1d1f-amd64

@abmarcum
Copy link
Contributor Author

Note: I do not see this on a non-Autopilot GKE Cluster but I did see it on a non Agones GKE Autopilot cluster (the same changes fixed the issue.)

I did not check immediately after I first creating the cluster but I did see the error after I deployed workloads to the Autopilot clusters and ran terraform apply. The spinning up of nodes for workloads may be where those settings are being added to the GKE cluster.

You should be able to replicate this issue if you re-run Terraform against a GKE Autopilot cluster with existing workloads.

@zmerlynn
Copy link
Collaborator

I see the issue on my desktop now as well. LGTM.

@zmerlynn zmerlynn enabled auto-merge (squash) August 17, 2023 20:14
@google-oss-prow
Copy link

New changes are detected. LGTM label has been removed.

@google-oss-prow google-oss-prow bot removed the lgtm label Aug 17, 2023
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: abmarcum, zmerlynn
Once this PR has been reviewed and has the lgtm label, please assign roberthbailey for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@agones-bot
Copy link
Collaborator

Build Succeeded 👏

Build Id: 4ffa4c1c-016e-4e91-a94a-5b060edb369e

The following development artifacts have been built, and will exist for the next 30 days:

A preview of the website (the last 30 builds are retained):

To install this version:

  • git fetch https://github.com/googleforgames/agones.git pull/3330/head:pr_3330 && git checkout pr_3330
  • helm install agones ./install/helm/agones --namespace agones-system --set agones.image.registry=us-docker.pkg.dev/agones-images/ci --set agones.image.tag=1.35.0-dev-9b27097-amd64

@zmerlynn zmerlynn merged commit 4c51220 into googleforgames:main Aug 17, 2023
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug These are bugs. size/XS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants