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

Add Terraform templates #477

Merged
merged 1 commit into from
Jul 31, 2018
Merged

Add Terraform templates #477

merged 1 commit into from
Jul 31, 2018

Conversation

baniol
Copy link
Contributor

@baniol baniol commented Jul 4, 2018

What did you implement:

Closes #316

How did you implement it:

How can we verify it:

Todos:

  • Write tests
  • Write documentation
  • Fix linting errors
  • Make sure code coverage hasn't dropped
  • Provide verification commands / resources
  • Enable "Allow edits from maintainers" for this PR
  • Update the messages below

Is this ready for review?: YES
Is it a breaking change?: NO

@codecov
Copy link

codecov bot commented Jul 4, 2018

Codecov Report

Merging #477 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@          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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update c84ddec...b349a32. Read the comment docs.

@baniol baniol changed the title Add Terraform templates (#316) Add Terraform templates Jul 4, 2018
Copy link
Contributor

@mthenw mthenw left a 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.

Copy link
Contributor

@mthenw mthenw left a 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.

@@ -0,0 +1,31 @@
# Terraform templates for Event Gateway
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Can you move all those file to /contrib/terraform folder.
  2. 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.

Copy link
Contributor Author

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

@@ -0,0 +1,60 @@
data "aws_availability_zones" "available" {}
Copy link
Contributor

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?

Copy link
Contributor Author

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" {
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor Author

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).

Copy link
Contributor

Choose a reason for hiding this comment

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

Good point but looks like it should be possible.

screenshot 2018-07-06 09 10 09

Copy link
Contributor Author

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.

@@ -0,0 +1,10 @@
module "etcd" {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

@@ -0,0 +1,17 @@
module "event-gateway" {
source = "terraform"
Copy link
Contributor

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?

Copy link
Contributor Author

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

Copy link
Contributor

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
Copy link
Contributor

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

@baniol
Copy link
Contributor Author

baniol commented Jul 15, 2018

@mthenw A few notes regarding the latest commit:

  • the coreos etcd module is a part of Kubernetes setup in Tectonic installer and has some dependencies, like certificates, coreos ignition, dns. I've extracted those dependencies into the etcd wrapper (modules/etcd)
  • Tectonic Installer repo is under Apache v2 licence, so I've included the NOTICE file
  • it's possible to use https for the etcd (tls_enabled param), however eg libkv store does not initialize with tls config. I don't think this it a big issue for now, as the etcd cluster runs in private subnets.

@mthenw mthenw requested a review from sebito91 July 23, 2018 08:23
@mthenw
Copy link
Contributor

mthenw commented Jul 24, 2018

@baniol overall looks good. We need few days to review it. Again, thanks for contribution.

@sebito91 sebito91 self-assigned this Jul 26, 2018
@sebito91 sebito91 added the WIP label Jul 26, 2018
Copy link
Contributor

@sebito91 sebito91 left a 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.

@sebito91 sebito91 merged commit de6e4e0 into serverless:master Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants