Skip to content

Commit

Permalink
Remove references to CoreOS Container Linux
Browse files Browse the repository at this point in the history
* 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/
  • Loading branch information
dghubble committed Sep 25, 2020
1 parent 444363b commit 343db5b
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 93 deletions.
7 changes: 7 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 3 additions & 26 deletions aws/container-linux/kubernetes/ami.tf
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -44,7 +21,7 @@ data "aws_ami" "flatcar" {

filter {
name = "name"
values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"]
values = ["Flatcar-${local.channel}-*"]
}
}

2 changes: 1 addition & 1 deletion aws/container-linux/kubernetes/controllers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion aws/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
29 changes: 3 additions & 26 deletions aws/container-linux/kubernetes/workers/ami.tf
Original file line number Diff line number Diff line change
@@ -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"]
Expand All @@ -44,7 +21,7 @@ data "aws_ami" "flatcar" {

filter {
name = "name"
values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"]
values = ["Flatcar-${local.channel}-*"]
}
}

2 changes: 1 addition & 1 deletion aws/container-linux/kubernetes/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
2 changes: 1 addition & 1 deletion aws/container-linux/kubernetes/workers/workers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
}
Expand Down
23 changes: 8 additions & 15 deletions azure/container-linux/kubernetes/controllers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion azure/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
2 changes: 1 addition & 1 deletion azure/container-linux/kubernetes/workers/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}

Expand Down
23 changes: 8 additions & 15 deletions azure/container-linux/kubernetes/workers/workers.tf
Original file line number Diff line number Diff line change
@@ -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]
}

Expand All @@ -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
Expand Down Expand Up @@ -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)
}
}
Expand Down
2 changes: 1 addition & 1 deletion bare-metal/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion digital-ocean/container-linux/kubernetes/controllers.tf
Original file line number Diff line number Diff line change
@@ -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)
}

Expand Down
2 changes: 1 addition & 1 deletion digital-ocean/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion google-cloud/container-linux/kubernetes/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down

0 comments on commit 343db5b

Please sign in to comment.