chore(terraform): refactored configuration

This commit is contained in:
ITQ
2025-10-31 15:12:35 +03:00
parent 8351a2c667
commit 804444ab74
18 changed files with 143 additions and 171 deletions
+13 -6
View File
@@ -1,4 +1,4 @@
data "template_file" "main_master_cloud_init" {
data "template_file" "k8s_main_master_cloud_init" {
template = file("${path.module}/configs/cloud_init/main_master.yaml")
vars = {
k3s_credential_provider_config = base64encode(file("${path.module}/configs/k3s/credentialprovider.yaml"))
@@ -9,33 +9,40 @@ data "template_file" "main_master_cloud_init" {
}
}
data "template_file" "master_cloud_init" {
data "template_file" "k8s_master_cloud_init" {
template = file("${path.module}/configs/cloud_init/master.yaml")
vars = {
k3s_credential_provider_config = base64encode(file("${path.module}/configs/k3s/credentialprovider.yaml"))
k3s_credential_provider = base64encode(file("${path.module}/configs/k3s/yc-credential-provider"))
k3s_dir = local.k3s_data_dir
k3s_token = random_password.k3s_token.result
k3s_master_ip = local.master_ip
k3s_master_ip = local.k8s_main_master_fqdn
yc_cloud_id = var.cloud_id
}
}
data "template_file" "worker_cloud_init" {
data "template_file" "k8s_worker_cloud_init" {
template = file("${path.module}/configs/cloud_init/worker.yaml")
vars = {
k3s_credential_provider_config = base64encode(file("${path.module}/configs/k3s/credentialprovider.yaml"))
k3s_credential_provider = base64encode(file("${path.module}/configs/k3s/yc-credential-provider"))
k3s_dir = local.k3s_data_dir
k3s_token = random_password.k3s_token.result
k3s_master_ip = local.master_ip
k3s_master_ip = local.k8s_main_master_fqdn
yc_cloud_id = var.cloud_id
}
}
data "template_file" "api_gateway_spec" {
data "template_file" "frontend_api_gateway_spec" {
template = file("${path.module}/configs/api_gateway/spec.yaml")
vars = {
bucket_name = yandex_storage_bucket.frontend.bucket
}
}
data "template_file" "frontend_develop_api_gateway_spec" {
template = file("${path.module}/configs/api_gateway/spec.yaml")
vars = {
bucket_name = yandex_storage_bucket.frontend_develop.bucket
}
}