Simplify google-cloud cluster variables

* Remove k8s_domain_name input variable, the controller DNS
record will be "${var.cluster_name}.${dns_zone}"
* Rename dns_base_zone to dns_zone
* Rename dns_base_zone_name to dns_zone_name
This commit is contained in:
Dalton Hubble
2017-08-13 13:02:52 -07:00
parent 40bd338eab
commit bac968d3eb
8 changed files with 45 additions and 55 deletions

View File

@ -1,16 +1,14 @@
# DNS record set to the network load balancer over controllers
resource "google_dns_record_set" "k8s_dns" {
# Managed DNS Zone name
managed_zone = "${var.dns_base_zone_name}"
# Name of the DNS record
#name = "${format("%s.%s.", var.cluster_name, var.dns_base_zone)}"
name = "${var.k8s_domain_name}."
# Controller Network Load balancer DNS record
resource "google_dns_record_set" "controllers" {
# DNS Zone name where record should be created
managed_zone = "${var.dns_zone_name}"
# DNS record
name = "${format("%s.%s.", var.cluster_name, var.dns_zone)}"
type = "A"
ttl = 300
# compute instance public IP
# IPv4 address of controllers' network load balancer
rrdatas = ["${google_compute_address.controllers-ip.address}"]
}

View File

@ -13,21 +13,16 @@ variable "network" {
description = "Name of the network to attach to the compute instance interfaces"
}
variable "dns_base_zone" {
variable "dns_zone" {
type = "string"
description = "Google Cloud DNS Zone value to create etcd/k8s subdomains (e.g. dghubble.io)"
}
variable "dns_base_zone_name" {
variable "dns_zone_name" {
type = "string"
description = "Google Cloud DNS Zone name to create etcd/k8s subdomains (e.g. dghubble-io)"
}
variable "k8s_domain_name" {
type = "string"
description = "Controller DNS name which resolves to the controller instance. Kubectl and workers use TLS client credentials to communicate via this endpoint."
}
# instances
variable "count" {