Switch to using Flatcar Linux images on Google Cloud

* Use the official Kinvolk Flatcar Linux image on Google Cloud
* Change `os_image` from a custom image name to `flatcar-stable`
(default), `flatcar-beta`, or `flatcar-alpha` (**action required**)
* Change `os_image` from a required to an optional variable
* Promote Typhoon on Flatcar Linux / Google Cloud to stable
* Remove docs about needing to upload a Flatcar Linux image
manually on Google Cloud and drop support for custom images
This commit is contained in:
Dalton Hubble
2022-01-28 20:59:15 -08:00
parent a527f73f5a
commit e06ee042ee
11 changed files with 39 additions and 28 deletions

View File

@ -42,7 +42,7 @@ resource "google_compute_instance" "controllers" {
auto_delete = true
initialize_params {
image = var.os_image
image = data.google_compute_image.flatcar-linux.self_link
size = var.disk_size
}
}

View File

@ -0,0 +1,6 @@
# Flatcar Linux most recent image from channel
data "google_compute_image" "flatcar-linux" {
project = "kinvolk-public"
family = "${var.os_image}"
}

View File

@ -48,7 +48,13 @@ variable "worker_type" {
variable "os_image" {
type = string
description = "Flatcar Linux image for compute instances (e.g. custom-image)"
description = "Flatcar Linux image for compute instances (flatcar-stable, flatcar-beta, flatcar-alpha)"
default = "flatcar-stable"
validation {
condition = contains(["flatcar-stable", "flatcar-beta", "flatcar-alpha"], var.os_image)
error_message = "The os_image must be flatcar-stable, flatcar-beta, or flatcar-alpha."
}
}
variable "disk_size" {

View File

@ -0,0 +1,5 @@
# Flatcar Linux most recent image from channel
data "google_compute_image" "flatcar-linux" {
project = "kinvolk-public"
family = "${var.os_image}"
}

View File

@ -36,7 +36,13 @@ variable "machine_type" {
variable "os_image" {
type = string
description = "Flatcar Linux image for compute instanges (e.g. gcloud compute images list)"
description = "Flatcar Linux image for compute instances (flatcar-stable, flatcar-beta, flatcar-alpha)"
default = "flatcar-stable"
validation {
condition = contains(["flatcar-stable", "flatcar-beta", "flatcar-alpha"], var.os_image)
error_message = "The os_image must be flatcar-stable, flatcar-beta, or flatcar-alpha."
}
}
variable "disk_size" {

View File

@ -43,7 +43,7 @@ resource "google_compute_instance_template" "worker" {
disk {
auto_delete = true
boot = true
source_image = var.os_image
source_image = data.google_compute_image.flatcar-linux.self_link
disk_size_gb = var.disk_size
}