Skip to content

GCE node driver improvements#345

Merged
HarrisonWAffel merged 2 commits into
rancher:masterfrom
HarrisonWAffel:gce-updates
May 28, 2025
Merged

GCE node driver improvements#345
HarrisonWAffel merged 2 commits into
rancher:masterfrom
HarrisonWAffel:gce-updates

Conversation

@HarrisonWAffel

@HarrisonWAffel HarrisonWAffel commented May 19, 2025

Copy link
Copy Markdown

Issue: rancher/rancher#49681

This PR updates the GCE driver so that it can be used by Rancher. Primary changes include,

  • Renames the existing GOOGLE_APPLICATION_CREDENTIALS_ENCODED_JSON environment variable to GOOGLE_AUTH_ENCODED_JSON, and no falls back to using the plain text value if the value is not base64 encoded. This is the primary change required to use this driver in Rancher.
  • Introduces two new flags for building network firewall rules when exposing ports publicly and internally
    • In order to open ports publicly, the google-external-firewall-rule-prefix flag must be provided as well as one or more instances of google-open-port
    • If the google-internal-firewall-rule-prefix flag is provided, a network firewall rule will be generated to allow for nodes to communicate with one another using a set list of ports. If additional internal only ports are required, users can create additional firewall rules and specify the associated network tags when creating the VM.
    • During VM deletion these rules will be automatically cleaned up if no other VM are utilizing them
  • Adds a new flag for specifying labels on VMs (which are distinct from tags)
  • Updates the default image to a more recent version of ubuntu

I've tested this both in Rancher and using the CLI, I've also updated the existing unit tests and added a few more cases.

@HarrisonWAffel HarrisonWAffel force-pushed the gce-updates branch 5 times, most recently from b293317 to 86867cf Compare May 19, 2025 21:44
@HarrisonWAffel HarrisonWAffel marked this pull request as ready for review May 19, 2025 22:02
@HarrisonWAffel HarrisonWAffel requested a review from a team May 19, 2025 22:02

@jakefhyde jakefhyde left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple nits

Comment thread drivers/google/compute_util.go Outdated
Comment thread drivers/google/compute_util.go Outdated
Comment thread drivers/google/compute_util.go
@HarrisonWAffel HarrisonWAffel requested review from a team and jakefhyde May 21, 2025 18:19
@HarrisonWAffel HarrisonWAffel force-pushed the gce-updates branch 4 times, most recently from 4aa8fdb to 0664d08 Compare May 27, 2025 20:37
Comment thread drivers/google/google.go Outdated
Comment thread drivers/google/compute_util.go Outdated
Comment thread drivers/google/compute_util.go Outdated
Comment thread drivers/google/google.go Outdated
jiaqiluo
jiaqiluo previously approved these changes May 27, 2025

@jiaqiluo jiaqiluo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Job!
LGTM 💯

@jakefhyde jakefhyde left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few nits

Comment thread drivers/google/compute_util_test.go Outdated
Comment thread drivers/google/google.go Outdated
@HarrisonWAffel HarrisonWAffel merged commit f6ff225 into rancher:master May 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants