-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: working secret consumption job (#22)
feat: working secret consumption job chore: update version of promtail to v2.7 chore: comment out grpc checks feat(loki): add simple loki jobf inmem feat(loki): working version of loki standalone chore: initial commit of ansible step-up job ci: add initial job for nomad job validation ci: initial commit of vault step ci: split validation workflow into two jobs ci: add a condition for running validation only on nomad changes fix(weather): file is already staged ci: fix nomad path fix(loki): fix name of the journal unit ci: add step to plan the job ci: fix validate nomad step to safely create bin dir ci: add pre-commit autoupdate fix(loki): fix flush period fix(prometheus): query consul on localhost chore: add ansible job fix(grafana): tune resources and version for grafana fix(loki): add trailing slash to kv store for loki collectors fix(prometheus): add relabel configs for consul job lookup fix: fix name of the nomad token policy used in secret demo job Signed-off-by: Bruce Becker <[email protected]> --------- Signed-off-by: Bruce Becker <[email protected]>
- Loading branch information
1 parent
673be55
commit 2c7a7cd
Showing
14 changed files
with
543 additions
and
262 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Nomad Validate | ||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
paths: | ||
- '**.nomad' | ||
|
||
jobs: | ||
tailscale: | ||
env: | ||
NOMAD_ADDR: ${{ secrets.NOMAD_ADDR }} | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Setup Tailscale | ||
uses: tailscale/github-action@main | ||
with: | ||
authkey: ${{ secrets.TAILSCALE_AUTHKEY }} | ||
nomad-plan: | ||
needs: tailscale | ||
runs-on: ubuntu-22.04 | ||
steps: | ||
- name: Get Vault | ||
run: | | ||
mkdir -p bin ; curl -fSL https://releases.hashicorp.com/vault/1.12.3/vault_1.12.3_linux_amd64.zip | gunzip -> bin/vault | ||
- name: Get token | ||
run: chmod u+x bin/vault ; bin/vault -version | ||
- name: Get Nomad | ||
run: | | ||
mkdir -p bin ; curl -fSL https://releases.hashicorp.com/nomad/1.4.4/nomad_1.4.4_linux_amd64.zip | gunzip -> bin/nomad | ||
- name: Checkout change | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Plan the job | ||
run: chmod u+x bin/nomad ; bin/nomad plan ansible.nomad |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Job to add Ansible to all nodes, in order to allow them to | ||
# configure themselves | ||
# This job should install Ansible in a system-wide place. | ||
job "ansible" { | ||
type = "sysbatch" | ||
datacenters = ["dc1"] | ||
name = "Ansible" | ||
|
||
periodic { | ||
cron = "@daily" | ||
enabled = true | ||
} | ||
|
||
group "nodes" { | ||
count = 1 | ||
|
||
task "step-up" { | ||
template { | ||
change_mode = "noop" | ||
destination = "local/install-ansible.sh" | ||
perms = "0777" | ||
|
||
data = <<EOT | ||
#!/bin/env bash | ||
python3 -m pip install ansible | ||
EOT | ||
} | ||
|
||
driver = "raw_exec" | ||
|
||
config { | ||
command = "local/install-ansible.sh" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
variable "loki_version" { | ||
type = string | ||
default = "v2.7.5" | ||
} | ||
|
||
job "loki" { | ||
datacenters = ["dc1"] | ||
type = "service" | ||
name = "loki" | ||
|
||
meta { | ||
auto-backup = true | ||
backup-schedule = "@hourly" | ||
backup-target-db = "postgres" | ||
} | ||
update { | ||
max_parallel = 2 | ||
health_check = "checks" | ||
min_healthy_time = "5s" | ||
healthy_deadline = "300s" | ||
progress_deadline = "10m" | ||
auto_revert = true | ||
auto_promote = true | ||
canary = 1 | ||
} | ||
priority = 80 | ||
group "log-server" { | ||
count = 1 | ||
|
||
network { | ||
port "http" { | ||
static = 3100 | ||
} | ||
port "grpc" { | ||
static = 9096 | ||
} | ||
} | ||
service { | ||
name = "loki-http-server" | ||
tags = ["urlprefix-/loki strip=/loki"] | ||
port = "http" | ||
on_update = "require_healthy" | ||
|
||
check { | ||
name = "loki_ready" | ||
type = "http" | ||
path = "/ready" | ||
port = "http" | ||
interval = "10s" | ||
timeout = "3s" | ||
} | ||
} | ||
|
||
service { | ||
name = "loki-grpc" | ||
port = "grpc" | ||
} | ||
|
||
task "server" { | ||
driver = "exec" | ||
config { | ||
command = "loki" | ||
args = [ | ||
"-config.file=local/loki.yml" | ||
] | ||
} | ||
resources { | ||
cpu = 128 | ||
memory = 200 | ||
} | ||
template { | ||
data = file("loki.yml.tpl") | ||
destination = "local/loki.yml" | ||
change_mode = "restart" | ||
} | ||
artifact { | ||
source = "https://github.com/grafana/loki/releases/download/${var.loki_version}/loki-linux-${attr.cpu.arch}.zip" | ||
options { # checksum depends on the cpu arch | ||
} | ||
destination = "local/loki" | ||
mode = "file" | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
auth_enabled: false | ||
|
||
server: | ||
http_listen_port: {{ env "NOMAD_PORT_http" }} | ||
grpc_listen_port: {{ env "NOMAD_PORT_grpc" }} | ||
register_instrumentation: true | ||
http_server_read_timeout: "40s" | ||
http_server_write_timeout: "50s" | ||
|
||
{{/* distributor: | ||
ring: | ||
kvstore: | ||
store: consul | ||
prefix: loki/collectors */}} | ||
|
||
ingester: | ||
lifecycler: | ||
address: 127.0.0.1 | ||
ring: | ||
kvstore: | ||
store: consul | ||
prefix: loki/collectors | ||
replication_factor: 1 | ||
final_sleep: 0s | ||
chunk_idle_period: 5m | ||
chunk_retain_period: 30s | ||
flush_op_timeout: 20m | ||
schema_config: | ||
configs: | ||
- from: 2022-01-01 | ||
store: boltdb-shipper | ||
object_store: filesystem | ||
schema: v11 | ||
index: | ||
prefix: loki_ | ||
period: 24h | ||
|
||
storage_config: | ||
boltdb_shipper: | ||
active_index_directory: local/index | ||
cache_location: local/index_cache | ||
filesystem: | ||
directory: local/index | ||
|
||
limits_config: | ||
enforce_metric_name: false | ||
reject_old_samples: true | ||
reject_old_samples_max_age: 168h | ||
|
||
compactor: | ||
working_directory: local/data/compactor | ||
shared_store: filesystem | ||
compaction_interval: 5m |
Oops, something went wrong.