diff --git a/CHANGES.md b/CHANGES.md index 115f2397..ba8a82c5 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,13 @@ Notable changes between versions. ## Latest +### Flatcar Linux + +* Remove references to CoreOS Container Linux ([#839](https://github.com/poseidon/typhoon/pull/839)) + * Fix error querying for coreos AMI on AWS ([#838](https://github.com/poseidon/typhoon/issues/838)) + +## v1.19.2 + * Kubernetes [v1.19.2](https://github.com/kubernetes/kubernetes/blob/master/CHANGELOG/CHANGELOG-1.19.md#v1192) * Update flannel from v0.12.0 to v0.13.0-rc2 ([#216](https://github.com/poseidon/terraform-render-bootstrap/pull/216)) * Update flannel-cni from v0.4.0 to v0.4.1 diff --git a/aws/container-linux/kubernetes/ami.tf b/aws/container-linux/kubernetes/ami.tf index bea85504..be0cc387 100644 --- a/aws/container-linux/kubernetes/ami.tf +++ b/aws/container-linux/kubernetes/ami.tf @@ -1,33 +1,10 @@ locals { - # Pick a CoreOS Container Linux derivative - # coreos-stable -> Container Linux AMI + # Pick a Flatcar Linux AMI # flatcar-stable -> Flatcar Linux AMI - ami_id = local.flavor == "flatcar" ? data.aws_ami.flatcar.image_id : data.aws_ami.coreos.image_id - - flavor = split("-", var.os_image)[0] + ami_id = data.aws_ami.flatcar.image_id channel = split("-", var.os_image)[1] } -data "aws_ami" "coreos" { - most_recent = true - owners = ["595879546273"] - - filter { - name = "architecture" - values = ["x86_64"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - filter { - name = "name" - values = ["CoreOS-${local.flavor == "coreos" ? local.channel : "stable"}-*"] - } -} - data "aws_ami" "flatcar" { most_recent = true owners = ["075585003325"] @@ -44,7 +21,7 @@ data "aws_ami" "flatcar" { filter { name = "name" - values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] + values = ["Flatcar-${local.channel}-*"] } } diff --git a/aws/container-linux/kubernetes/controllers.tf b/aws/container-linux/kubernetes/controllers.tf index 252c6b9d..907cf524 100644 --- a/aws/container-linux/kubernetes/controllers.tf +++ b/aws/container-linux/kubernetes/controllers.tf @@ -67,7 +67,7 @@ data "template_file" "controller-configs" { etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" # etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,... etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered) - cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs" + cgroup_driver = local.channel == "edge" ? "systemd" : "cgroupfs" kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet) ssh_authorized_key = var.ssh_authorized_key cluster_dns_service_ip = cidrhost(var.service_cidr, 10) diff --git a/aws/container-linux/kubernetes/variables.tf b/aws/container-linux/kubernetes/variables.tf index 7cc63f2b..bcb22632 100644 --- a/aws/container-linux/kubernetes/variables.tf +++ b/aws/container-linux/kubernetes/variables.tf @@ -43,7 +43,7 @@ variable "worker_type" { variable "os_image" { type = string - description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" + description = "AMI channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" default = "flatcar-stable" } diff --git a/aws/container-linux/kubernetes/workers/ami.tf b/aws/container-linux/kubernetes/workers/ami.tf index bea85504..be0cc387 100644 --- a/aws/container-linux/kubernetes/workers/ami.tf +++ b/aws/container-linux/kubernetes/workers/ami.tf @@ -1,33 +1,10 @@ locals { - # Pick a CoreOS Container Linux derivative - # coreos-stable -> Container Linux AMI + # Pick a Flatcar Linux AMI # flatcar-stable -> Flatcar Linux AMI - ami_id = local.flavor == "flatcar" ? data.aws_ami.flatcar.image_id : data.aws_ami.coreos.image_id - - flavor = split("-", var.os_image)[0] + ami_id = data.aws_ami.flatcar.image_id channel = split("-", var.os_image)[1] } -data "aws_ami" "coreos" { - most_recent = true - owners = ["595879546273"] - - filter { - name = "architecture" - values = ["x86_64"] - } - - filter { - name = "virtualization-type" - values = ["hvm"] - } - - filter { - name = "name" - values = ["CoreOS-${local.flavor == "coreos" ? local.channel : "stable"}-*"] - } -} - data "aws_ami" "flatcar" { most_recent = true owners = ["075585003325"] @@ -44,7 +21,7 @@ data "aws_ami" "flatcar" { filter { name = "name" - values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] + values = ["Flatcar-${local.channel}-*"] } } diff --git a/aws/container-linux/kubernetes/workers/variables.tf b/aws/container-linux/kubernetes/workers/variables.tf index 6f0d3a0a..96b1cefb 100644 --- a/aws/container-linux/kubernetes/workers/variables.tf +++ b/aws/container-linux/kubernetes/workers/variables.tf @@ -36,7 +36,7 @@ variable "instance_type" { variable "os_image" { type = string - description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" + description = "AMI channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" default = "flatcar-stable" } diff --git a/aws/container-linux/kubernetes/workers/workers.tf b/aws/container-linux/kubernetes/workers/workers.tf index 5b28c105..6df47bad 100644 --- a/aws/container-linux/kubernetes/workers/workers.tf +++ b/aws/container-linux/kubernetes/workers/workers.tf @@ -85,7 +85,7 @@ data "template_file" "worker-config" { ssh_authorized_key = var.ssh_authorized_key cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_domain_suffix = var.cluster_domain_suffix - cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs" + cgroup_driver = local.channel == "edge" ? "systemd" : "cgroupfs" node_labels = join(",", var.node_labels) } } diff --git a/azure/container-linux/kubernetes/controllers.tf b/azure/container-linux/kubernetes/controllers.tf index 38a79b98..bbdf2e3f 100644 --- a/azure/container-linux/kubernetes/controllers.tf +++ b/azure/container-linux/kubernetes/controllers.tf @@ -16,9 +16,7 @@ resource "azurerm_dns_a_record" "etcds" { locals { # Container Linux derivative - # coreos-stable -> Container Linux Stable # flatcar-stable -> Flatcar Linux Stable - flavor = split("-", var.os_image)[0] channel = split("-", var.os_image)[1] } @@ -53,23 +51,18 @@ resource "azurerm_linux_virtual_machine" "controllers" { storage_account_type = "Premium_LRS" } - # CoreOS Container Linux or Flatcar Container Linux + # Flatcar Container Linux source_image_reference { - publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS" - offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS" + publisher = "Kinvolk" + offer = "flatcar-container-linux-free" sku = local.channel version = "latest" } - # Gross hack for Flatcar Linux - dynamic "plan" { - for_each = local.flavor == "flatcar" ? [1] : [] - - content { - name = local.channel - publisher = "kinvolk" - product = "flatcar-container-linux-free" - } + plan { + name = local.channel + publisher = "kinvolk" + product = "flatcar-container-linux-free" } # network @@ -157,7 +150,7 @@ data "template_file" "controller-configs" { etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" # etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,... etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered) - cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs" + cgroup_driver = local.channel == "edge" ? "systemd" : "cgroupfs" kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet) ssh_authorized_key = var.ssh_authorized_key cluster_dns_service_ip = cidrhost(var.service_cidr, 10) diff --git a/azure/container-linux/kubernetes/variables.tf b/azure/container-linux/kubernetes/variables.tf index 50b57aed..5dbc1eca 100644 --- a/azure/container-linux/kubernetes/variables.tf +++ b/azure/container-linux/kubernetes/variables.tf @@ -48,7 +48,7 @@ variable "worker_type" { variable "os_image" { type = string - description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge, coreos-stable, coreos-beta, coreos-alpha)" + description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" default = "flatcar-stable" } diff --git a/azure/container-linux/kubernetes/workers/variables.tf b/azure/container-linux/kubernetes/workers/variables.tf index 48197d3e..05ded59e 100644 --- a/azure/container-linux/kubernetes/workers/variables.tf +++ b/azure/container-linux/kubernetes/workers/variables.tf @@ -46,7 +46,7 @@ variable "vm_type" { variable "os_image" { type = string - description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge, coreos-stable, coreos-beta, coreos-alpha)" + description = "Channel for a Container Linux derivative (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" default = "flatcar-stable" } diff --git a/azure/container-linux/kubernetes/workers/workers.tf b/azure/container-linux/kubernetes/workers/workers.tf index 9070051d..857c75db 100644 --- a/azure/container-linux/kubernetes/workers/workers.tf +++ b/azure/container-linux/kubernetes/workers/workers.tf @@ -1,7 +1,5 @@ locals { - # coreos-stable -> Container Linux Stable # flatcar-stable -> Flatcar Linux Stable - flavor = split("-", var.os_image)[0] channel = split("-", var.os_image)[1] } @@ -24,23 +22,18 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" { caching = "ReadWrite" } - # CoreOS Container Linux or Flatcar Container Linux + # Flatcar Container Linux source_image_reference { - publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS" - offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS" + publisher = "Kinvolk" + offer = "flatcar-container-linux-free" sku = local.channel version = "latest" } - # Gross hack for Flatcar Linux - dynamic "plan" { - for_each = local.flavor == "flatcar" ? [1] : [] - - content { - name = local.channel - publisher = "kinvolk" - product = "flatcar-container-linux-free" - } + plan { + name = local.channel + publisher = "kinvolk" + product = "flatcar-container-linux-free" } # Azure requires setting admin_ssh_key, though Ignition custom_data handles it too @@ -111,7 +104,7 @@ data "template_file" "worker-config" { ssh_authorized_key = var.ssh_authorized_key cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_domain_suffix = var.cluster_domain_suffix - cgroup_driver = local.flavor == "flatcar" && local.channel == "edge" ? "systemd" : "cgroupfs" + cgroup_driver = local.channel == "edge" ? "systemd" : "cgroupfs" node_labels = join(",", var.node_labels) } } diff --git a/bare-metal/container-linux/kubernetes/variables.tf b/bare-metal/container-linux/kubernetes/variables.tf index 9905229a..5de6cae5 100644 --- a/bare-metal/container-linux/kubernetes/variables.tf +++ b/bare-metal/container-linux/kubernetes/variables.tf @@ -12,7 +12,7 @@ variable "matchbox_http_endpoint" { variable "os_channel" { type = string - description = "Channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" + description = "Channel for a Flatcar Linux (flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" } variable "os_version" { diff --git a/digital-ocean/container-linux/kubernetes/controllers.tf b/digital-ocean/container-linux/kubernetes/controllers.tf index dcb6f0dd..484bbfd5 100644 --- a/digital-ocean/container-linux/kubernetes/controllers.tf +++ b/digital-ocean/container-linux/kubernetes/controllers.tf @@ -1,5 +1,5 @@ locals { - official_images = ["coreos-stable", "coreos-beta", "coreos-alpha"] + official_images = [] is_official_image = contains(local.official_images, var.os_image) } diff --git a/digital-ocean/container-linux/kubernetes/variables.tf b/digital-ocean/container-linux/kubernetes/variables.tf index 67ba99ff..73edd554 100644 --- a/digital-ocean/container-linux/kubernetes/variables.tf +++ b/digital-ocean/container-linux/kubernetes/variables.tf @@ -43,7 +43,7 @@ variable "worker_type" { variable "os_image" { type = string - description = "Container Linux image for instances (e.g. coreos-stable, custom-image-id)" + description = "Flatcar Linux image for instances (e.g. custom-image-id)" } variable "controller_snippets" { diff --git a/google-cloud/container-linux/kubernetes/variables.tf b/google-cloud/container-linux/kubernetes/variables.tf index 5adb48b9..3acaeb5e 100644 --- a/google-cloud/container-linux/kubernetes/variables.tf +++ b/google-cloud/container-linux/kubernetes/variables.tf @@ -48,7 +48,7 @@ variable "worker_type" { variable "os_image" { type = string - description = "Container Linux image for compute instances (e.g. coreos-stable, custom-image)" + description = "Flatcar Linux image for compute instances (e.g. custom-image)" } variable "disk_size" { diff --git a/google-cloud/container-linux/kubernetes/workers/variables.tf b/google-cloud/container-linux/kubernetes/workers/variables.tf index 049e7a8b..56a92303 100644 --- a/google-cloud/container-linux/kubernetes/workers/variables.tf +++ b/google-cloud/container-linux/kubernetes/workers/variables.tf @@ -36,7 +36,7 @@ variable "machine_type" { variable "os_image" { type = string - description = "Container Linux image for compute instanges (e.g. gcloud compute images list)" + description = "Flatcar Linux image for compute instanges (e.g. gcloud compute images list)" } variable "disk_size" {