i’m new to terraform so i’ve wanted to write a script that creates a cluster and 1 node and loads the kubeconfig file of the cluster into the node.
so, i’ve seen people using the kubeconfig as an output
output "kube_config_raw" {
value = huaweicloud_cce_cluster.cce.kube_config_raw
}
but it didn’t work when i try kubectl cluster-info
in the node.
also i tried to put this code but it only creates a file and put the kubeconfig code in it and do nothing in the node.
resource "local_file" "kubeconfig" {
content = huaweicloud_cce_cluster.cce.kube_config_raw
filename = "./kube/config"
}
could someone help me with it.
New contributor
Luke_203 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.