From f4db2459e1dcf14cbcabe58752ad913f365005d2 Mon Sep 17 00:00:00 2001 From: Mateusz Gozdek Date: Mon, 15 Jun 2020 13:31:55 +0200 Subject: [PATCH] platforms: add kubeconfig as Terraform output As part of #623, which is about using kubeconfig file content rather than kubeconfig path around, this commits adds Terraform output with content of kubeconfig file, which can be then pulled during execution using 'terraform output' command. Signed-off-by: Mateusz Gozdek --- pkg/platform/aks/template.go | 5 +++++ pkg/platform/aws/template.go | 5 +++++ pkg/platform/baremetal/template.go | 5 +++++ pkg/platform/packet/template.go | 5 +++++ 4 files changed, 20 insertions(+) diff --git a/pkg/platform/aks/template.go b/pkg/platform/aks/template.go index 0f267d0f5..0f5ecaaea 100644 --- a/pkg/platform/aks/template.go +++ b/pkg/platform/aks/template.go @@ -223,4 +223,9 @@ output "initialized" { value = true sensitive = true } + +output "kubeconfig" { + value = azurerm_kubernetes_cluster.aks.kube_config_raw + sensitive = true +} ` diff --git a/pkg/platform/aws/template.go b/pkg/platform/aws/template.go index 05aee7cf1..71bd02c0f 100644 --- a/pkg/platform/aws/template.go +++ b/pkg/platform/aws/template.go @@ -231,4 +231,9 @@ output "calico_values" { value = module.aws-{{.Config.ClusterName}}.calico_values sensitive = true } + +output "kubeconfig" { + value = module.aws-{{.Config.ClusterName}}.kubeconfig-admin + sensitive = true +} ` diff --git a/pkg/platform/baremetal/template.go b/pkg/platform/baremetal/template.go index f1500e104..a3b921826 100644 --- a/pkg/platform/baremetal/template.go +++ b/pkg/platform/baremetal/template.go @@ -119,4 +119,9 @@ output "calico_values" { value = module.bare-metal-{{.ClusterName}}.calico_values sensitive = true } + +output "kubeconfig" { + value = module.bare-metal-{{.ClusterName}}.kubeconfig-admin + sensitive = true +} ` diff --git a/pkg/platform/packet/template.go b/pkg/platform/packet/template.go index 940d167d4..b5f470eb3 100644 --- a/pkg/platform/packet/template.go +++ b/pkg/platform/packet/template.go @@ -305,4 +305,9 @@ output "calico_values" { value = module.packet-{{.Config.ClusterName}}.calico_values sensitive = true } + +output "kubeconfig" { + value = module.packet-{{.Config.ClusterName}}.kubeconfig-admin + sensitive = true +} `