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

Replace references to tectonic with openshift #644

Merged
merged 13 commits into from
Dec 5, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmd/openshift-install/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ var (
// FIXME: add longer descriptions for our commands with examples for better UX.
// Long: "",
},
assets: []asset.WritableAsset{&manifests.Manifests{}, &manifests.Tectonic{}},
assets: []asset.WritableAsset{&manifests.Manifests{}, &manifests.Openshift{}},
}

manifestTemplatesTarget = target{
Expand Down
104 changes: 52 additions & 52 deletions data/data/aws/main.tf
Original file line number Diff line number Diff line change
@@ -1,65 +1,65 @@
locals {
private_endpoints = "${var.tectonic_aws_endpoints == "public" ? false : true}"
public_endpoints = "${var.tectonic_aws_endpoints == "private" ? false : true}"
private_zone_id = "${var.tectonic_aws_external_private_zone != "" ? var.tectonic_aws_external_private_zone : join("", aws_route53_zone.tectonic_int.*.zone_id)}"
private_endpoints = "${var.aws_endpoints == "public" ? false : true}"
public_endpoints = "${var.aws_endpoints == "private" ? false : true}"
private_zone_id = "${var.aws_external_private_zone != "" ? var.aws_external_private_zone : join("", aws_route53_zone.int.*.zone_id)}"
}

provider "aws" {
region = "${var.tectonic_aws_region}"
region = "${var.aws_region}"
version = "1.39.0"

assume_role {
role_arn = "${var.tectonic_aws_installer_role == "" ? "" : "${var.tectonic_aws_installer_role}"}"
session_name = "TECTONIC_INSTALLER_${var.tectonic_cluster_name}"
role_arn = "${var.aws_installer_role == "" ? "" : "${var.aws_installer_role}"}"
session_name = "OPENSHIFT_INSTALLER_${var.cluster_name}"
}
}

module "bootstrap" {
source = "./bootstrap"

ami = "${var.tectonic_aws_ec2_ami_override}"
associate_public_ip_address = "${var.tectonic_aws_endpoints != "private"}"
cluster_name = "${var.tectonic_cluster_name}"
iam_role = "${var.tectonic_aws_master_iam_role_name}"
ami = "${var.aws_ec2_ami_override}"
associate_public_ip_address = "${var.aws_endpoints != "private"}"
cluster_name = "${var.cluster_name}"
iam_role = "${var.aws_master_iam_role_name}"
ignition = "${var.ignition_bootstrap}"
subnet_id = "${module.vpc.master_subnet_ids[0]}"
target_group_arns = "${module.vpc.aws_lb_target_group_arns}"
target_group_arns_length = "${module.vpc.aws_lb_target_group_arns_length}"
vpc_security_group_ids = ["${concat(var.tectonic_aws_master_extra_sg_ids, list(module.vpc.master_sg_id))}"]
vpc_security_group_ids = ["${concat(var.aws_master_extra_sg_ids, list(module.vpc.master_sg_id))}"]

tags = "${merge(map(
"Name", "${var.tectonic_cluster_name}-bootstrap",
"tectonicClusterID", "${var.tectonic_cluster_id}"
), var.tectonic_aws_extra_tags)}"
"Name", "${var.cluster_name}-bootstrap",
"tectonicClusterID", "${var.cluster_id}"
), var.aws_extra_tags)}"
}

module "masters" {
source = "./master"

base_domain = "${var.tectonic_base_domain}"
cluster_id = "${var.tectonic_cluster_id}"
cluster_name = "${var.tectonic_cluster_name}"
ec2_type = "${var.tectonic_aws_master_ec2_type}"
extra_tags = "${var.tectonic_aws_extra_tags}"
instance_count = "${var.tectonic_master_count}"
master_iam_role = "${var.tectonic_aws_master_iam_role_name}"
master_sg_ids = "${concat(var.tectonic_aws_master_extra_sg_ids, list(module.vpc.master_sg_id))}"
base_domain = "${var.base_domain}"
cluster_id = "${var.cluster_id}"
cluster_name = "${var.cluster_name}"
ec2_type = "${var.aws_master_ec2_type}"
extra_tags = "${var.aws_extra_tags}"
instance_count = "${var.master_count}"
master_iam_role = "${var.aws_master_iam_role_name}"
master_sg_ids = "${concat(var.aws_master_extra_sg_ids, list(module.vpc.master_sg_id))}"
public_endpoints = "${local.public_endpoints}"
root_volume_iops = "${var.tectonic_aws_master_root_volume_iops}"
root_volume_size = "${var.tectonic_aws_master_root_volume_size}"
root_volume_type = "${var.tectonic_aws_master_root_volume_type}"
root_volume_iops = "${var.aws_master_root_volume_iops}"
root_volume_size = "${var.aws_master_root_volume_size}"
root_volume_type = "${var.aws_master_root_volume_type}"
subnet_ids = "${module.vpc.master_subnet_ids}"
target_group_arns = "${module.vpc.aws_lb_target_group_arns}"
target_group_arns_length = "${module.vpc.aws_lb_target_group_arns_length}"
ec2_ami = "${var.tectonic_aws_ec2_ami_override}"
ec2_ami = "${var.aws_ec2_ami_override}"
user_data_ign = "${var.ignition_master}"
}

module "iam" {
source = "./iam"

cluster_name = "${var.tectonic_cluster_name}"
worker_iam_role = "${var.tectonic_aws_worker_iam_role_name}"
cluster_name = "${var.cluster_name}"
worker_iam_role = "${var.aws_worker_iam_role_name}"
}

module "dns" {
Expand All @@ -69,64 +69,64 @@ module "dns" {
api_external_lb_zone_id = "${module.vpc.aws_lb_api_external_zone_id}"
api_internal_lb_dns_name = "${module.vpc.aws_lb_api_internal_dns_name}"
api_internal_lb_zone_id = "${module.vpc.aws_lb_api_internal_zone_id}"
base_domain = "${var.tectonic_base_domain}"
cluster_name = "${var.tectonic_cluster_name}"
base_domain = "${var.base_domain}"
cluster_name = "${var.cluster_name}"
elb_alias_enabled = true
master_count = "${var.tectonic_master_count}"
master_count = "${var.master_count}"
private_zone_id = "${local.private_zone_id}"
external_vpc_id = "${module.vpc.vpc_id}"
extra_tags = "${var.tectonic_aws_extra_tags}"
extra_tags = "${var.aws_extra_tags}"
private_endpoints = "${local.private_endpoints}"
public_endpoints = "${local.public_endpoints}"
}

module "vpc" {
source = "./vpc"

base_domain = "${var.tectonic_base_domain}"
cidr_block = "${var.tectonic_aws_vpc_cidr_block}"
cluster_id = "${var.tectonic_cluster_id}"
cluster_name = "${var.tectonic_cluster_name}"
external_vpc_id = "${var.tectonic_aws_external_vpc_id}"
base_domain = "${var.base_domain}"
cidr_block = "${var.aws_vpc_cidr_block}"
cluster_id = "${var.cluster_id}"
cluster_name = "${var.cluster_name}"
external_vpc_id = "${var.aws_external_vpc_id}"

external_master_subnet_ids = "${compact(var.tectonic_aws_external_master_subnet_ids)}"
external_worker_subnet_ids = "${compact(var.tectonic_aws_external_worker_subnet_ids)}"
extra_tags = "${var.tectonic_aws_extra_tags}"
external_master_subnet_ids = "${compact(var.aws_external_master_subnet_ids)}"
external_worker_subnet_ids = "${compact(var.aws_external_worker_subnet_ids)}"
extra_tags = "${var.aws_extra_tags}"

// empty map subnet_configs will have the vpc module creating subnets in all availabile AZs
new_master_subnet_configs = "${var.tectonic_aws_master_custom_subnets}"
new_worker_subnet_configs = "${var.tectonic_aws_worker_custom_subnets}"
new_master_subnet_configs = "${var.aws_master_custom_subnets}"
new_worker_subnet_configs = "${var.aws_worker_custom_subnets}"

private_master_endpoints = "${local.private_endpoints}"
public_master_endpoints = "${local.public_endpoints}"
}

resource "aws_route53_record" "etcd_a_nodes" {
count = "${var.tectonic_master_count}"
count = "${var.master_count}"
type = "A"
ttl = "60"
zone_id = "${local.private_zone_id}"
name = "${var.tectonic_cluster_name}-etcd-${count.index}"
name = "${var.cluster_name}-etcd-${count.index}"
records = ["${module.masters.ip_addresses[count.index]}"]
}

resource "aws_route53_record" "etcd_cluster" {
type = "SRV"
ttl = "60"
zone_id = "${local.private_zone_id}"
name = "_etcd-server-ssl._tcp.${var.tectonic_cluster_name}"
name = "_etcd-server-ssl._tcp.${var.cluster_name}"
records = ["${formatlist("0 10 2380 %s", aws_route53_record.etcd_a_nodes.*.fqdn)}"]
}

resource "aws_route53_zone" "tectonic_int" {
count = "${local.private_endpoints ? "${var.tectonic_aws_external_private_zone == "" ? 1 : 0 }" : 0}"
resource "aws_route53_zone" "int" {
count = "${local.private_endpoints ? "${var.aws_external_private_zone == "" ? 1 : 0 }" : 0}"
vpc_id = "${module.vpc.vpc_id}"
name = "${var.tectonic_base_domain}"
name = "${var.base_domain}"
force_destroy = true

tags = "${merge(map(
"Name", "${var.tectonic_cluster_name}_tectonic_int",
"KubernetesCluster", "${var.tectonic_cluster_name}",
"tectonicClusterID", "${var.tectonic_cluster_id}"
), var.tectonic_aws_extra_tags)}"
"Name", "${var.cluster_name}_int",
"KubernetesCluster", "${var.cluster_name}",
"tectonicClusterID", "${var.cluster_id}"
), var.aws_extra_tags)}"
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,17 @@ locals {
private_endpoints_count = "${var.private_endpoints ? 1 : 0}"
}

data "aws_route53_zone" "tectonic" {
data "aws_route53_zone" "base" {
name = "${var.base_domain}"
}

locals {
public_zone_id = "${join("", data.aws_route53_zone.tectonic.*.zone_id)}"
public_zone_id = "${join("", data.aws_route53_zone.base.*.zone_id)}"

zone_id = "${var.private_endpoints ? var.private_zone_id : local.public_zone_id}"
}

resource "aws_route53_record" "tectonic_api_external" {
resource "aws_route53_record" "api_external" {
count = "${var.elb_alias_enabled ? local.public_endpoints_count : 0}"

zone_id = "${local.public_zone_id}"
Expand All @@ -27,7 +27,7 @@ resource "aws_route53_record" "tectonic_api_external" {
}
}

resource "aws_route53_record" "tectonic_api_internal" {
resource "aws_route53_record" "api_internal" {
count = "${var.elb_alias_enabled ? local.private_endpoints_count : 0}"

zone_id = "${var.private_zone_id}"
Expand Down
2 changes: 1 addition & 1 deletion data/data/aws/route53/master.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_route53_record" "master_nodes" {
count = "${var.elb_alias_enabled ? 0 : var.master_count}"
zone_id = "${data.aws_route53_zone.tectonic.zone_id}"
zone_id = "${data.aws_route53_zone.base.zone_id}"
name = "${var.cluster_name}-master-${count.index}"
type = "A"
ttl = "60"
Expand Down
4 changes: 2 additions & 2 deletions data/data/aws/route53/worker.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
resource "aws_route53_record" "worker_nodes" {
count = "${var.elb_alias_enabled ? 0 : var.worker_count}"
zone_id = "${data.aws_route53_zone.tectonic.zone_id}"
zone_id = "${data.aws_route53_zone.base.zone_id}"
name = "${var.cluster_name}-worker-${count.index}"
type = "A"
ttl = "60"
Expand All @@ -10,7 +10,7 @@ resource "aws_route53_record" "worker_nodes" {
resource "aws_route53_record" "worker_nodes_public" {
// hack: worker_public_ips_enabled is a workaround for https://github.com/hashicorp/terraform/issues/10857
count = "${var.worker_public_ips_enabled ? var.worker_count : 0}"
zone_id = "${data.aws_route53_zone.tectonic.zone_id}"
zone_id = "${data.aws_route53_zone.base.zone_id}"
name = "${var.cluster_name}-worker-${count.index}-public"
type = "A"
ttl = "60"
Expand Down
Loading