From 36cde2094e74d1f5872f85cb1bd1c1d30a4493d1 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Wed, 26 Feb 2025 17:41:21 -0500 Subject: [PATCH 1/7] revert replicas change --- .github/dependabot.yml | 11 +++ .github/workflows/terragrunt-cicd.yml | 101 ++++++++++++++++++++++++++ main.tf | 4 +- 3 files changed, 114 insertions(+), 2 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 .github/workflows/terragrunt-cicd.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..867570d --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "terraform" # See documentation for possible values + directory: "/" # Location of package manifests + schedule: + interval: "daily" diff --git a/.github/workflows/terragrunt-cicd.yml b/.github/workflows/terragrunt-cicd.yml new file mode 100644 index 0000000..a78523e --- /dev/null +++ b/.github/workflows/terragrunt-cicd.yml @@ -0,0 +1,101 @@ +name: 'Terraform Module CI' + +on: + push: + branches: + - main + paths: + - '**/*.hcl' + - '**/*.tf' + pull_request: + branches: + - main + paths: + - '**/*.hcl' + - '**/*.tf' + +permissions: + contents: read + pull-requests: write + +jobs: + validate: + name: 'Validate Module' + runs-on: self-hosted + + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup Terraform + uses: hashicorp/setup-terraform@v2 + with: + terraform_version: 1.5.0 + + - name: Terraform Init + run: | + terraform init -backend=false + + - name: Terraform Format + run: | + terraform fmt -check + + - name: Terraform Validate + run: | + terraform validate + + - name: Run tflint + uses: terraform-linters/setup-tflint@v3 + if: github.event_name == 'pull_request' + + - name: Lint Terraform + if: github.event_name == 'pull_request' + run: | + tflint --format compact + + release: + name: 'Create Release' + needs: validate + if: github.ref == 'refs/heads/main' && github.event_name == 'push' + runs-on: self-hosted + permissions: + contents: write + + steps: + - name: Checkout + uses: actions/checkout@v3 + with: + fetch-depth: 0 + token: ${{ secrets.GITHUB_TOKEN }} + + - name: Setup Python + uses: actions/setup-python@v4 + with: + python-version: '3.9' + + - name: Install Commitizen + run: | + pip install commitizen + + - name: Configure Git + run: | + git config --local user.email "action@github.com" + git config --local user.name "GitHub Action" + + - name: Bump Version and Generate Changelog + id: cz + run: | + cz bump --yes + echo "new_version=$(cz version --project)" >> $GITHUB_OUTPUT + echo "changelog=$(cz changelog --dry-run)" >> $GITHUB_OUTPUT + + - name: Create Release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + tag_name: v${{ steps.cz.outputs.new_version }} + release_name: Release v${{ steps.cz.outputs.new_version }} + draft: false + prerelease: false + body: ${{ steps.cz.outputs.changelog }} diff --git a/main.tf b/main.tf index 9c9b28e..6b87b1f 100644 --- a/main.tf +++ b/main.tf @@ -57,8 +57,8 @@ resource "helm_release" "tempo" { value = "3" } set { - name = "tempo.storage.trace.s3.insecure" - value = "false" + name = "replicas" + value = "2" } set { name = "tempo.repository" From 7bd15ea28054534a2155396df0bc9933f372ad6d Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Fri, 28 Feb 2025 18:21:59 -0500 Subject: [PATCH 2/7] autoscaling --- tempo_values.yaml | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/tempo_values.yaml b/tempo_values.yaml index 24b0ce7..70ebf27 100644 --- a/tempo_values.yaml +++ b/tempo_values.yaml @@ -25,19 +25,53 @@ persistence: ingester: autoscaling: enabled: true + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" distributor: autoscaling: enabled: true + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" compactor: autoscaling: enabled: true + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" querier: autoscaling: enabled: true + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" gateway: autoscaling: enabled: true - + resources: + requests: + cpu: "100m" + memory: "128Mi" + limits: + cpu: "200m" + memory: "256Mi" traces: jaeger: zipkin: From e4f4d85852a8c884a4dd7f829b379f54d76b94c1 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 3 Mar 2025 20:05:27 -0500 Subject: [PATCH 3/7] try tempo-distributed --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 6b87b1f..6b307a0 100644 --- a/main.tf +++ b/main.tf @@ -42,7 +42,7 @@ module "tempo-irsa-role" { # Helm Chart for Tempo ################################################################################ resource "helm_release" "tempo" { - chart = "tempo" + chart = "tempo-distributed" version = var.tempo_chart_version name = "tempo" namespace = var.namespace From c82dff1ff4059b58b80bfc5824a745c04a5af6dc Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 3 Mar 2025 20:10:20 -0500 Subject: [PATCH 4/7] would require config update --- main.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.tf b/main.tf index 6b307a0..6b87b1f 100644 --- a/main.tf +++ b/main.tf @@ -42,7 +42,7 @@ module "tempo-irsa-role" { # Helm Chart for Tempo ################################################################################ resource "helm_release" "tempo" { - chart = "tempo-distributed" + chart = "tempo" version = var.tempo_chart_version name = "tempo" namespace = var.namespace From 0770e41f71fa585420c5410bfeb07b9123317f27 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Mon, 3 Mar 2025 21:08:29 -0500 Subject: [PATCH 5/7] use bitnami image --- copy_images.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/copy_images.tf b/copy_images.tf index 71b92d2..7d14060 100644 --- a/copy_images.tf +++ b/copy_images.tf @@ -6,8 +6,8 @@ locals { enabled = true dest_path = null name = "tempo" - source_image = "grafana/tempo" - source_registry = "docker.io" + source_image = "bitnami/grafana-tempo" + source_registry = "public.ecr.aws" source_tag = var.tempo_tag tag = var.tempo_tag } From ca280ae39df86d104c5810e6d6f37ee304bb04d5 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Thu, 6 Mar 2025 18:08:20 -0500 Subject: [PATCH 6/7] rebase --- README.md | 2 ++ main.tf | 8 ++------ outputs.tf | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 2f92f12..e587c7f 100644 --- a/README.md +++ b/README.md @@ -72,4 +72,6 @@ Developer NOTE: We should automate this configuration. |------|-------------| | [module\_name](#output\_module\_name) | The name of this module. | | [module\_version](#output\_module\_version) | The version of this module. | +| [tempo\_internal\_endpoint](#output\_tempo\_internal\_endpoint) | internal endpoint for tempo | +| [tempo\_otlp\_endpoint](#output\_tempo\_otlp\_endpoint) | internal otlp endpoint for tempo | diff --git a/main.tf b/main.tf index 6b87b1f..f25d872 100644 --- a/main.tf +++ b/main.tf @@ -7,8 +7,8 @@ locals { tempo_internal_port_number = 3100 tempo_internal_url = format("http://%v:%v/", local.tempo_internal_hostname, local.tempo_internal_port_number) - tempo_otlp_port_number = 4317 - tempo_otlp_url = format("http://%v:%v", local.tempo_internal_hostname, local.tempo_otlp_port_number) + tempo_otlp_port_number = 4317 + tempo_otlp_url = format("http://%v:%v", local.tempo_internal_hostname, local.tempo_otlp_port_number) } ################################################################################ @@ -52,10 +52,6 @@ resource "helm_release" "tempo" { wait = true timeout = 300 - set { - name = "replicas" - value = "3" - } set { name = "replicas" value = "2" diff --git a/outputs.tf b/outputs.tf index 35a58ea..de75fba 100644 --- a/outputs.tf +++ b/outputs.tf @@ -9,7 +9,7 @@ output "tempo_internal_endpoint" { port_number = local.tempo_internal_port_number url = local.tempo_internal_url } -} +} output "tempo_otlp_endpoint" { description = "internal otlp endpoint for tempo" @@ -18,7 +18,7 @@ output "tempo_otlp_endpoint" { port_number = local.tempo_otlp_port_number url = local.tempo_otlp_url } -} +} output "module_name" { description = "The name of this module." From ff73b7cc6b9e113a58b6f256b0864f6fee54e5d7 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Thu, 6 Mar 2025 19:53:53 -0500 Subject: [PATCH 7/7] update values --- main.tf | 2 +- tempo_values.yaml | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main.tf b/main.tf index f25d872..745a29c 100644 --- a/main.tf +++ b/main.tf @@ -54,7 +54,7 @@ resource "helm_release" "tempo" { set { name = "replicas" - value = "2" + value = "1" } set { name = "tempo.repository" diff --git a/tempo_values.yaml b/tempo_values.yaml index 70ebf27..24a6bbd 100644 --- a/tempo_values.yaml +++ b/tempo_values.yaml @@ -27,8 +27,8 @@ ingester: enabled: true resources: requests: - cpu: "100m" - memory: "128Mi" + cpu: "1m" + memory: "1Mi" limits: cpu: "200m" memory: "256Mi" @@ -37,8 +37,8 @@ distributor: enabled: true resources: requests: - cpu: "100m" - memory: "128Mi" + cpu: "1m" + memory: "1Mi" limits: cpu: "200m" memory: "256Mi" @@ -47,8 +47,8 @@ compactor: enabled: true resources: requests: - cpu: "100m" - memory: "128Mi" + cpu: "1m" + memory: "1Mi" limits: cpu: "200m" memory: "256Mi" @@ -57,8 +57,8 @@ querier: enabled: true resources: requests: - cpu: "100m" - memory: "128Mi" + cpu: "1m" + memory: "1Mi" limits: cpu: "200m" memory: "256Mi" @@ -67,8 +67,8 @@ gateway: enabled: true resources: requests: - cpu: "100m" - memory: "128Mi" + cpu: "1m" + memory: "1Mi" limits: cpu: "200m" memory: "256Mi"