Add cluster bootstrap

This commit is contained in:
Khue Doan 2021-04-22 00:12:14 +07:00
parent 7cb4264c1a
commit 93ee9e025e
3 changed files with 11 additions and 4 deletions

View File

@ -9,9 +9,9 @@ terraform {
provider "helm" {
kubernetes {
host = var.kubeconfig.host
client_certificate = var.kubeconfig.client_certificate
client_key = var.kubeconfig.client_key
cluster_ca_certificate = var.kubeconfig.cluster_ca_certificate
host = yamldecode(var.kube_config)["clusters"][0]["cluster"]["server"]
cluster_ca_certificate = base64decode(yamldecode(var.kube_config)["clusters"][0]["cluster"]["certificate-authority-data"])
client_certificate = base64decode(yamldecode(var.kube_config)["users"][0]["user"]["client-certificate-data"])
client_key = base64decode(yamldecode(var.kube_config)["users"][0]["user"]["client-key-data"])
}
}

View File

@ -0,0 +1,3 @@
variable "kube_config" {
description = "Kubernetes config"
}

View File

@ -0,0 +1,4 @@
module "rke_cluster_bootstrap" {
source = "../modules/kubernetes-cluster-bootstrap"
kube_config = rke_cluster.cluster.kube_config_yaml
}