Closed aronwolf90 closed 1 year ago
Seconded, how do you utilise the kubeconfig output? Say for the kubernetes provider.
In my projects I'm decoding the yaml in a local variable:
locals {
kubeconfig = yamldecode(k0s_cluster.cluster.kubeconfig)
}
and I'm using it in the provider configurations, for example:
provider "kubernetes" {
host = local.kubeconfig.clusters[0].cluster.server
cluster_ca_certificate = base64decode(local.kubeconfig.clusters[0].cluster.certificate-authority-data)
client_certificate = base64decode(local.kubeconfig.users[0].user.client-certificate-data)
client_key = base64decode(local.kubeconfig.users[0].user.client-key-data)
}
Let me know if this works for you 😄
Ah thanks. Yes It worked for me :)
Is there any way to get the access data? (E.g. cluster_ca_certificate, client_certificate and client_key) . If it is not the case, then I am willing to submit a pull request with a data source (https://developer.hashicorp.com/terraform/plugin/framework/data-sources).