diff --git a/Documentation/dev/libvirt-howto.md b/Documentation/dev/libvirt-howto.md index 89e485a8af1..78de5b713a4 100644 --- a/Documentation/dev/libvirt-howto.md +++ b/Documentation/dev/libvirt-howto.md @@ -80,7 +80,7 @@ echo server=/tt.testing/192.168.124.1 | sudo tee /etc/NetworkManager/dnsmasq.d/t 1. Make sure you have the `virsh` binary installed: `sudo dnf install libvirt-client libvirt-devel` 2. Install the libvirt terraform provider: ```sh -go get github.com/dmacvicar/terraform-provider-libvirt +go get github.com/crawford/terraform-provider-libvirt mkdir -p ~/.terraform.d/plugins cp $GOPATH/bin/terraform-provider-libvirt ~/.terraform.d/plugins/ ``` diff --git a/Documentation/dev/node-bootstrap-flow.md b/Documentation/dev/node-bootstrap-flow.md index b21e4b0c380..31edb5a315a 100644 --- a/Documentation/dev/node-bootstrap-flow.md +++ b/Documentation/dev/node-bootstrap-flow.md @@ -47,12 +47,6 @@ WantedBy=multi-user.target This service is enabled by default and can crash-loop until success. It is started on every boot. -### `rm-assets.service` - -This service waits for the bootkube and tectonic process to be completed. -It is a oneshot service, thus marked as started only once the script returns with success. -This is an optional service only present on platforms which pull assets from block storage. - ## Diagram This is a visual simplified representation of the overall bootstrapping flow. @@ -64,30 +58,29 @@ Legend: * k.s -> kubelet.service * b.s -> bootkube.service * t.s -> tectonic.service - * rm.s -> rm-assets.service - -.--------------------------------------------------------------------------------------------------------------------------------+ -| | -| Provision cloud/userdata +----------+ | -| ,---------------------------------------o| TF | | -| | +----------+ | -| | | -| | | -| | | -| | | -| V | -| +-------+ Before +------------+ Before | -| | IGN | .--------------->| k.s |o--------. | -| +-------+ | +------------+ | | -| | | ^ | | +-----+ Before +-------+ Before +-----+ | -| '----------------------' | v '--->| b.s |o--------------->| t.s |--------> |rm.s | | -| Enable '------' +-----+ +-------+ +-----+ | -| | -| | -| o o | -| | | | -| | * Each boot | * First boot | -| | * All nodes | * Bootkube master | -| | | | -'---------------------------------------o----------------------------o-----------------------------------------------------------+ + +.-----------------------------------------------------------------------------------------------------------+ +| | +| Provision cloud/userdata +----------+ | +| ,---------------------------------------o| TF | | +| | +----------+ | +| | | +| | | +| | | +| | | +| V | +| +-------+ Before +------------+ Before | +| | IGN | .--------------->| k.s |o--------. | +| +-------+ | +------------+ | | +| | | ^ | | +-----+ Before +-------+ | +| '----------------------' | v '--->| b.s |o--------------->| t.s | | +| Enable '------' +-----+ +-------+ | +| | +| | +| o o | +| | | | +| | * Each boot | * First boot | +| | * All nodes | * Bootkube master | +| | | | +'---------------------------------------o----------------------------o--------------------------------------+ ``` diff --git a/config.tf b/config.tf index 6e76af3d605..d2258d7f48d 100644 --- a/config.tf +++ b/config.tf @@ -58,20 +58,19 @@ variable "tectonic_container_images" { default = { addon_resizer = "gcr.io/google_containers/addon-resizer:2.1" - awscli = "quay.io/coreos/awscli:025a357f05242fdad6a81e8a6b520098aa65a600" bootkube = "quay.io/coreos/bootkube:v0.10.0" - tnc_operator = "quay.io/coreos/tectonic-node-controller-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" + tnc_operator = "quay.io/coreos/tectonic-node-controller-operator-dev:32681d92536d3e180604622825ee76935d0a5692" etcd_cert_signer = "quay.io/coreos/kube-etcd-signer-server:678cc8e6841e2121ebfdb6e2db568fce290b67d6" etcd = "quay.io/coreos/etcd:v3.2.14" hyperkube = "openshift/origin-node:latest" - kube_core_renderer = "quay.io/coreos/kube-core-renderer-dev:6705af4bcf26f899e347c88ffddc892a236648e4" - kube_core_operator = "quay.io/coreos/kube-core-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" - tectonic_channel_operator = "quay.io/coreos/tectonic-channel-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" - kube_addon_operator = "quay.io/coreos/kube-addon-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" + kube_core_renderer = "quay.io/coreos/kube-core-renderer-dev:32681d92536d3e180604622825ee76935d0a5692" + kube_core_operator = "quay.io/coreos/kube-core-operator-dev:32681d92536d3e180604622825ee76935d0a5692" + tectonic_channel_operator = "quay.io/coreos/tectonic-channel-operator-dev:32681d92536d3e180604622825ee76935d0a5692" + kube_addon_operator = "quay.io/coreos/kube-addon-operator-dev:32681d92536d3e180604622825ee76935d0a5692" tectonic_alm_operator = "quay.io/coreos/tectonic-alm-operator:v0.3.1" - tectonic_ingress_controller_operator = "quay.io/coreos/tectonic-ingress-controller-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" - tectonic_utility_operator = "quay.io/coreos/tectonic-utility-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" - tectonic_network_operator = "quay.io/coreos/tectonic-network-operator-dev:6705af4bcf26f899e347c88ffddc892a236648e4" + tectonic_ingress_controller_operator = "quay.io/coreos/tectonic-ingress-controller-operator-dev:32681d92536d3e180604622825ee76935d0a5692" + tectonic_utility_operator = "quay.io/coreos/tectonic-utility-operator-dev:32681d92536d3e180604622825ee76935d0a5692" + tectonic_network_operator = "quay.io/coreos/tectonic-network-operator-dev:32681d92536d3e180604622825ee76935d0a5692" } } @@ -333,12 +332,12 @@ variable "tectonic_kubelet_debug_config" { description = "(internal) debug flags for the kubelet (used in CI only)" } -variable "tectonic_ignition_master" { - type = "string" - default = "" +variable "tectonic_ignition_masters" { + type = "list" + default = [] description = < 0 { if len(l.MasterIPs) != masterCount { return fmt.Errorf("length of MasterIPs doesn't match master count") } - return nil + } else { + if ips, err := generateIPs("master", network, masterCount, 11); err == nil { + l.MasterIPs = ips + } else { + return err + } } - for i := 0; i < masterCount; i++ { - ip, err := cidr.Host(network, i+10) - if err != nil { - return fmt.Errorf("failed to generate master IPs: %v", err) + if len(l.WorkerIPs) > 0 { + if len(l.WorkerIPs) != workerCount { + return fmt.Errorf("length of WorkerIPs doesn't match worker count") + } + } else { + if ips, err := generateIPs("worker", network, workerCount, 50); err == nil { + l.WorkerIPs = ips + } else { + return err + } + } + + if len(l.EtcdIPs) > 0 { + if len(l.EtcdIPs) != etcdCount { + return fmt.Errorf("length of EtcdIPs doesn't match etcd count") + } + } else { + if ips, err := generateIPs("etcd", network, etcdCount, 20); err == nil { + l.EtcdIPs = ips + } else { + return err } - l.MasterIPs = append(l.MasterIPs, ip.String()) } return nil } + +func generateIPs(name string, network *net.IPNet, count int, offset int) ([]string, error) { + var ips []string + for i := 0; i < count; i++ { + ip, err := cidr.Host(network, offset+i) + if err != nil { + return nil, fmt.Errorf("failed to generate %s IPs: %v", name, err) + } + ips = append(ips, ip.String()) + } + + return ips, nil +} diff --git a/installer/pkg/workflow/destroy.go b/installer/pkg/workflow/destroy.go index 21cf5dccd99..e1e5d39b4af 100644 --- a/installer/pkg/workflow/destroy.go +++ b/installer/pkg/workflow/destroy.go @@ -10,9 +10,7 @@ func DestroyWorkflow(clusterDir string) Workflow { refreshConfigStep, destroyJoinMastersStep, destroyJoinWorkersStep, - destroyEtcdStep, destroyBootstrapStep, - destroyTNCDNSStep, destroyTopologyStep, destroyAssetsStep, }, @@ -23,16 +21,8 @@ func destroyAssetsStep(m *metadata) error { return runDestroyStep(m, assetsStep) } -func destroyEtcdStep(m *metadata) error { - return runDestroyStep(m, etcdStep) -} - func destroyBootstrapStep(m *metadata) error { - return runDestroyStep(m, mastersStep, []string{bootstrapOff}...) -} - -func destroyTNCDNSStep(m *metadata) error { - return destroyTNCDNS(m) + return runDestroyStep(m, bootstrapStep) } func destroyTopologyStep(m *metadata) error { @@ -44,7 +34,7 @@ func destroyJoinWorkersStep(m *metadata) error { } func destroyJoinMastersStep(m *metadata) error { - return runDestroyStep(m, mastersStep, []string{bootstrapOff}...) + return runDestroyStep(m, mastersStep) } func runDestroyStep(m *metadata, step string, extraArgs ...string) error { diff --git a/installer/pkg/workflow/fixtures/terraform.tfvars b/installer/pkg/workflow/fixtures/terraform.tfvars index 81c9c3f1227..2df6cca97c9 100644 --- a/installer/pkg/workflow/fixtures/terraform.tfvars +++ b/installer/pkg/workflow/fixtures/terraform.tfvars @@ -22,7 +22,10 @@ "tectonic_container_linux_version": "latest", "tectonic_etcd_count": 3, "tectonic_ignition_etcd": "etcd.ign", - "tectonic_ignition_master": "master.ign", + "tectonic_ignition_masters": [ + "master-0.ign", + "master-1.ign" + ], "tectonic_ignition_worker": "worker.ign", "tectonic_libvirt_network_if": "osbr0", "tectonic_libvirt_resolver": "8.8.8.8", diff --git a/installer/pkg/workflow/install.go b/installer/pkg/workflow/install.go index e3d6bc39ebf..e1f9fbf160c 100644 --- a/installer/pkg/workflow/install.go +++ b/installer/pkg/workflow/install.go @@ -22,10 +22,7 @@ func InstallFullWorkflow(clusterDir string) Workflow { installAssetsStep, generateIgnConfigStep, installTopologyStep, - installTNCCNAMEStep, installBootstrapStep, - installTNCARecordStep, - installEtcdStep, installJoinMastersStep, installJoinWorkersStep, }, @@ -66,10 +63,7 @@ func InstallBootstrapWorkflow(clusterDir string) Workflow { steps: []step{ refreshConfigStep, installTopologyStep, - installTNCCNAMEStep, installBootstrapStep, - installTNCARecordStep, - installEtcdStep, }, } } @@ -104,28 +98,13 @@ func installTopologyStep(m *metadata) error { func installBootstrapStep(m *metadata) error { if !clusterIsBootstrapped(m.clusterDir) { - return runInstallStep(m, mastersStep, []string{bootstrapOn}...) + return runInstallStep(m, bootstrapStep) } return nil } -func installTNCCNAMEStep(m *metadata) error { - if !clusterIsBootstrapped(m.clusterDir) { - return createTNCCNAME(m) - } - return nil -} - -func installTNCARecordStep(m *metadata) error { - return createTNCARecord(m) -} - -func installEtcdStep(m *metadata) error { - return runInstallStep(m, etcdStep) -} - func installJoinMastersStep(m *metadata) error { - return runInstallStep(m, mastersStep, []string{bootstrapOff}...) + return runInstallStep(m, mastersStep) } func installJoinWorkersStep(m *metadata) error { diff --git a/installer/pkg/workflow/utils.go b/installer/pkg/workflow/utils.go index 751a9e26866..d768b664872 100644 --- a/installer/pkg/workflow/utils.go +++ b/installer/pkg/workflow/utils.go @@ -14,17 +14,14 @@ import ( const ( assetsStep = "assets" + bootstrapStep = "bootstrap" binaryPrefix = "installer" - bootstrapOff = "-var=tectonic_bootstrap=false" - bootstrapOn = "-var=tectonic_bootstrap=true" configFileName = "config.yaml" - etcdStep = "etcd" internalFileName = "internal.yaml" joinWorkersStep = "joining_workers" mastersStep = "masters" newTLSStep = "tls" stepsBaseDir = "steps" - tncDNSStep = "tnc_dns" topologyStep = "topology" ) @@ -165,18 +162,5 @@ func baseLocation() (string, error) { func clusterIsBootstrapped(stateDir string) bool { return hasStateFile(stateDir, topologyStep) && - hasStateFile(stateDir, mastersStep) && - hasStateFile(stateDir, tncDNSStep) -} - -func createTNCCNAME(m *metadata) error { - return runInstallStep(m, tncDNSStep, []string{bootstrapOn}...) -} - -func createTNCARecord(m *metadata) error { - return runInstallStep(m, tncDNSStep, []string{bootstrapOff}...) -} - -func destroyTNCDNS(m *metadata) error { - return runDestroyStep(m, tncDNSStep, []string{bootstrapOff}...) + hasStateFile(stateDir, bootstrapStep) } diff --git a/modules/aws/etcd/README.md b/modules/aws/etcd/README.md deleted file mode 100644 index 4776ff2d9a0..00000000000 --- a/modules/aws/etcd/README.md +++ /dev/null @@ -1,73 +0,0 @@ -# AWS Etcd Module - -This [Terraform][] [module][] makes it easy to create [etcd][] nodes on [AWS][]. - -Read the [etcd recommended hardware guide][hardware] for best performance. - -## Example - -```hcl -locals { - region = "us-east-1" -} - -provider "aws" { - region = "${local.region}" -} - -resource "aws_s3_bucket" "etcd_ignition" { -} - -resource "aws_vpc" "example" { - cidr_block = "10.0.0.0/16" - enable_dns_hostnames = true - enable_dns_support = true -} - -resource "aws_subnet" "example" { - vpc_id = "${aws_vpc.example.id}" - cidr_block = "${aws_vpc.example.cidr_block}" -} - -resource "aws_security_group" "etcd" { - vpc_id = "${aws_vpc.example.id}" - - ingress { - from_port = 2379 - to_port = 2380 - protocol = "tcp" - cidr_blocks = ["${aws_subnet.example.cidr_block}"] - } - - egress { - from_port = 0 - to_port = 0 - protocol = "-1" - cidr_blocks = ["${aws_subnet.example.cidr_block}"] - } -} - -module "etcd" { - source = "github.com/openshift/installer//modules/aws/etcd" - - base_domain = "openshift.example.com" - cluster_id = "123" - cluster_name = "my-cluster" - instance_count = "3" - region = "${local.region}" - s3_bucket = "${aws_s3_bucket.etcd_ignition.id}" - sg_ids = ["${aws_security_group.etcd.id}"] - subnets = ["${aws_subnet.example.id}"] -} -``` - -You can set `container_linux_channel` and `container_linux_version` if you need a specific [Container Linux][container-linux] install. -Alternatively, you can set `ec2_ami` directly if you want to use an [AMI][] that is not Container Linux. - -[AMI]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html -[AWS]: https://aws.amazon.com/ -[container-linux]: https://coreos.com/os/docs/latest/ -[etcd]: https://github.com/coreos/etcd -[hardware]: https://github.com/coreos/etcd/blob/v3.3.8/Documentation/op-guide/hardware.md#example-hardware-configurations -[module]: https://www.terraform.io/docs/modules/ -[Terraform]: https://www.terraform.io/ diff --git a/modules/aws/etcd/ignition.tf b/modules/aws/etcd/ignition.tf deleted file mode 100644 index 1f9053e14d2..00000000000 --- a/modules/aws/etcd/ignition.tf +++ /dev/null @@ -1,16 +0,0 @@ -data "ignition_config" "tnc" { - count = "${var.instance_count}" - - append { - source = "${format("http://${var.cluster_name}-tnc.${var.base_domain}/config/etcd?etcd_index=%d", count.index)}" - - # TODO: add verification - } - - # Used for loading certificates - append { - source = "${format("s3://%s/ignition_etcd_%d.json", var.s3_bucket, count.index)}" - - # TODO: add verification - } -} diff --git a/modules/aws/etcd/nodes.tf b/modules/aws/etcd/nodes.tf deleted file mode 100644 index d87d7b49e56..00000000000 --- a/modules/aws/etcd/nodes.tf +++ /dev/null @@ -1,119 +0,0 @@ -locals { - arn = "aws" -} - -module "ami" { - source = "../ami" - - region = "${var.region}" - release_channel = "${var.container_linux_channel}" - release_version = "${var.container_linux_version}" -} - -resource "aws_iam_instance_profile" "etcd" { - name = "${var.cluster_name}-etcd-profile" - - role = "${var.etcd_iam_role == "" ? - join("|", aws_iam_role.etcd_role.*.name) : - join("|", data.aws_iam_role.etcd_role.*.name) - }" -} - -data "aws_iam_role" "etcd_role" { - count = "${var.etcd_iam_role == "" ? 0 : 1}" - name = "${var.etcd_iam_role}" -} - -resource "aws_iam_role" "etcd_role" { - count = "${var.etcd_iam_role == "" ? 1 : 0}" - name = "${var.cluster_name}-etcd-role" - path = "/" - - assume_role_policy = <${var.tectonic_cluster_name}-api${var.tectonic_cluster_name}-tnc\" --live --config" - } -} diff --git a/steps/tnc_dns/libvirt/variables-libvirt.tf b/steps/tnc_dns/libvirt/variables-libvirt.tf deleted file mode 120000 index 0b2a79a7f6f..00000000000 --- a/steps/tnc_dns/libvirt/variables-libvirt.tf +++ /dev/null @@ -1 +0,0 @@ -../../variables-libvirt.tf \ No newline at end of file diff --git a/steps/topology/aws/inputs.tf b/steps/topology/aws/inputs.tf deleted file mode 100644 index ade2b1619a0..00000000000 --- a/steps/topology/aws/inputs.tf +++ /dev/null @@ -1,11 +0,0 @@ -data "terraform_remote_state" "assets" { - backend = "local" - - config { - path = "${path.cwd}/assets.tfstate" - } -} - -locals { - ignition_bootstrap = "${data.terraform_remote_state.assets.ignition_bootstrap}" -} diff --git a/steps/topology/aws/main.tf b/steps/topology/aws/main.tf index 354c90f7403..932319e4b0e 100644 --- a/steps/topology/aws/main.tf +++ b/steps/topology/aws/main.tf @@ -72,3 +72,15 @@ module "dns" { private_endpoints = "${local.private_endpoints}" public_endpoints = "${local.public_endpoints}" } + +resource "aws_route53_record" "tectonic_tnc_a" { + zone_id = "${var.tectonic_aws_external_private_zone != "" ? var.tectonic_aws_external_private_zone : join("", aws_route53_zone.tectonic_int.*.zone_id)}" + name = "${var.tectonic_cluster_name}-tnc.${var.tectonic_base_domain}" + type = "A" + + alias { + name = "${module.vpc.aws_elb_tnc_dns_name}" + zone_id = "${module.vpc.aws_elb_tnc_zone_id}" + evaluate_target_health = true + } +} diff --git a/steps/topology/aws/outputs.tf b/steps/topology/aws/outputs.tf index 158c20df274..bb02187e9c8 100644 --- a/steps/topology/aws/outputs.tf +++ b/steps/topology/aws/outputs.tf @@ -29,19 +29,6 @@ output "worker_sg_id" { value = "${module.vpc.worker_sg_id}" } -# TNC output "private_zone_id" { value = "${join("", aws_route53_zone.tectonic_int.*.zone_id)}" } - -output "tnc_elb_dns_name" { - value = "${module.vpc.aws_elb_tnc_dns_name}" -} - -output "tnc_elb_zone_id" { - value = "${module.vpc.aws_elb_tnc_zone_id}" -} - -output "tnc_s3_bucket_domain_name" { - value = "${aws_s3_bucket.tectonic.bucket_domain_name}" -} diff --git a/steps/topology/aws/s3-assets.tf b/steps/topology/aws/s3-assets.tf index 62a5a45804b..3b2577b18b5 100644 --- a/steps/topology/aws/s3-assets.tf +++ b/steps/topology/aws/s3-assets.tf @@ -1,14 +1,5 @@ -## Create the S3 bucket where we'll upload the initial ignition file -# This needs a bit of a special setup. Because Ignition is fetching the -# configuration over the tnc LB pointed to the s3 bucket, it doesn't have any -# identity. So, the file needs to be public. But then we'd expose secrets, -# so the public ignition file just has an ignition redirect to a s3:// url, -# which ignition can fetch directly with authentication. - resource "aws_s3_bucket" "tectonic" { - # This bucket name must match the CNAME - # https://docs.aws.amazon.com/AmazonS3/latest/dev/VirtualHosting.html#VirtualHostingCustomURLs - bucket = "${lower(var.tectonic_cluster_name)}-tnc.${var.tectonic_base_domain}" + bucket = "${lower(var.tectonic_cluster_name)}.${var.tectonic_base_domain}" acl = "private" @@ -22,51 +13,3 @@ resource "aws_s3_bucket" "tectonic" { ignore_changes = ["*"] } } - -# The real ignition contents, with secrets. -# Must be private. The node will zero this out as soon as it boots. -resource "aws_s3_bucket_object" "ignition_bootstrap_real" { - bucket = "${aws_s3_bucket.tectonic.bucket}" - key = "config/bootstrap" - content = "${local.ignition_bootstrap}" - acl = "private" - - server_side_encryption = "AES256" - - tags = "${merge(map( - "Name", "${var.tectonic_cluster_name}-ignition-master", - "KubernetesCluster", "${var.tectonic_cluster_name}", - "tectonicClusterID", "${var.tectonic_cluster_id}" - ), var.tectonic_aws_extra_tags)}" - - lifecycle { - ignore_changes = ["*"] - } -} - -# The public ignition configuration -data "ignition_config" "bootstrap_redirect" { - replace { - source = "s3://${aws_s3_bucket.tectonic.bucket}/config/bootstrap" - } -} - -# The public ignition object. -resource "aws_s3_bucket_object" "ignition_bootstrap" { - bucket = "${aws_s3_bucket.tectonic.bucket}" - key = "config/master" - content = "${data.ignition_config.bootstrap_redirect.rendered}" - acl = "public-read" - - server_side_encryption = "AES256" - - tags = "${merge(map( - "Name", "${var.tectonic_cluster_name}-ignition-master", - "KubernetesCluster", "${var.tectonic_cluster_name}", - "tectonicClusterID", "${var.tectonic_cluster_id}" - ), var.tectonic_aws_extra_tags)}" - - lifecycle { - ignore_changes = ["*"] - } -} diff --git a/steps/topology/libvirt/main.tf b/steps/topology/libvirt/main.tf index d73b0490744..dc18a26b408 100644 --- a/steps/topology/libvirt/main.tf +++ b/steps/topology/libvirt/main.tf @@ -18,6 +18,15 @@ resource "libvirt_network" "tectonic_net" { dns_forwarder { address = "${var.tectonic_libvirt_resolver}" } + + dns_host = ["${flatten(list( + data.libvirt_network_dns_host_template.bootstrap.*.rendered, + data.libvirt_network_dns_host_template.masters.*.rendered, + data.libvirt_network_dns_host_template.etcds.*.rendered, + data.libvirt_network_dns_host_template.workers.*.rendered, + ))}"] + + autostart = true } module "libvirt_base_volume" { @@ -27,13 +36,40 @@ module "libvirt_base_volume" { } locals { - first_worker_ip = "${cidrhost(var.tectonic_libvirt_ip_range, var.tectonic_libvirt_first_ip_worker)}" + "hostnames" = [ + "${var.tectonic_cluster_name}-api", + "${var.tectonic_cluster_name}-tnc", + ] } -# Set up the cluster domain name -# This is currently limited to the first worker, due to an issue with net-update, even though libvirt supports multiple a-records -resource "null_resource" "console_dns" { - provisioner "local-exec" { - command = "virsh -c ${var.tectonic_libvirt_uri} net-update ${libvirt_network.tectonic_net.name} add dns-host \"${var.tectonic_cluster_name}\" --live --config" - } +data "libvirt_network_dns_host_template" "bootstrap" { + count = "${length(local.hostnames)}" + + ip = "${var.tectonic_libvirt_bootstrap_ip}" + + hostname = "${local.hostnames[count.index]}" +} + +data "libvirt_network_dns_host_template" "masters" { + count = "${var.tectonic_master_count * length(local.hostnames)}" + + ip = "${var.tectonic_libvirt_master_ips[count.index / length(local.hostnames)]}" + + hostname = "${local.hostnames[count.index % length(local.hostnames)]}" +} + +data "libvirt_network_dns_host_template" "etcds" { + count = "${var.tectonic_master_count}" + + ip = "${var.tectonic_libvirt_master_ips[count.index]}" + + hostname = "${var.tectonic_cluster_name}-etcd-${count.index}" +} + +data "libvirt_network_dns_host_template" "workers" { + count = "${var.tectonic_worker_count}" + + ip = "${var.tectonic_libvirt_worker_ips[count.index]}" + + hostname = "${var.tectonic_cluster_name}" } diff --git a/steps/variables-aws.tf b/steps/variables-aws.tf index 8316a69d9b5..59d396e9403 100644 --- a/steps/variables-aws.tf +++ b/steps/variables-aws.tf @@ -27,33 +27,12 @@ variable "tectonic_aws_worker_ec2_type" { default = "t2.medium" } -variable "tectonic_aws_etcd_ec2_type" { - type = "string" - - description = < "${CLUSTER_NAME}.yaml" @@ -77,7 +76,7 @@ echo -e "\\e[36m Deploying Tectonic...\\e[0m" tectonic install --dir="${CLUSTER_NAME}" echo -e "\\e[36m Running smoke test...\\e[0m" export SMOKE_KUBECONFIG="$(pwd)/$CLUSTER_NAME/generated/auth/kubeconfig" -export SMOKE_NODE_COUNT="7" # Sum of all nodes (etcd + master + worker) +export SMOKE_NODE_COUNT="5" # Sum of all nodes (master + worker) export SMOKE_MANIFEST_PATHS="$(pwd)/$CLUSTER_NAME/generated" exec 5>&1 SMOKE_TEST_OUTPUT=$(./smoke -test.v --cluster | tee >(cat - >&5)) diff --git a/tests/smoke/aws/README.md b/tests/smoke/aws/README.md index 800fa49336c..47e0dfdd8dc 100644 --- a/tests/smoke/aws/README.md +++ b/tests/smoke/aws/README.md @@ -100,8 +100,8 @@ $ aws ec2 describe-instances --query "Reservations[].Instances[] | [?Tags[? Key $ ssh -A core@52.15.184.15 ``` -Once connected to the master node, follow the [troubleshooting guide](../../../Documentation/troubleshooting/troubleshooting.md) for master, worker, and etcd nodes to investigate the following checklist: +Once connected to the master node, follow the [troubleshooting guide](../../../Documentation/troubleshooting/troubleshooting.md) for master and worker nodes to investigate the following checklist: -- SSH connectivity to the master/worker/etcd nodes +- SSH connectivity to the master/worker nodes - Successful start of all relevant installation service units on the corresponding nodes - Successful login to the Tectonic Console