Skip to content

Commit

Permalink
user-logging: add loki for non-platform-logs as loki-user
Browse files Browse the repository at this point in the history
  • Loading branch information
sungil committed Jun 24, 2024
1 parent 9411e00 commit 61a9340
Show file tree
Hide file tree
Showing 2 changed files with 99 additions and 1 deletion.
84 changes: 83 additions & 1 deletion lma/base/resources.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -748,7 +748,7 @@ spec:
type: helmrepo
repository: https://harbor.taco-cat.xyz/chartrepo/tks
name: lma-addons
version: 1.8.7
version: 1.9.0
origin: https://openinfradev.github.io/helm-repo
releaseName: addons
targetNamespace: lma
Expand All @@ -762,6 +762,9 @@ spec:
loki:
enabled: true
url: "loki-loki-distributed-gateway.lma"
lokiuser:
enabled: true
url: "loki-loki-distributed-gateway.lma"
grafanaDashboard:
include:
- kubernetes
Expand Down Expand Up @@ -1225,6 +1228,85 @@ spec:
---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
labels:
name: loki-user
name: loki-user
spec:
helmVersion: v3
chart:
type: helmrepo
repository: https://harbor.taco-cat.xyz/chartrepo/tks
name: loki-distributed
version: 0.58.0
origin: https://grafana.github.io/helm-charts
releaseName: loki-user
targetNamespace: lma
values:
global:
clusterDomain: cluster.local # TO_BE_FIXED
dnsService: coredns
loki:
image:
registry: harbor.taco-cat.xyz
repository: tks/loki
tag: null
schemaConfig:
configs:
- from: "2020-09-07"
store: boltdb-shipper
object_store: s3
schema: v11
index:
prefix: loki_index_
period: 24h
storageConfig:
boltdb_shipper:
active_index_directory: /var/loki/index
cache_location: /var/loki/cache
cache_ttl: 24h # Can be increased for faster performance over longer query periods, uses more disk space
shared_store: s3
aws:
s3: TO_BE_FIXED
bucketnames: tks-loki-user
s3forcepathstyle: true
structuredConfig:
limits_config:
ingestion_rate_mb: 25
ingestion_burst_size_mb: 50
max_streams_per_user: 0
max_global_streams_per_user: 0
table_manager:
retention_deletes_enabled: true
retention_period: TO_BE_FIXED
serviceMonitor.enabled: true
prometheusRule.enabled: true
ingester:
resources:
limits:
cpu: '4'
memory: 4Gi
requests:
cpu: 100m
memory: 250Mi
persistence:
enabled: true
inMemory: false
size: 100Gi
memcachedExporter.enabled: true
gateway:
image:
registry: harbor.taco-cat.xyz
repository: tks/nginx-unprivileged

nginxConfig:
httpSnippet: |-
client_max_body_size 50M;
serverSnippet: |-
client_max_body_size 50M;
---
apiVersion: helm.fluxcd.io/v1
kind: HelmRelease
metadata:
labels:
name: lma-bucket
Expand Down
16 changes: 16 additions & 0 deletions lma/base/site-values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ global:

lokiHost: loki-loki-distributed-gateway
lokiPort: 80
lokiuserHost: loki-user-loki-distributed-gateway
lokiuserPort: 80
grafanaDatasourceMetric: lma-prometheus.lma:9090

charts:
Expand Down Expand Up @@ -147,6 +149,7 @@ charts:
grafanaDatasource.prometheus.url: $(grafanaDatasourceMetric)
# grafanaDatasource.prometheus.url: "thanos-query.lma:9090"
grafanaDatasource.loki.url: $(lokiHost):$(lokiPort)
grafanaDatasource.lokiuser.url: $(lokiuserHost):$(lokiuserPort)

- name: prometheus-adapter
override:
Expand All @@ -173,11 +176,18 @@ charts:
purge: false
versioning: true
objectlocking: false
- name: loki-user
policy: public
purge: false
versioning: true
objectlocking: false
customCommands:
- command: ilm rule add --expire-days 90 myminio/tks-thanos
- command: ilm rule add --expire-days 15 myminio/tks-loki
- command: ilm rule add --expire-days 15 myminio/tks-loki-user
- command: ilm ls myminio/tks-thanos
- command: ilm ls myminio/tks-loki
- command: ilm ls myminio/tks-loki-user
persistence.storageClass: $(storageClassName)
persistence.accessMode: ReadWriteOnce
persistence.size: 20Gi
Expand Down Expand Up @@ -260,10 +270,16 @@ charts:
loki.storageConfig.aws.s3: http://$(defaultUser):$(defaultPassword)@minio.lma.svc:9000/minio
loki.structuredConfig.table_manager.retention_period: 672h # delete logs after 672h = 28 days

- name: loki-user
override:
loki.storageConfig.aws.s3: http://$(defaultUser):$(defaultPassword)@minio.lma.svc:9000/minio
loki.structuredConfig.table_manager.retention_period: 672h # delete logs after 672h = 28 days

- name: lma-bucket
override:
s3.enabled: true
s3.buckets:
- name: $(clusterName)-tks-thanos
- name: $(clusterName)-tks-loki
- name: $(clusterName)-tks-loki-user
# tks.iamRoles: arn:aws:iam::12345678:role/control-plane.cluster-api-provider-aws.sigs.k8s.io

0 comments on commit 61a9340

Please sign in to comment.