diff --git a/README.md b/README.md index ef6981f..d77b9fa 100644 --- a/README.md +++ b/README.md @@ -403,6 +403,20 @@ kubectl delete namespace tarun-spring-app ``` This ensures the namespace and all resources within it are deleted. +## Deploying with Terraform + +The `terraform` directory provides the same Kubernetes resources using Terraform. +The configuration is split across multiple `.tf` files for readability and Terraform automatically loads all of them. +Run the following commands to apply them: + +```bash +cd terraform +terraform init +terraform apply +``` + +Ensure your kubeconfig is accessible (by default `~/.kube/config`). + ## Future Enhancements Below are some potential enhancements and next steps for this project: diff --git a/terraform/configmap.tf b/terraform/configmap.tf new file mode 100644 index 0000000..7369bfa --- /dev/null +++ b/terraform/configmap.tf @@ -0,0 +1,22 @@ +resource "kubernetes_config_map" "spring_app_config" { + metadata { + name = "spring-app-config" + namespace = kubernetes_namespace.spring.metadata[0].name + } + + data = { + "application.properties" = <