From 70b21cf497734934231c0fe8892dde149a5e3b2c Mon Sep 17 00:00:00 2001 From: Dalton Hubble Date: Sat, 17 Oct 2020 14:41:26 -0700 Subject: [PATCH] Remove asset_dir variable and optional asset writes * Originally, poseidon/terraform-render-bootstrap generated TLS certificates, manifests, and cluster "assets" written to local disk (`asset_dir`) during terraform apply cluster bootstrap * Typhoon v1.17.0 introduced bootstrapping using only Terraform state to store cluster assets, to avoid ever writing sensitive materials to disk and improve automated use-cases. `asset_dir` was changed to optional and defaulted to "" (no writes) * Typhoon v1.18.0 deprecated the `asset_dir` variable, removed docs, and announced it would be deleted in future. * Add Terraform output `assets_dir` map * Remove the `asset_dir` variable Cluster assets are now stored in Terraform state only. For those who wish to write those assets to local files, this is possible doing so explicitly. ``` resource local_file "assets" { for_each = module.yavin.assets_dist filename = "some-assets/${each.key}" content = each.value } ``` Related: * https://github.com/poseidon/typhoon/pull/595 * https://github.com/poseidon/typhoon/pull/678 --- bootstrap.tf | 3 +-- outputs.tf | 6 ++++++ variables.tf | 6 ------ 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/bootstrap.tf b/bootstrap.tf index 0d95b4b..60e01f0 100644 --- a/bootstrap.tf +++ b/bootstrap.tf @@ -1,11 +1,10 @@ # Kubernetes assets (kubeconfig, manifests) module "bootstrap" { - source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=7988fb7159cb81e2d080b365b147fe90542fd258" + source = "git::https://github.com/poseidon/terraform-render-bootstrap.git?ref=9037d7311b949439b217cd9c657d4500eab3e16b" cluster_name = var.cluster_name api_servers = [var.k8s_domain_name] etcd_servers = var.controllers.*.domain - asset_dir = var.asset_dir networking = var.networking network_mtu = var.network_mtu network_ip_autodetection_method = var.network_ip_autodetection_method diff --git a/outputs.tf b/outputs.tf index 8e81ca1..9ad1263 100644 --- a/outputs.tf +++ b/outputs.tf @@ -2,3 +2,9 @@ output "kubeconfig-admin" { value = module.bootstrap.kubeconfig-admin } +# Outputs for debug + +output "assets_dist" { + value = module.bootstrap.assets_dist +} + diff --git a/variables.tf b/variables.tf index 5de6cae..b32fb67 100644 --- a/variables.tf +++ b/variables.tf @@ -152,12 +152,6 @@ variable "enable_aggregation" { # unofficial, undocumented, unsupported -variable "asset_dir" { - type = string - description = "Absolute path to a directory where generated assets should be placed (contains secrets)" - default = "" -} - variable "cluster_domain_suffix" { type = string description = "Queries for domains with the suffix will be answered by coredns. Default is cluster.local (e.g. foo.default.svc.cluster.local) "