Fix terraform fmt formatting
This commit is contained in:
parent
19ee57dc04
commit
8a9e8595ae
|
@ -1,7 +1,7 @@
|
||||||
# Secure copy assets to controllers.
|
# Secure copy assets to controllers.
|
||||||
resource "null_resource" "copy-controller-secrets" {
|
resource "null_resource" "copy-controller-secrets" {
|
||||||
count = var.controller_count
|
count = var.controller_count
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
module.bootstrap,
|
module.bootstrap,
|
||||||
]
|
]
|
||||||
|
@ -47,7 +47,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -126,37 +126,37 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_labels" {
|
variable "worker_node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial worker node labels"
|
description = "List of initial worker node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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)"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,22 +89,22 @@ variable "ssh_authorized_key" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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" {
|
variable "node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial node labels"
|
description = "List of initial node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Secure copy assets to controllers.
|
# Secure copy assets to controllers.
|
||||||
resource "null_resource" "copy-controller-secrets" {
|
resource "null_resource" "copy-controller-secrets" {
|
||||||
count = var.controller_count
|
count = var.controller_count
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
module.bootstrap,
|
module.bootstrap,
|
||||||
]
|
]
|
||||||
|
|
|
@ -126,37 +126,37 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_labels" {
|
variable "worker_node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial worker node labels"
|
description = "List of initial worker node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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)"
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ data "aws_ami" "fedora-coreos" {
|
||||||
name = "name"
|
name = "name"
|
||||||
values = ["fedora-coreos-30.*.*-hvm"]
|
values = ["fedora-coreos-30.*.*-hvm"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# try to filter out dev images (AWS filters can't)
|
# try to filter out dev images (AWS filters can't)
|
||||||
name_regex = "^fedora-coreos-30.[0-9]*.[0-9]*-hvm*"
|
name_regex = "^fedora-coreos-30.[0-9]*.[0-9]*-hvm*"
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,22 +89,22 @@ variable "ssh_authorized_key" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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" {
|
variable "node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial node labels"
|
description = "List of initial node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,9 +71,9 @@ resource "aws_launch_configuration" "worker" {
|
||||||
|
|
||||||
# Worker Ignition config
|
# Worker Ignition config
|
||||||
data "ct_config" "worker-ignition" {
|
data "ct_config" "worker-ignition" {
|
||||||
content = data.template_file.worker-config.rendered
|
content = data.template_file.worker-config.rendered
|
||||||
strict = true
|
strict = true
|
||||||
snippets = var.snippets
|
snippets = var.snippets
|
||||||
}
|
}
|
||||||
|
|
||||||
# Worker Fedora CoreOS config
|
# Worker Fedora CoreOS config
|
||||||
|
|
|
@ -48,7 +48,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -107,37 +107,37 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_labels" {
|
variable "worker_node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial worker node labels"
|
description = "List of initial worker node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -75,25 +75,25 @@ variable "ssh_authorized_key" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "node_labels" {
|
variable "node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial node labels"
|
description = "List of initial node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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
|
type = string
|
||||||
default = "cluster.local"
|
default = "cluster.local"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ resource "azurerm_virtual_machine_scale_set" "workers" {
|
||||||
# lifecycle
|
# lifecycle
|
||||||
upgrade_policy_mode = "Manual"
|
upgrade_policy_mode = "Manual"
|
||||||
# eviction policy may only be set when priority is Low
|
# eviction policy may only be set when priority is Low
|
||||||
priority = var.priority
|
priority = var.priority
|
||||||
eviction_policy = var.priority == "Low" ? "Delete" : null
|
eviction_policy = var.priority == "Low" ? "Delete" : null
|
||||||
}
|
}
|
||||||
|
|
||||||
# Scale up or down to maintain desired number, tolerating deallocations.
|
# Scale up or down to maintain desired number, tolerating deallocations.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
locals {
|
locals {
|
||||||
# coreos-stable -> coreos flavor, stable channel
|
# coreos-stable -> coreos flavor, stable channel
|
||||||
# flatcar-stable -> flatcar 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]
|
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")
|
template = file("${path.module}/cl/install.yaml.tmpl")
|
||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
os_flavor = local.flavor
|
os_flavor = local.flavor
|
||||||
os_channel = local.channel
|
os_channel = local.channel
|
||||||
os_version = var.os_version
|
os_version = var.os_version
|
||||||
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
|
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
|
||||||
install_disk = var.install_disk
|
install_disk = var.install_disk
|
||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
# only cached-container-linux profile adds -b baseurl
|
# only cached-container-linux profile adds -b baseurl
|
||||||
baseurl_flag = ""
|
baseurl_flag = ""
|
||||||
}
|
}
|
||||||
|
@ -75,12 +75,12 @@ data "template_file" "cached-container-linux-install-configs" {
|
||||||
template = file("${path.module}/cl/install.yaml.tmpl")
|
template = file("${path.module}/cl/install.yaml.tmpl")
|
||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
os_flavor = local.flavor
|
os_flavor = local.flavor
|
||||||
os_channel = local.channel
|
os_channel = local.channel
|
||||||
os_version = var.os_version
|
os_version = var.os_version
|
||||||
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
|
ignition_endpoint = format("%s/ignition", var.matchbox_http_endpoint)
|
||||||
install_disk = var.install_disk
|
install_disk = var.install_disk
|
||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
# profile uses -b baseurl to install from matchbox cache
|
# profile uses -b baseurl to install from matchbox cache
|
||||||
baseurl_flag = "-b ${var.matchbox_http_endpoint}/assets/${local.flavor}"
|
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]
|
domain_name = var.controllers.*.domain[count.index]
|
||||||
etcd_name = var.controllers.*.name[count.index]
|
etcd_name = var.controllers.*.name[count.index]
|
||||||
etcd_initial_cluster = join(",", formatlist("%s=https://%s:2380", var.controllers.*.name, var.controllers.*.domain))
|
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_dns_service_ip = module.bootstrap.cluster_dns_service_ip
|
||||||
cluster_domain_suffix = var.cluster_domain_suffix
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
|
@ -184,7 +184,7 @@ data "template_file" "worker-configs" {
|
||||||
|
|
||||||
vars = {
|
vars = {
|
||||||
domain_name = var.workers.*.domain[count.index]
|
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_dns_service_ip = module.bootstrap.cluster_dns_service_ip
|
||||||
cluster_domain_suffix = var.cluster_domain_suffix
|
cluster_domain_suffix = var.cluster_domain_suffix
|
||||||
ssh_authorized_key = var.ssh_authorized_key
|
ssh_authorized_key = var.ssh_authorized_key
|
||||||
|
|
|
@ -57,7 +57,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -24,8 +24,8 @@ variable "os_version" {
|
||||||
|
|
||||||
variable "controllers" {
|
variable "controllers" {
|
||||||
type = list(object({
|
type = list(object({
|
||||||
name = string
|
name = string
|
||||||
mac = string
|
mac = string
|
||||||
domain = string
|
domain = string
|
||||||
}))
|
}))
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
|
@ -36,8 +36,8 @@ EOD
|
||||||
|
|
||||||
variable "workers" {
|
variable "workers" {
|
||||||
type = list(object({
|
type = list(object({
|
||||||
name = string
|
name = string
|
||||||
mac = string
|
mac = string
|
||||||
domain = string
|
domain = string
|
||||||
}))
|
}))
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
|
@ -97,57 +97,57 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
# optional
|
# optional
|
||||||
|
|
||||||
variable "download_protocol" {
|
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."
|
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" {
|
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."
|
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" {
|
variable "install_disk" {
|
||||||
type = string
|
type = string
|
||||||
default = "/dev/sda"
|
default = "/dev/sda"
|
||||||
description = "Disk device to which the install profiles should install Container Linux (e.g. /dev/sda)"
|
description = "Disk device to which the install profiles should install Container Linux (e.g. /dev/sda)"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "kernel_args" {
|
variable "kernel_args" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional kernel arguments to provide at PXE boot."
|
description = "Additional kernel arguments to provide at PXE boot."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -56,7 +56,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -25,8 +25,8 @@ variable "os_version" {
|
||||||
|
|
||||||
variable "controllers" {
|
variable "controllers" {
|
||||||
type = list(object({
|
type = list(object({
|
||||||
name = string
|
name = string
|
||||||
mac = string
|
mac = string
|
||||||
domain = string
|
domain = string
|
||||||
}))
|
}))
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
|
@ -37,8 +37,8 @@ EOD
|
||||||
|
|
||||||
variable "workers" {
|
variable "workers" {
|
||||||
type = list(object({
|
type = list(object({
|
||||||
name = string
|
name = string
|
||||||
mac = string
|
mac = string
|
||||||
domain = string
|
domain = string
|
||||||
}))
|
}))
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
|
@ -98,51 +98,51 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
# optional
|
# optional
|
||||||
|
|
||||||
variable "cached_install" {
|
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."
|
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" {
|
variable "install_disk" {
|
||||||
type = string
|
type = string
|
||||||
description = "Disk device to install Fedora CoreOS (e.g. sda)"
|
description = "Disk device to install Fedora CoreOS (e.g. sda)"
|
||||||
default = "sda"
|
default = "sda"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "kernel_args" {
|
variable "kernel_args" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Additional kernel arguments to provide at PXE boot."
|
description = "Additional kernel arguments to provide at PXE boot."
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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
|
type = string
|
||||||
default = "cluster.local"
|
default = "cluster.local"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -73,7 +73,7 @@ resource "digitalocean_firewall" "controllers" {
|
||||||
port_range = "6443"
|
port_range = "6443"
|
||||||
source_addresses = ["0.0.0.0/0", "::/0"]
|
source_addresses = ["0.0.0.0/0", "::/0"]
|
||||||
}
|
}
|
||||||
|
|
||||||
# kube-scheduler metrics, kube-controller-manager metrics
|
# kube-scheduler metrics, kube-controller-manager metrics
|
||||||
inbound_rule {
|
inbound_rule {
|
||||||
protocol = "tcp"
|
protocol = "tcp"
|
||||||
|
|
|
@ -53,7 +53,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -84,31 +84,31 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
# Secure copy assets to controllers.
|
# Secure copy assets to controllers.
|
||||||
resource "null_resource" "copy-controller-secrets" {
|
resource "null_resource" "copy-controller-secrets" {
|
||||||
count = var.controller_count
|
count = var.controller_count
|
||||||
|
|
||||||
depends_on = [
|
depends_on = [
|
||||||
module.bootstrap,
|
module.bootstrap,
|
||||||
]
|
]
|
||||||
|
@ -47,7 +47,7 @@ resource "null_resource" "copy-controller-secrets" {
|
||||||
content = module.bootstrap.etcd_peer_key
|
content = module.bootstrap.etcd_peer_key
|
||||||
destination = "$HOME/etcd-peer.key"
|
destination = "$HOME/etcd-peer.key"
|
||||||
}
|
}
|
||||||
|
|
||||||
provisioner "file" {
|
provisioner "file" {
|
||||||
source = var.asset_dir
|
source = var.asset_dir
|
||||||
destination = "$HOME/assets"
|
destination = "$HOME/assets"
|
||||||
|
|
|
@ -101,38 +101,38 @@ variable "pod_cidr" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
variable "enable_reporting" {
|
variable "enable_reporting" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
description = "Enable usage or analytics reporting to upstreams (Calico)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "enable_aggregation" {
|
variable "enable_aggregation" {
|
||||||
type = bool
|
type = bool
|
||||||
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
description = "Enable the Kubernetes Aggregation Layer (defaults to false)"
|
||||||
default = false
|
default = false
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "worker_node_labels" {
|
variable "worker_node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial worker node labels"
|
description = "List of initial worker node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported
|
# unofficial, undocumented, unsupported
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -53,9 +53,9 @@ variable "preemptible" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "clc_snippets" {
|
variable "clc_snippets" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "Container Linux Config snippets"
|
description = "Container Linux Config snippets"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# configuration
|
# configuration
|
||||||
|
@ -71,37 +71,37 @@ variable "ssh_authorized_key" {
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "service_cidr" {
|
variable "service_cidr" {
|
||||||
type = string
|
type = string
|
||||||
description = <<EOD
|
description = <<EOD
|
||||||
CIDR IPv4 range to assign Kubernetes services.
|
CIDR IPv4 range to assign Kubernetes services.
|
||||||
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
The 1st IP will be reserved for kube_apiserver, the 10th IP will be reserved for coredns.
|
||||||
EOD
|
EOD
|
||||||
default = "10.3.0.0/16"
|
default = "10.3.0.0/16"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "node_labels" {
|
variable "node_labels" {
|
||||||
type = list(string)
|
type = list(string)
|
||||||
description = "List of initial node labels"
|
description = "List of initial node labels"
|
||||||
default = []
|
default = []
|
||||||
}
|
}
|
||||||
|
|
||||||
# unofficial, undocumented, unsupported, temporary
|
# unofficial, undocumented, unsupported, temporary
|
||||||
|
|
||||||
variable "cluster_domain_suffix" {
|
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) "
|
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" {
|
variable "accelerator_type" {
|
||||||
type = string
|
type = string
|
||||||
default = ""
|
default = ""
|
||||||
description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)"
|
description = "Google Compute Engine accelerator type (e.g. nvidia-tesla-k80, see gcloud compute accelerator-types list)"
|
||||||
}
|
}
|
||||||
|
|
||||||
variable "accelerator_count" {
|
variable "accelerator_count" {
|
||||||
type = string
|
type = string
|
||||||
default = "0"
|
default = "0"
|
||||||
description = "Number of compute engine accelerators"
|
description = "Number of compute engine accelerators"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,8 +7,8 @@ resource "google_compute_region_instance_group_manager" "workers" {
|
||||||
base_instance_name = "${var.name}-worker"
|
base_instance_name = "${var.name}-worker"
|
||||||
region = var.region
|
region = var.region
|
||||||
version {
|
version {
|
||||||
name = "default"
|
name = "default"
|
||||||
instance_template = google_compute_instance_template.worker.self_link
|
instance_template = google_compute_instance_template.worker.self_link
|
||||||
}
|
}
|
||||||
|
|
||||||
target_size = var.worker_count
|
target_size = var.worker_count
|
||||||
|
|
Loading…
Reference in New Issue