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

feat(docs): Example Gateway terraform module for GCP #4011

Merged
merged 15 commits into from
Mar 12, 2024

Conversation

jamilbk
Copy link
Member

@jamilbk jamilbk commented Mar 6, 2024

Adds a working example of the simplest way to deploy Gateways to GCP that is also mostly cloud platform agnostic.

I avoided using COS and Docker for this because:

  • Systemd is already installed and supports IPv6 already
  • Can be more easily adapted to other platforms where Docker may not be available or trickier to setup (E.g. CentOS 7)
  • COS is Google-specific

Copy link

vercel bot commented Mar 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
firezone ✅ Ready (Inspect) Visit Preview 💬 Add feedback Mar 12, 2024 6:02pm

Copy link

github-actions bot commented Mar 6, 2024

Performance Test Results

TCP

Test Name Received/s Sent/s Retransmits
direct-tcp-client2server 189.1 MiB (-2%) 189.7 MiB (-2%) 195 (-18%)
direct-tcp-server2client 198.0 MiB (+2%) 199.6 MiB (+2%) 697 (-28%)
relayed-tcp-client2server 136.3 MiB (-2%) 137.1 MiB (-2%) 182 (+35%)
relayed-tcp-server2client 139.3 MiB (-0%) 139.7 MiB (-1%) 148 (-26%)

UDP

Test Name Total/s Jitter Lost
direct-udp-client2server 50.0 MiB (-0%) 0.04ms (-40%) 0.00% (NaN%)
direct-udp-server2client 50.0 MiB (+0%) 0.04ms (-13%) 0.00% (NaN%)
relayed-udp-client2server 50.0 MiB (-0%) 0.19ms (+30%) 0.00% (NaN%)
relayed-udp-server2client 50.0 MiB (-0%) 0.06ms (-9%) 0.00% (NaN%)

jamilbk added a commit that referenced this pull request Mar 7, 2024
This prevents us from backslack escape hell when trying to expose this
script in different contexts.

Needed as a pre-req to #4011
Copy link

github-actions bot commented Mar 7, 2024

Terraform Cloud Plan Output

Plan: 8 to add, 7 to change, 8 to destroy.

Terraform Cloud Plan

@jamilbk
Copy link
Member Author

jamilbk commented Mar 7, 2024

refs #4029

@jamilbk jamilbk requested a review from bmanifold March 7, 2024 19:28
@jamilbk jamilbk enabled auto-merge March 7, 2024 19:56
@jamilbk jamilbk changed the title feat(docs): Example Gateway terraform for GCP feat(docs): Example Gateway terraform module for GCP Mar 11, 2024
source_ranges = ["0.0.0.0/0"]
}

resource "google_compute_instance_from_template" "gateway" {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should not promote deploying like this, what we really want is a regional instance group manager.

This way of deploying makes zero-downtime upgrades very hard to do (because all instances will be rebooted at the same time). So everything we have in ### Minimal downtime upgrades doesn't make any sense to do.

Additionally, we must use instance groups because that's the only way to roll out using health checks (so that instance health can be checked before taking down the next one). Once #2465 is closed we should go and update everything to start using them.

Copy link
Member Author

Choose a reason for hiding this comment

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

So everything we have in ### Minimal downtime upgrades doesn't make any sense to do.

If the input vars (token) aren't changed for an instance_template then terraform won't roll them over, at least based on my testing.

Once #2465 is closed we should go and update everything to start using them.

Does that mean that issue is a blocker for merging this?

This is meant to serve as a basic example for a customer -- I think it's worth having basic examples for users who don't need minimal downtime deploys and would rather have something simple to get up and running with quickly.

Copy link
Member Author

Choose a reason for hiding this comment

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

I updated this example with a Future improvements section that includes this and some customer feedback. Also removed the "Minimal downtime upgrades" section since that's not quite where we want to steer customers per your feedback.

Copy link
Collaborator

Choose a reason for hiding this comment

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

If the input vars (token) aren't changed for an instance_template then terraform won't roll them over, at least based on my testing.

If we release a new version it will roll them over.

Does that mean that issue is a blocker for merging this?

Nope, we still can have zero-downtime deployment using the proper boot timeouts. It's just not as reliable as health checks.

This is meant to serve as a basic example for a customer -- I think it's worth having basic examples for users who don't need minimal downtime deploys and would rather have something simple to get up and running with quickly.

To use a regional instance group we only need to replace instance_from_template with another kind of resource so complexity-wise is about the same but the example will give a better way to deploy and manage replicated apps. Since it's already merged I can update the example later.

jamilbk and others added 8 commits March 11, 2024 10:53
Co-authored-by: Andrew Dryga <andrew@dryga.com>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
Co-authored-by: Andrew Dryga <andrew@dryga.com>
Signed-off-by: Jamil <jamilbk@users.noreply.github.com>
@jamilbk jamilbk disabled auto-merge March 12, 2024 17:56
@jamilbk
Copy link
Member Author

jamilbk commented Mar 12, 2024

Customer verified it to work, merging to receive further input from customer

@jamilbk jamilbk merged commit 81ef6ce into main Mar 12, 2024
41 of 42 checks passed
@jamilbk jamilbk deleted the feat/gcp-gateway-example branch March 12, 2024 17:57
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.

None yet

3 participants