Skip to content

Commit

Permalink
feat(loki): store logs in digitalocean spaces (#10)
Browse files Browse the repository at this point in the history
feat(loki): create terraform state for loki to write to do spaces
refactor(loki): move variables into specific file
chore(pre-commit): add tfsec pre-commit hook
feat(loki): terraform definition of loki job

This adds a terraform definition for the Loki nomad job:

main.tf creates:
  - logs bucket
  - consul kv store to keep the logs bucket and endpoint
  - nomad job definition

The nomad job definition reads a nomad template for the loki
configuration.

Secrets are written into the template via environment variables
for now, until I can enable Vault in the nomad clients.

Signed-off-by: Bruce Becker <[email protected]>
  • Loading branch information
brucellino authored Jul 11, 2022
1 parent 974872b commit 12a2d15
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 190 deletions.
13 changes: 10 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,21 +1,28 @@
---
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
rev: v4.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: check-merge-conflict

- repo: https://github.com/alessandrojcm/commitlint-pre-commit-hook
rev: v5.0.0
rev: v8.0.0
hooks:
- id: commitlint
stages: [commit-msg]
additional_dependencies: ['@commitlint/config-conventional']

- repo: https://github.com/Yelp/detect-secrets
rev: v1.1.0
rev: v1.2.0
hooks:
- id: detect-secrets
args: ['--baseline', '.secrets.baseline']

- repo: https://github.com/tfsec/tfsec
rev: v1.26.3
hooks:
- id: tfsec-system
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.1.0",
"version": "1.2.0",
"plugins_used": [
{
"name": "ArtifactoryDetector"
Expand Down
46 changes: 0 additions & 46 deletions loki.hcl.tpl

This file was deleted.

140 changes: 0 additions & 140 deletions loki.nomad

This file was deleted.

86 changes: 86 additions & 0 deletions loki/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 12a2d15

Please sign in to comment.