From 5c4486f57be4801a93e232b45b016f70806a042e Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Tue, 11 Jun 2019 22:13:41 -0700 Subject: [PATCH] Allow using Flatcar Linux Edge on bare-metal and AWS * On AWS, use Flatcar Linux Edge by setting `os_image` to "flatcar-edge" * On bare-metal, Flatcar Linux Edge by setting `os_channel` to "flatcar-edge" --- CHANGES.md | 2 ++ aws/container-linux/kubernetes/ami.tf | 4 ++-- aws/container-linux/kubernetes/variables.tf | 2 +- aws/container-linux/kubernetes/workers/ami.tf | 4 ++-- aws/container-linux/kubernetes/workers/variables.tf | 2 +- bare-metal/container-linux/kubernetes/variables.tf | 4 ++-- docs/cl/aws.md | 2 +- docs/cl/bare-metal.md | 2 +- docs/index.md | 4 ++-- 9 files changed, 14 insertions(+), 12 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a4f1748c..6d12b342 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -12,6 +12,7 @@ Notable changes between versions. #### AWS * Require `terraform-provider-aws` v2.7+ to support Terraform v0.12 (action required) +* Allow using Flatcar Linux Edge by setting `os_image` to "flatcar-edge" #### Azure @@ -23,6 +24,7 @@ Notable changes between versions. #### Bare-Metal * Require `terraform-provider-matchbox` v0.3.0+ to support Terraform v0.12 (action required) +* Allow using Flatcar Linux Edge by setting `os_channel` to "flatcar-edge" #### DigitalOcean diff --git a/aws/container-linux/kubernetes/ami.tf b/aws/container-linux/kubernetes/ami.tf index cde47bdf..b5124b4b 100644 --- a/aws/container-linux/kubernetes/ami.tf +++ b/aws/container-linux/kubernetes/ami.tf @@ -24,7 +24,7 @@ data "aws_ami" "coreos" { filter { name = "name" - values = ["CoreOS-${local.channel}-*"] + values = ["CoreOS-${local.flavor == "coreos" ? local.channel : "stable"}-*"] } } @@ -44,7 +44,7 @@ data "aws_ami" "flatcar" { filter { name = "name" - values = ["Flatcar-${local.channel}-*"] + values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] } } diff --git a/aws/container-linux/kubernetes/variables.tf b/aws/container-linux/kubernetes/variables.tf index 42d03282..7005e63b 100644 --- a/aws/container-linux/kubernetes/variables.tf +++ b/aws/container-linux/kubernetes/variables.tf @@ -44,7 +44,7 @@ variable "worker_type" { variable "os_image" { type = string default = "coreos-stable" - description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha)" + description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" } variable "disk_size" { diff --git a/aws/container-linux/kubernetes/workers/ami.tf b/aws/container-linux/kubernetes/workers/ami.tf index cde47bdf..b5124b4b 100644 --- a/aws/container-linux/kubernetes/workers/ami.tf +++ b/aws/container-linux/kubernetes/workers/ami.tf @@ -24,7 +24,7 @@ data "aws_ami" "coreos" { filter { name = "name" - values = ["CoreOS-${local.channel}-*"] + values = ["CoreOS-${local.flavor == "coreos" ? local.channel : "stable"}-*"] } } @@ -44,7 +44,7 @@ data "aws_ami" "flatcar" { filter { name = "name" - values = ["Flatcar-${local.channel}-*"] + values = ["Flatcar-${local.flavor == "flatcar" ? local.channel : "stable"}-*"] } } diff --git a/aws/container-linux/kubernetes/workers/variables.tf b/aws/container-linux/kubernetes/workers/variables.tf index 67b5e061..e5c5b608 100644 --- a/aws/container-linux/kubernetes/workers/variables.tf +++ b/aws/container-linux/kubernetes/workers/variables.tf @@ -37,7 +37,7 @@ variable "instance_type" { variable "os_image" { type = string default = "coreos-stable" - description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha)" + description = "AMI channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" } variable "disk_size" { diff --git a/bare-metal/container-linux/kubernetes/variables.tf b/bare-metal/container-linux/kubernetes/variables.tf index 18e7d009..a95a808b 100644 --- a/bare-metal/container-linux/kubernetes/variables.tf +++ b/bare-metal/container-linux/kubernetes/variables.tf @@ -12,12 +12,12 @@ 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)" + description = "Channel for a Container Linux derivative (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge)" } variable "os_version" { type = string - description = "Version for a Container Linux derivative to PXE and install (coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha)" + description = "Version for a Container Linux derivative to PXE and install (e.g. 2079.5.1)" } # machines diff --git a/docs/cl/aws.md b/docs/cl/aws.md index 857a72b7..2c35c147 100644 --- a/docs/cl/aws.md +++ b/docs/cl/aws.md @@ -208,7 +208,7 @@ Reference the DNS zone id with `"${aws_route53_zone.zone-for-clusters.zone_id}"` | worker_count | Number of workers | 1 | 3 | | controller_type | EC2 instance type for controllers | "t3.small" | See below | | worker_type | EC2 instance type for workers | "t3.small" | See below | -| os_image | AMI channel for a Container Linux derivative | coreos-stable | coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha | +| os_image | AMI channel for a Container Linux derivative | coreos-stable | coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge | | disk_size | Size of the EBS volume in GB | "40" | "100" | | disk_type | Type of the EBS volume | "gp2" | standard, gp2, io1 | | disk_iops | IOPS of the EBS volume | "0" (i.e. auto) | "400" | diff --git a/docs/cl/bare-metal.md b/docs/cl/bare-metal.md index b9ad5e78..5ebe1f5f 100644 --- a/docs/cl/bare-metal.md +++ b/docs/cl/bare-metal.md @@ -336,7 +336,7 @@ Check the [variables.tf](https://github.com/poseidon/typhoon/blob/master/bare-me |:-----|:------------|:--------| | cluster_name | Unique cluster name | mercury | | matchbox_http_endpoint | Matchbox HTTP read-only endpoint | http://matchbox.example.com:port | -| os_channel | Channel for a Container Linux derivative | coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha | +| os_channel | Channel for a Container Linux derivative | coreos-stable, coreos-beta, coreos-alpha, flatcar-stable, flatcar-beta, flatcar-alpha, flatcar-edge | | os_version | Version for a Container Linux derivative to PXE and install | 1632.3.0 | | k8s_domain_name | FQDN resolving to the controller(s) nodes. Workers and kubectl will communicate with this endpoint | "myk8s.example.com" | | ssh_authorized_key | SSH public key for user 'core' | "ssh-rsa AAAAB3Nz..." | diff --git a/docs/index.md b/docs/index.md index 593faf28..ecbaf87c 100644 --- a/docs/index.md +++ b/docs/index.md @@ -23,9 +23,9 @@ Typhoon provides a Terraform Module for each supported operating system and plat | Platform | Operating System | Terraform Module | Status | |---------------|------------------|------------------|--------| -| AWS | Container Linux | [aws/container-linux/kubernetes](cl/aws.md) | stable | +| AWS | Container Linux / Flatcar Linux | [aws/container-linux/kubernetes](cl/aws.md) | stable | | Azure | Container Linux | [azure/container-linux/kubernetes](cl/azure.md) | alpha | -| Bare-Metal | Container Linux | [bare-metal/container-linux/kubernetes](cl/bare-metal.md) | stable | +| Bare-Metal | Container Linux / Flatcar Linux | [bare-metal/container-linux/kubernetes](cl/bare-metal.md) | stable | | Digital Ocean | Container Linux | [digital-ocean/container-linux/kubernetes](cl/digital-ocean.md) | beta | | Google Cloud | Container Linux | [google-cloud/container-linux/kubernetes](cl/google-cloud.md) | stable |