Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Conversation

@squat
Copy link
Contributor

@squat squat commented May 16, 2018

This commit enables the existing VPC functionality that was already
built into the installer by fixing several bugs related to the
processing of AWS private zone IDs.

Thanks to @yifan-gu's recent changes in #3219.

I tested with ~10 clusters and was able to bring up clusters in existing VPC each time.

cc @yifan-gu @enxebre

This commit enables the existing VPC functionality that was already
built into the installer by fixing several bugs related to the
processing of AWS private zone IDs.
@squat squat changed the title modulus,steps: enable existing vpc modules,steps: enable existing vpc May 16, 2018
}

resource "aws_route53_zone" "tectonic_int" {
count = "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.

this resource was never used :/

Copy link
Contributor

Choose a reason for hiding this comment

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

Does this mean we're not doing split horizon anymore?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we still have split horizon, it was just moved somewhere else and this was never cleaned up: https://github.com/coreos/tectonic-installer/blob/master/steps/topology/aws/main.tf#L22

Copy link
Contributor

Choose a reason for hiding this comment

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

Got it. Makes sense then. All cool!

# TNC
output "private_zone_id" {
value = "${aws_route53_zone.tectonic_int.id}"
value = "${join("", aws_route53_zone.tectonic_int.*.zone_id)}"
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm curious if you considered to use a ternary here to return either tectonic_aws_external_private_zone or aws_route53_zone.tectonic_int.*.zone_id then it would be transparent for consumers steps, so the private_zone_id input wouldn't need to do the check and could keep just private_zone_id = "${data.terraform_remote_state.topology.private_zone_id}"

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 did, but I decided against it for consistency and clarity. Otherwise, I foresee a near future where someone forgets that this variable is already the result of a ternary and adds another ternary on top. It wouldn't hurt the output but it is muddy.

@enxebre
Copy link
Contributor

enxebre commented May 16, 2018

Nice! Thanks for putting this back. LGTM once is green.
Thought aside from this PR: In the future we might want to consider to avoid conditionals and to evolve the model to the point where deploying on a pre-existing vpc means just skip the "vpc" step and supply the expected user inputs for the remaining steps

@dcondomitti
Copy link

dcondomitti commented May 17, 2018

I just tested this and deploying into an existing VPC worked except that my ELBs and masters have public IPs despite being in private subnets (autoassign public IP is off). The cluster seemed healthy (all instances in service according to the ELBs) though so provisioning is working properly. I can open a separate issue for this if needed.

aws:
  etcd:
    ec2Type: m4.large
    iamRoleName: dcondomitti-worker
    rootVolume:
      size: 32
      type: gp2
  master:
    ec2Type: m4.large
    iamRoleName: dcondomitti-master
    rootVolume:
      size: 32
      type: gp2
  vpcCIDRBlock: 10.0.0.0/16
  worker:
    ec2Type: m4.large
    iamRoleName: dcondomitti-worker
    rootVolume:
      size: 32
      type: gp2
  sshKey: dcondomitti
  external:
    masterSubnetIDs:
      - subnet-x # three private subnets in us-west-2a, 2b, 2c
      - subnet-x
      - subnet-x
    privateZone: MYZONEID # records were created properly in the private zone
    vpcID: vpc-x
    workerSubnetIDs:
      - subnet-y # three different private subnets in us-west-2a, 2b, 2c
      - subnet-y
      - subnet-y
  installerRole: arn:aws:iam::fe-aws:role/tectonic-installer
  publicEndpoints: false
  privateEndpoints: true
  profile: coreos
  region: us-west-2
baseDomain: privatezone.example.com
containerLinux:
  channel: stable
ddns:
  key:
iscsi:
etcd:
  nodePools:
    - etcd
master:
  nodePools:
    - master
name: ot-priv
networking:
  podCIDR: 10.2.0.0/16
  serviceCIDR: 10.3.0.0/16
  type: flannel
nodePools:
  - count: 3
    name: etcd
  - count: 2
    name: master
  - count: 2
    name: worker
platform: AWS
licensePath: ~/projects/coreos/secrets/license.txt
pullSecretPath: ~/projects/coreos/secrets/pull-secret.json
worker:
  nodePools:
    - worker
admin:
  email: [email protected]
  password: x

@squat
Copy link
Contributor Author

squat commented May 17, 2018

@dcondomitti yes please do; that is a separate issue

Copy link
Contributor

@trawler trawler left a comment

Choose a reason for hiding this comment

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

lgtm

@squat squat merged commit dc3b603 into coreos:master May 17, 2018
@squat squat deleted the evpc branch May 17, 2018 14:46
wking added a commit to wking/openshift-installer that referenced this pull request Jan 10, 2019
The last consumer of these variables was removed by 4360905
(modulus,steps: enable existing vpc, 2018-05-16,
coreos/tectonic-installer#3231).  Now the route53 module only creates
aws_route53_record resources, and they don't support tags [1].

[1]: https://www.terraform.io/docs/providers/aws/r/route53_record.html
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants