-
Notifications
You must be signed in to change notification settings - Fork 98
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
Add Terraform templates #477
Conversation
Codecov Report
@@ Coverage Diff @@
## master #477 +/- ##
======================================
Coverage 71.2% 71.2%
======================================
Files 37 37
Lines 2195 2195
======================================
Hits 1563 1563
Misses 571 571
Partials 61 61 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @baniol,
that looks awesome. Thanks for the great PR. I have few comments though.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @baniol,
that looks awesome. Thanks for the great PR. I have few comments though.
terraform/README.md
Outdated
@@ -0,0 +1,31 @@ | |||
# Terraform templates for Event Gateway |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Can you move all those file to
/contrib/terraform
folder. - Ideally would be to expose it as a module that someone else can use. So I think this readme should be mainly about how to use this module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a problem. I'll refactor it in that direction
terraform/network.tf
Outdated
@@ -0,0 +1,60 @@ | |||
data "aws_availability_zones" "available" {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using existing module for creating VPC and all network stuff https://registry.terraform.io/modules/terraform-aws-modules/vpc/aws/1.37.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right. Using some community modules makes sense.
terraform/alb.tf
Outdated
} | ||
|
||
# Config load balancer | ||
resource "aws_lb" "config" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This module should probably simplify the setup here https://registry.terraform.io/modules/terraform-aws-modules/alb/aws/3.4.0?tab=resources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The problem with this module is that it doesn't seem to allow to control target group health checks. We need to overwrite the default "/" path with "/v1/status". What's more, the events API server doesn't expose any health check endpoint returning 200 code (the root returns 202).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I've missed the default section. Works perfectly with the alb module.
terraform/etcd.tf
Outdated
@@ -0,0 +1,10 @@ | |||
module "etcd" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What do you think about using existing module from CoreOS https://github.com/coreos/tectonic-installer/tree/track-1/modules/aws/etcd?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first glance, it seems like an internal tectonic installer module, but might be useful. I'll check it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one will be harder to use as it is. Etcd is integrated with the k8s installer and has some internal dependencies, like dns, certs or s3 bucket with init scripts.
I need to take a deeper look.
contrib/example.tf
Outdated
@@ -0,0 +1,17 @@ | |||
module "event-gateway" { | |||
source = "terraform" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change it to full github URL so people can just copy/paste?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure, I'll do a little refactor and add a readme file when I'm done with the etcd module
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome thanks!
.gitignore
Outdated
@@ -8,3 +8,4 @@ default.etcd* | |||
coverage.txt | |||
profile.out | |||
tests/testing.etcd* | |||
.terraform |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need this here if it's only a module
@mthenw A few notes regarding the latest commit:
|
@baniol overall looks good. We need few days to review it. Again, thanks for contribution. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this looks good. Just like your other PR if you can please rebase against current commits we'll merge.
What did you implement:
Closes #316
How did you implement it:
How can we verify it:
Todos:
Is this ready for review?: YES
Is it a breaking change?: NO