Fix terraform fmt formatting

This commit is contained in:
Dalton Hubble 2019-11-13 23:44:02 -08:00
parent 19ee57dc04
commit 8a9e8595ae
24 changed files with 149 additions and 149 deletions

View File

@ -126,37 +126,37 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
variable "worker_node_labels" {
type = list(string)
type = list(string)
description = "List of initial worker node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by CoreDNS. Default is cluster.local (e.g. foo.default.svc.cluster.local)"
default = "cluster.local"
default = "cluster.local"
}

View File

@ -89,22 +89,22 @@ variable "ssh_authorized_key" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}
variable "node_labels" {
type = list(string)
type = list(string)
description = "List of initial node labels"
default = []
default = []
}

View File

@ -126,37 +126,37 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
variable "worker_node_labels" {
type = list(string)
type = list(string)
description = "List of initial worker node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by CoreDNS. Default is cluster.local (e.g. foo.default.svc.cluster.local)"
default = "cluster.local"
default = "cluster.local"
}

View File

@ -89,22 +89,22 @@ variable "ssh_authorized_key" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}
variable "node_labels" {
type = list(string)
type = list(string)
description = "List of initial node labels"
default = []
default = []
}

View File

@ -71,9 +71,9 @@ resource "aws_launch_configuration" "worker" {
# Worker Ignition config
data "ct_config" "worker-ignition" {
content = data.template_file.worker-config.rendered
strict = true
snippets = var.snippets
content = data.template_file.worker-config.rendered
strict = true
snippets = var.snippets
}
# Worker Fedora CoreOS config

View File

@ -107,37 +107,37 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
variable "worker_node_labels" {
type = list(string)
type = list(string)
description = "List of initial worker node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}

View File

@ -75,25 +75,25 @@ variable "ssh_authorized_key" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "node_labels" {
type = list(string)
type = list(string)
description = "List of initial node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
type = string
default = "cluster.local"
type = string
default = "cluster.local"
}

View File

@ -69,8 +69,8 @@ resource "azurerm_virtual_machine_scale_set" "workers" {
# lifecycle
upgrade_policy_mode = "Manual"
# eviction policy may only be set when priority is Low
priority = var.priority
eviction_policy = var.priority == "Low" ? "Delete" : null
priority = var.priority
eviction_policy = var.priority == "Low" ? "Delete" : null
}
# Scale up or down to maintain desired number, tolerating deallocations.

View File

@ -1,7 +1,7 @@
locals {
# coreos-stable -> coreos flavor, stable channel
# flatcar-stable -> flatcar flavor, stable channel
flavor = split("-", var.os_channel)[0]
flavor = split("-", var.os_channel)[0]
channel = split("-", var.os_channel)[1]
}
@ -34,12 +34,12 @@ data "template_file" "container-linux-install-configs" {
template = file("${path.module}/cl/install.yaml.tmpl")
vars = {
os_flavor = local.flavor
os_channel = local.channel
os_version = var.os_version
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
install_disk = var.install_disk
ssh_authorized_key = var.ssh_authorized_key
os_flavor = local.flavor
os_channel = local.channel
os_version = var.os_version
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
install_disk = var.install_disk
ssh_authorized_key = var.ssh_authorized_key
# only cached-container-linux profile adds -b baseurl
baseurl_flag = ""
}
@ -75,12 +75,12 @@ data "template_file" "cached-container-linux-install-configs" {
template = file("${path.module}/cl/install.yaml.tmpl")
vars = {
os_flavor = local.flavor
os_channel = local.channel
os_version = var.os_version
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
install_disk = var.install_disk
ssh_authorized_key = var.ssh_authorized_key
os_flavor = local.flavor
os_channel = local.channel
os_version = var.os_version
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
install_disk = var.install_disk
ssh_authorized_key = var.ssh_authorized_key
# profile uses -b baseurl to install from matchbox cache
baseurl_flag = "-b ${var.matchbox_http_endpoint}/assets/${local.flavor}"
}
@ -156,7 +156,7 @@ data "template_file" "controller-configs" {
domain_name = var.controllers.*.domain[count.index]
etcd_name = var.controllers.*.name[count.index]
etcd_initial_cluster = join(",", formatlist("%s=https://%s:2380", var.controllers.*.name, var.controllers.*.domain))
cgroup_driver = var.os_channel == "flatcar-edge" ? "systemd" : "cgroupfs"
cgroup_driver = var.os_channel == "flatcar-edge" ? "systemd" : "cgroupfs"
cluster_dns_service_ip = module.bootstrap.cluster_dns_service_ip
cluster_domain_suffix = var.cluster_domain_suffix
ssh_authorized_key = var.ssh_authorized_key
@ -184,7 +184,7 @@ data "template_file" "worker-configs" {
vars = {
domain_name = var.workers.*.domain[count.index]
cgroup_driver = var.os_channel == "flatcar-edge" ? "systemd" : "cgroupfs"
cgroup_driver = var.os_channel == "flatcar-edge" ? "systemd" : "cgroupfs"
cluster_dns_service_ip = module.bootstrap.cluster_dns_service_ip
cluster_domain_suffix = var.cluster_domain_suffix
ssh_authorized_key = var.ssh_authorized_key

View File

@ -24,8 +24,8 @@ variable "os_version" {
variable "controllers" {
type = list(object({
name = string
mac = string
name = string
mac = string
domain = string
}))
description = <<EOD
@ -36,8 +36,8 @@ EOD
variable "workers" {
type = list(object({
name = string
mac = string
name = string
mac = string
domain = string
}))
description = <<EOD
@ -97,57 +97,57 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
# optional
variable "download_protocol" {
type = string
type = string
description = "Protocol iPXE should use to download the kernel and initrd. Defaults to https, which requires iPXE compiled with crypto support. Unused if cached_install is true."
default = "https"
default = "https"
}
variable "cached_install" {
type = bool
type = bool
description = "Whether Container Linux should PXE boot and install from matchbox /assets cache. Note that the admin must have downloaded the os_version into matchbox assets."
default = false
default = false
}
variable "install_disk" {
type = string
default = "/dev/sda"
type = string
default = "/dev/sda"
description = "Disk device to which the install profiles should install Container Linux (e.g. /dev/sda)"
}
variable "kernel_args" {
type = list(string)
type = list(string)
description = "Additional kernel arguments to provide at PXE boot."
default = []
default = []
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}

View File

@ -25,8 +25,8 @@ variable "os_version" {
variable "controllers" {
type = list(object({
name = string
mac = string
name = string
mac = string
domain = string
}))
description = <<EOD
@ -37,8 +37,8 @@ EOD
variable "workers" {
type = list(object({
name = string
mac = string
name = string
mac = string
domain = string
}))
description = <<EOD
@ -98,51 +98,51 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
# optional
variable "cached_install" {
type = bool
type = bool
description = "Whether Fedora CoreOS should PXE boot and install from matchbox /assets cache. Note that the admin must have downloaded the os_version into matchbox assets."
default = false
default = false
}
variable "install_disk" {
type = string
type = string
description = "Disk device to install Fedora CoreOS (e.g. sda)"
default = "sda"
default = "sda"
}
variable "kernel_args" {
type = list(string)
type = list(string)
description = "Additional kernel arguments to provide at PXE boot."
default = []
default = []
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
type = string
default = "cluster.local"
type = string
default = "cluster.local"
}

View File

@ -84,31 +84,31 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}

View File

@ -101,38 +101,38 @@ variable "pod_cidr" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "enable_reporting" {
type = bool
type = bool
description = "Enable usage or analytics reporting to upstreams (Calico)"
default = false
default = false
}
variable "enable_aggregation" {
type = bool
type = bool
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
default = false
default = false
}
variable "worker_node_labels" {
type = list(string)
type = list(string)
description = "List of initial worker node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}

View File

@ -53,9 +53,9 @@ variable "preemptible" {
}
variable "clc_snippets" {
type = list(string)
type = list(string)
description = "Container Linux Config snippets"
default = []
default = []
}
# configuration
@ -71,37 +71,37 @@ variable "ssh_authorized_key" {
}
variable "service_cidr" {
type = string
type = string
description = <<EOD
CIDR IPv4 range to assign Kubernetes services.
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
EOD
default = "10.3.0.0/16"
default = "10.3.0.0/16"
}
variable "node_labels" {
type = list(string)
type = list(string)
description = "List of initial node labels"
default = []
default = []
}
# unofficial, undocumented, unsupported, temporary
variable "cluster_domain_suffix" {
type = string
type = string
description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "
default = "cluster.local"
default = "cluster.local"
}
variable "accelerator_type" {
type = string
default = ""
type = string
default = ""
description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)"
}
variable "accelerator_count" {
type = string
default = "0"
type = string
default = "0"
description = "Number of compute engine accelerators"
}

View File

@ -7,8 +7,8 @@ resource "google_compute_region_instance_group_manager" "workers" {
base_instance_name = "${var.name}-worker"
region = var.region
version {
name = "default"
instance_template = google_compute_instance_template.worker.self_link
name = "default"
instance_template = google_compute_instance_template.worker.self_link
}
target_size = var.worker_count