From 8ef931248e2dabfaa4ac1cc5f05c515ecab01703 Mon Sep 17 00:00:00 2001 From: "Matthew C. Morgan" Date: Fri, 28 Feb 2025 18:17:35 -0500 Subject: [PATCH] autoscaling --- .github/workflows/terragrunt-cicd.yml | 101 ++++++++++++++++++++++++++ values/loki.yaml | 30 ++++++-- 2 files changed, 126 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/terragrunt-cicd.yml 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/values/loki.yaml b/values/loki.yaml index ab5e963..efdcf0f 100644 --- a/values/loki.yaml +++ b/values/loki.yaml @@ -29,6 +29,9 @@ write: requests: cpu: 100m memory: 128Mi + limits: + cpu: 200m + memory: 256Mi extraVolumesMounts: - name: data mountPath: /loki @@ -45,7 +48,9 @@ read: requests: cpu: 100m memory: 128Mi - + limits: + cpu: 200m + memory: 256Mi backend: autoscaling: enabled: true @@ -53,12 +58,18 @@ backend: requests: cpu: 100m memory: 128Mi + limits: + cpu: 200m + memory: 256Mi gateway: resources: requests: cpu: 50m memory: 64Mi + limits: + cpu: 100m + memory: 128Mi compactor: working_directory: /loki/compactor @@ -71,18 +82,27 @@ compactor: requests: cpu: 100m memory: 128Mi + limits: + cpu: 200m + memory: 256Mi sidecar: resources: requests: - cpu: 500m - memory: 512Mi + cpu: 200m + memory: 256Mi + limits: + cpu: 200m + memory: 256Mi ruler: resources: requests: - cpu: 500m - memory: 512Mi + cpu: 200m + memory: 256Mi + limits: + cpu: 200m + memory: 256Mi monitoring: dashboards: