github.com/yankunsam/loki/v2@v2.6.3-0.20220817130409-389df5235c27/production/ksonnet/loki-simple-scalable/example/main.jsonnet (about)

     1  local k = import 'ksonnet-util/kausal.libsonnet',
     2        loki = import 'github.com/grafana/jsonnet-libs/loki-simple-scalable/loki.libsonnet',
     3        namespace = 'loki-ssd-jsonnet-libs',
     4        cluster = 'ssd-jsonnet-libs',
     5        grpc_listen_port = 9095,
     6        s3Url = 's3://loki:supersecret@minio.%s.svc.cluster.local:9000/loki-data' % namespace,
     7        pvc = k.core.v1.persistentVolumeClaim;
     8  
     9  loki {
    10    _images+:: {
    11      loki: 'grafana/loki:2.6.1',
    12    },
    13  
    14    _config+:: {
    15      headless_service_name: 'loki',
    16      http_listen_port: 3100,
    17      read_replicas: 1,
    18      write_replicas: 1,
    19      loki: {
    20        auth_enabled: false,
    21        server: {
    22          http_listen_port: $._config.http_listen_port,
    23          grpc_listen_port: grpc_listen_port,
    24        },
    25        memberlist: {
    26          join_members: [
    27            '%s.%s.svc.cluster.local' % [$._config.headless_service_name, namespace],
    28          ],
    29        },
    30        common: {
    31          path_prefix: '/loki',
    32          replication_factor: 1,
    33          storage: {
    34            s3: {
    35              s3: s3Url,
    36              s3forcepathstyle: true,
    37            },
    38          },
    39        },
    40        limits_config: {
    41          enforce_metric_name: false,
    42          reject_old_samples_max_age: '168h',  //1 week
    43          max_global_streams_per_user: 60000,
    44          ingestion_rate_mb: 75,
    45          ingestion_burst_size_mb: 100,
    46        },
    47        schema_config: {
    48          configs: [{
    49            from: '2021-09-12',
    50            store: 'boltdb-shipper',
    51            object_store: 's3',
    52            schema: 'v11',
    53            index: {
    54              prefix: '%s_index_' % namespace,
    55              period: '24h',
    56            },
    57          }],
    58        },
    59      },
    60    },
    61  
    62    write_pvc+::
    63      pvc.mixin.spec.withStorageClassName('local-path'),
    64    read_pvc+::
    65      pvc.mixin.spec.withStorageClassName('local-path'),
    66  }