From d3e770254de0bb301815ca87257c8b1a357d06c4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 26 Apr 2026 21:02:47 +0800 Subject: hehe --- terraform/envs/bootstrap/.terraform.lock.hcl | 37 ++++++++++++++++++++++++++++ terraform/envs/bootstrap/backend.tf | 5 ++++ terraform/envs/bootstrap/main.tf | 25 +++++++++++++++++++ terraform/envs/bootstrap/variables.tf | 15 +++++++++++ terraform/envs/bootstrap/versions.tf | 7 ++++++ 5 files changed, 89 insertions(+) create mode 100644 terraform/envs/bootstrap/.terraform.lock.hcl create mode 100644 terraform/envs/bootstrap/backend.tf create mode 100644 terraform/envs/bootstrap/main.tf create mode 100644 terraform/envs/bootstrap/variables.tf create mode 100644 terraform/envs/bootstrap/versions.tf (limited to 'terraform/envs/bootstrap') diff --git a/terraform/envs/bootstrap/.terraform.lock.hcl b/terraform/envs/bootstrap/.terraform.lock.hcl new file mode 100644 index 0000000..baa0088 --- /dev/null +++ b/terraform/envs/bootstrap/.terraform.lock.hcl @@ -0,0 +1,37 @@ +# This file is maintained automatically by "tofu init". +# Manual edits may be lost in future updates. + +provider "registry.opentofu.org/hashicorp/helm" { + version = "2.17.0" + constraints = "~> 2.17" + hashes = [ + "h1:69PnHoYrrDrm7C8+8PiSvRGPI55taqL14SvQR/FGM+g=", + "zh:02690815e35131a42cb9851f63a3369c216af30ad093d05b39001d43da04b56b", + "zh:27a62f12b29926387f4d71aeeee9f7ffa0ccb81a1b6066ee895716ad050d1b7a", + "zh:2d0a5babfa73604b3fefc9dab9c87f91c77fce756c2e32b294e9f1290aed26c0", + "zh:3976400ceba6dda4636e1d297e3097e1831de5628afa534a166de98a70d1dcbe", + "zh:54440ef14f342b41d75c1aded7487bfcc3f76322b75894235b47b7e89ac4bfa4", + "zh:6512e2ab9f2fa31cbb90d9249647b5c5798f62eb1215ec44da2cdaa24e38ad25", + "zh:795f327ca0b8c5368af0ed03d5d4f6da7260692b4b3ca0bd004ed542e683464d", + "zh:ba659e1d94f224bc3f1fd34cbb9d2663e3a8e734108e5a58eb49eda84b140978", + "zh:c5c8575c4458835c2acbc3d1ed5570589b14baa2525d8fbd04295c097caf41eb", + "zh:e0877a5dac3de138e61eefa26b2f5a13305a17259779465899880f70e11314e0", + ] +} + +provider "registry.opentofu.org/hashicorp/kubernetes" { + version = "2.38.0" + constraints = "~> 2.31" + hashes = [ + "h1:nY7J9jFXcsRINog0KYagiWZw1GVYF9D2JmtIB7Wnrao=", + "zh:1096b41c4e5b2ee6c1980916fb9a8579bc1892071396f7a9432be058aabf3cbc", + "zh:2959fde9ae3d1deb5e317df0d7b02ea4977951ee6b9c4beb083c148ca8f3681c", + "zh:5082f98fcb3389c73339365f7df39fc6912bf2bd1a46d5f97778f441a67fd337", + "zh:620fd5d0fbc2d7a24ac6b420a4922e6093020358162a62fa8cbd37b2bac1d22e", + "zh:7f47c2de179bba35d759147c53082cad6c3449d19b0ec0c5a4ca8db5b06393e1", + "zh:89c3aa2a87e29febf100fd21cead34f9a4c0e6e7ae5f383b5cef815c677eb52a", + "zh:96eecc9f94938a0bc35b8a63d2c4a5f972395e44206620db06760b730d0471fc", + "zh:e15567c1095f898af173c281b66bffdc4f3068afdd9f84bb5b5b5521d9f29584", + "zh:ecc6b912629734a9a41a7cf1c4c73fb13b4b510afc9e7b2e0011d290bcd6d77f", + ] +} diff --git a/terraform/envs/bootstrap/backend.tf b/terraform/envs/bootstrap/backend.tf new file mode 100644 index 0000000..3c533e6 --- /dev/null +++ b/terraform/envs/bootstrap/backend.tf @@ -0,0 +1,5 @@ +terraform { + backend "local" { + path = "terraform.tfstate" + } +} diff --git a/terraform/envs/bootstrap/main.tf b/terraform/envs/bootstrap/main.tf new file mode 100644 index 0000000..07bf04d --- /dev/null +++ b/terraform/envs/bootstrap/main.tf @@ -0,0 +1,25 @@ +provider "kubernetes" { + config_path = pathexpand(var.kubeconfig) + config_context = var.kube_context +} + +provider "helm" { + kubernetes { + config_path = pathexpand(var.kubeconfig) + config_context = var.kube_context + } +} + +module "observability" { + source = "../../modules/observability" + namespace = "monitoring" + grafana_admin_password = var.grafana_admin_password +} + +output "grafana" { + value = module.observability.grafana_service +} + +output "prometheus" { + value = module.observability.prometheus_service +} diff --git a/terraform/envs/bootstrap/variables.tf b/terraform/envs/bootstrap/variables.tf new file mode 100644 index 0000000..220bed3 --- /dev/null +++ b/terraform/envs/bootstrap/variables.tf @@ -0,0 +1,15 @@ +variable "kubeconfig" { + type = string + default = "~/.kube/config" +} + +variable "kube_context" { + type = string + default = "kind-llm-local" +} + +variable "grafana_admin_password" { + type = string + default = "admin" + sensitive = true +} diff --git a/terraform/envs/bootstrap/versions.tf b/terraform/envs/bootstrap/versions.tf new file mode 100644 index 0000000..0d7f77b --- /dev/null +++ b/terraform/envs/bootstrap/versions.tf @@ -0,0 +1,7 @@ +terraform { + required_version = ">= 1.6.0" + required_providers { + helm = { source = "hashicorp/helm", version = "~> 2.17" } + kubernetes = { source = "hashicorp/kubernetes", version = "~> 2.31" } + } +} -- cgit