Skip to content

Commit

Permalink
fix: loki storage config (#905)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-zimnowoda committed Sep 19, 2022
1 parent 81641bc commit a6f8576
Show file tree
Hide file tree
Showing 11 changed files with 68 additions and 54 deletions.
2 changes: 0 additions & 2 deletions tests/fixtures/env/apps/gitea.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
apps:
gitea: {}
1 change: 0 additions & 1 deletion tests/fixtures/env/apps/grafana.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
apps:
grafana:
adminPassword: somesecretvalue
enabled: true
6 changes: 5 additions & 1 deletion tests/fixtures/env/apps/loki.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,9 @@ apps:
retention:
duration: 24h
period: 24h
storageType: filesystem
v11StartDate: '2021-05-13'
storage:
storageType: azure
azure:
account_name: account_name
container_name: container_name
3 changes: 3 additions & 0 deletions tests/fixtures/env/apps/secrets.loki.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
apps:
loki:
adminPassword: somesecretvalue
storage:
azure:
account_key: account_key
5 changes: 2 additions & 3 deletions tests/fixtures/env/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,14 @@ cloud:
- std
- std-immediate
dns:
domainFilters:
- otomi.cloud
provider:
azure:
aadClientId: 00-aadClientId
resourceGroup: external-dns
subscriptionId: 00-subscriptionId
tenantId: 00-tenantId

domainFilters:
- otomi.cloud
zoneIdFilters:
- otomi
home:
Expand Down
7 changes: 5 additions & 2 deletions tests/fixtures/env/teams.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,8 @@ teamConfig:
services.loadbalancers: '1'
selfService:
apps: []
service: ['ingress', 'networkPolicy']
team: ['alerts']
service:
- ingress
- networkPolicy
team:
- alerts
10 changes: 5 additions & 5 deletions tests/fixtures/env/teams/services.demo.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
teamConfig:
demo:
services:
- id: cb5149c4-8ea5-4c5a-be04-a37258658bd3
- auth: true
domain: hello.team-demo.demo.eks.otomi.cloud
id: cb5149c4-8ea5-4c5a-be04-a37258658bd3
ksvc:
image:
repository: otomi/nodejs-helloworld
Expand All @@ -22,10 +24,9 @@ teamConfig:
mode: AllowAll
ownHost: true
port: 80
domain: hello.team-demo.demo.eks.otomi.cloud
type: public
auth: true
- id: cb5149c4-8ea5-4c5a-be04-a37258658bd4
- domain: tlspass.eks.dev.otomi.cloud
id: cb5149c4-8ea5-4c5a-be04-a37258658bd4
ksvc:
image:
repository: otomi/nodejs-helloworld
Expand All @@ -47,7 +48,6 @@ teamConfig:
paths: []
port: 80
type: public
domain: tlspass.eks.dev.otomi.cloud
- id: cb5149c4-8ea5-4c5a-be04-a37258658bd5
ksvc:
containerPort: 80
Expand Down
3 changes: 0 additions & 3 deletions tests/kind/env/apps/grafana.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
apps:
grafana:
adminPassword: somesecretvalue
9 changes: 9 additions & 0 deletions values-changes.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,15 @@ changes:
deletions:
- istio.autoscaling.ingressgateway-private
relocations:
- apps.loki.storageType: apps.loki.storage.storageType
- apps.loki.aws: apps.loki.storage.aws
- apps.loki.azure: apps.loki.storage.azure
- apps.loki.bigtable: apps.loki.storage.bigtable
- apps.loki.cassandra: apps.loki.storage.cassandra
- apps.loki.filesystem: apps.loki.storage.filesystem
- apps.loki.gcs: apps.loki.storage.gcs
- apps.loki.swift: apps.loki.storage.swift
- apps.loki.local: apps.loki.storage.local
- apps.vault.seal.gcpkms.projectId: apps.vault.seal.gcpkms.project
- apps.external-dns.domainFilters: dns.domainFilters
- apps.external-dns.zoneIdFilters: dns.zoneIdFilters
Expand Down
66 changes: 34 additions & 32 deletions values-schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2071,40 +2071,42 @@ properties:
type: string
required:
- duration
aws:
type: object
azure:
description: Missing from docs but available with this schema.
storage:
properties:
account_key:
type: string
x-secret: ''
account_name:
type: string
container_name:
aws:
type: object
azure:
description: Missing from docs but available with this schema.
properties:
account_key:
type: string
x-secret: ''
account_name:
type: string
container_name:
type: string
type: object
bigtable:
type: object
cassandra:
type: object
gcs:
type: object
swift:
type: object
local:
type: object
storageType:
type: string
type: object
bigtable:
type: object
cassandra:
type: object
gcs:
type: object
swift:
type: object
local:
type: object
storageType:
type: string
enum:
- aws
- azure
- bigtable
- cassandra
- filesystem
- gcs
- swift
- local
enum:
- aws
- azure
- bigtable
- cassandra
- filesystem
- gcs
- swift
- local
v11StartDate:
description: Set this to a date just after deployment in case of an upgrade. (Otomi started at v9 with filesystem.)
title: Schema v11 start date
Expand Down
10 changes: 5 additions & 5 deletions values/loki/loki.gotmpl
Original file line number Diff line number Diff line change
Expand Up @@ -32,22 +32,22 @@ config:
{{- end }}
- from: {{ $l | get "v11StartDate" "2021-05-12" }}
store: boltdb-shipper
object_store: {{ $l | get "storageType" "filesystem" }}
object_store: {{ $l | get "storage.storageType" "filesystem" }}
schema: v11
index:
prefix: index_
period: 24h
storage_config:
boltdb_shipper:
shared_store: {{ $l | get "storageType" "filesystem" }}
shared_store: {{ $l | get "storage.storageType" "filesystem" }}
filesystem:
directory: /data/loki/chunks
{{- if ne ($l | get "storageType" "filesystem") "filesystem" }}
{{ $l.storageType }}: {{- $l | get $l.storageType | toYaml | nindent 6 }}
{{- if ne ($l | get "storage.storageType" "filesystem") "filesystem" }}
{{ $l.storageType }}: {{- $l.storage | get $l.storage.storageType | toYaml | nindent 6 }}
{{- end }}
compactor:
retention_enabled: true
shared_store: {{ $l | get "storageType" "filesystem" }}
shared_store: {{ $l | get "storage.storageType" "filesystem" }}
chunk_store_config:
max_look_back_period: {{ $l | get "retention.period" "24h" }}
table_manager:
Expand Down

0 comments on commit a6f8576

Please sign in to comment.