Remove references to CoreOS Container Linux

* CoreOS Container Linux was deprecated in v1.18.3 (May 2020)
in favor of Fedora CoreOS and Flatcar Linux. CoreOS Container
Linux references were kept to give folks more time to migrate,
but AMIs have now been deleted. Time is up.

Rel: https://coreos.com/os/eol/
This commit is contained in:
Dalton Hubble 2020-09-24 19:55:32 -07:00
parent 444363be2d
commit 343db5b578
16 changed files with 40 additions and 93 deletions

View File

@ -4,6 +4,13 @@ Notable changes between versions.
## Latest ## 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) * 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 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 * Update flannel-cni from v0.4.0 to v0.4.1

View File

@ -1,33 +1,10 @@
locals { locals {
# Pick a CoreOS Container Linux derivative # Pick a Flatcar Linux AMI
# coreos-stable -> Container Linux AMI
# flatcar-stable -> 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 ami_id = data.aws_ami.flatcar.image_id
flavor = split("-", var.os_image)[0]
channel = split("-", var.os_image)[1] 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" { data "aws_ami" "flatcar" {
most_recent = true most_recent = true
owners = ["075585003325"] owners = ["075585003325"]
@ -44,7 +21,7 @@ data "aws_ami" "flatcar" {
filter { filter {
name = "name" name = "name"
values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] values = ["Flatcar-${local.channel}-*"]
} }
} }

View File

@ -67,7 +67,7 @@ data "template_file" "controller-configs" {
etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}"
# etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,... # etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,...
etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered) 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) kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet)
ssh_authorized_key = var.ssh_authorized_key ssh_authorized_key = var.ssh_authorized_key
cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_dns_service_ip = cidrhost(var.service_cidr, 10)

View File

@ -43,7 +43,7 @@ variable "worker_type" {
variable "os_image" { variable "os_image" {
type = string 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" default = "flatcar-stable"
} }

View File

@ -1,33 +1,10 @@
locals { locals {
# Pick a CoreOS Container Linux derivative # Pick a Flatcar Linux AMI
# coreos-stable -> Container Linux AMI
# flatcar-stable -> 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 ami_id = data.aws_ami.flatcar.image_id
flavor = split("-", var.os_image)[0]
channel = split("-", var.os_image)[1] 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" { data "aws_ami" "flatcar" {
most_recent = true most_recent = true
owners = ["075585003325"] owners = ["075585003325"]
@ -44,7 +21,7 @@ data "aws_ami" "flatcar" {
filter { filter {
name = "name" name = "name"
values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] values = ["Flatcar-${local.channel}-*"]
} }
} }

View File

@ -36,7 +36,7 @@ variable "instance_type" {
variable "os_image" { variable "os_image" {
type = string 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" default = "flatcar-stable"
} }

View File

@ -85,7 +85,7 @@ data "template_file" "worker-config" {
ssh_authorized_key = var.ssh_authorized_key ssh_authorized_key = var.ssh_authorized_key
cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
cluster_domain_suffix = var.cluster_domain_suffix 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) node_labels = join(",", var.node_labels)
} }
} }

View File

@ -16,9 +16,7 @@ resource "azurerm_dns_a_record" "etcds" {
locals { locals {
# Container Linux derivative # Container Linux derivative
# coreos-stable -> Container Linux Stable
# flatcar-stable -> Flatcar Linux Stable # flatcar-stable -> Flatcar Linux Stable
flavor = split("-", var.os_image)[0]
channel = split("-", var.os_image)[1] channel = split("-", var.os_image)[1]
} }
@ -53,23 +51,18 @@ resource "azurerm_linux_virtual_machine" "controllers" {
storage_account_type = "Premium_LRS" storage_account_type = "Premium_LRS"
} }
# CoreOS Container Linux or Flatcar Container Linux # Flatcar Container Linux
source_image_reference { source_image_reference {
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS" publisher = "Kinvolk"
offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS" offer = "flatcar-container-linux-free"
sku = local.channel sku = local.channel
version = "latest" version = "latest"
} }
# Gross hack for Flatcar Linux plan {
dynamic "plan" { name = local.channel
for_each = local.flavor == "flatcar" ? [1] : [] publisher = "kinvolk"
product = "flatcar-container-linux-free"
content {
name = local.channel
publisher = "kinvolk"
product = "flatcar-container-linux-free"
}
} }
# network # network
@ -157,7 +150,7 @@ data "template_file" "controller-configs" {
etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}" etcd_domain = "${var.cluster_name}-etcd${count.index}.${var.dns_zone}"
# etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,... # etcd0=https://cluster-etcd0.example.com,etcd1=https://cluster-etcd1.example.com,...
etcd_initial_cluster = join(",", data.template_file.etcds.*.rendered) 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) kubeconfig = indent(10, module.bootstrap.kubeconfig-kubelet)
ssh_authorized_key = var.ssh_authorized_key ssh_authorized_key = var.ssh_authorized_key
cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_dns_service_ip = cidrhost(var.service_cidr, 10)

View File

@ -48,7 +48,7 @@ variable "worker_type" {
variable "os_image" { variable "os_image" {
type = string 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" default = "flatcar-stable"
} }

View File

@ -46,7 +46,7 @@ variable "vm_type" {
variable "os_image" { variable "os_image" {
type = string 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" default = "flatcar-stable"
} }

View File

@ -1,7 +1,5 @@
locals { locals {
# coreos-stable -> Container Linux Stable
# flatcar-stable -> Flatcar Linux Stable # flatcar-stable -> Flatcar Linux Stable
flavor = split("-", var.os_image)[0]
channel = split("-", var.os_image)[1] channel = split("-", var.os_image)[1]
} }
@ -24,23 +22,18 @@ resource "azurerm_linux_virtual_machine_scale_set" "workers" {
caching = "ReadWrite" caching = "ReadWrite"
} }
# CoreOS Container Linux or Flatcar Container Linux # Flatcar Container Linux
source_image_reference { source_image_reference {
publisher = local.flavor == "flatcar" ? "Kinvolk" : "CoreOS" publisher = "Kinvolk"
offer = local.flavor == "flatcar" ? "flatcar-container-linux-free" : "CoreOS" offer = "flatcar-container-linux-free"
sku = local.channel sku = local.channel
version = "latest" version = "latest"
} }
# Gross hack for Flatcar Linux plan {
dynamic "plan" { name = local.channel
for_each = local.flavor == "flatcar" ? [1] : [] publisher = "kinvolk"
product = "flatcar-container-linux-free"
content {
name = local.channel
publisher = "kinvolk"
product = "flatcar-container-linux-free"
}
} }
# Azure requires setting admin_ssh_key, though Ignition custom_data handles it too # 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 ssh_authorized_key = var.ssh_authorized_key
cluster_dns_service_ip = cidrhost(var.service_cidr, 10) cluster_dns_service_ip = cidrhost(var.service_cidr, 10)
cluster_domain_suffix = var.cluster_domain_suffix 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) node_labels = join(",", var.node_labels)
} }
} }

View File

@ -12,7 +12,7 @@ variable "matchbox_http_endpoint" {
variable "os_channel" { variable "os_channel" {
type = string 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" { variable "os_version" {

View File

@ -1,5 +1,5 @@
locals { locals {
official_images = ["coreos-stable", "coreos-beta", "coreos-alpha"] official_images = []
is_official_image = contains(local.official_images, var.os_image) is_official_image = contains(local.official_images, var.os_image)
} }

View File

@ -43,7 +43,7 @@ variable "worker_type" {
variable "os_image" { variable "os_image" {
type = string 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" { variable "controller_snippets" {

View File

@ -48,7 +48,7 @@ variable "worker_type" {
variable "os_image" { variable "os_image" {
type = string 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" { variable "disk_size" {

View File

@ -36,7 +36,7 @@ variable "machine_type" {
variable "os_image" { variable "os_image" {
type = string 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" { variable "disk_size" {