grafana / loki

Like Prometheus, but for logs.
https://grafana.com/loki
GNU Affero General Public License v3.0
23.74k stars 3.43k forks source link

Using current tanka example for S3 fails to evaluate #9750

Open kjamieson-xilis opened 1 year ago

kjamieson-xilis commented 1 year ago

Describe the bug When using the example tanka configuration at https://grafana.com/docs/loki/latest/installation/tanka/ , a tk apply results in the following: Error: evaluating jsonnet: RUNTIME ERROR: Attempt to use super when there is no super class. /home/user/tanka/vendor/ksonnet-util/k-compat.libsonnet:20:22-27 function <anonymous> /home/user/tanka/vendor/loki/multi-zone.libsonnet:135:5-52 object <anonymous> Field "ingester_rollout_pdb" During manifestation

To Reproduce Steps to reproduce the behavior:

  1. Use the following main.jsonnet configuration:
local gateway = import 'loki/gateway.libsonnet';
local loki = import 'loki/loki.libsonnet';
local promtail = import 'promtail/promtail.libsonnet';

loki + promtail + gateway {
  _config+:: {
    namespace: 'loki',
    htpasswd_contents: 'loki:$apr1$H4yGiGNg$ssl5/NymaGFRUvxIV1Nyr.',

    // S3 variables -- Remove if not using s3
    storage_backend: 's3,dynamodb',
    s3_access_key: 'key',
    s3_secret_access_key: 'secret access key',
    s3_address: 'url',
    s3_bucket_name: 'loki-test',
    dynamodb_region: 'region',

    // GCS variables -- Remove if not using gcs
    //storage_backend: 'bigtable,gcs',
    //bigtable_instance: 'instance',
    //bigtable_project: 'project',
    //gcs_bucket_name: 'bucket',

    //Set this variable based on the type of object storage you're using.
    boltdb_shipper_shared_store: 'my-object-storage-backend-type',

    //Update the object_store and from fields
    loki+: {
      schema_config: {
        configs: [{
          from: 'YYYY-MM-DD',
          store: 'boltdb-shipper',
          object_store: 'my-object-storage-backend-type',
          schema: 'v11',
          index: {
            prefix: '%s_index_' % $._config.table_prefix,
            period: '%dh' % $._config.index_period_hours,
          },
        }],
      },
    },

    //Update the container_root_path if necessary
    promtail_config+: {
      clients: [{
        scheme:: 'http',
        hostname:: 'gateway.%(namespace)s.svc' % $._config,
        username:: 'loki',
        password:: 'password',
        container_root_path:: '/var/lib/docker',
      }],
    },

    replication_factor: 3,
    consul_replicas: 1,
  },
}

Expected behavior A successful diff or show of manifests for the loki deployment

Environment:

Screenshots, Promtail config, or terminal output If applicable, add any output to help explain your problem. Error: evaluating jsonnet: RUNTIME ERROR: Attempt to use super when there is no super class. /home/user/tanka/vendor/ksonnet-util/k-compat.libsonnet:20:22-27 function <anonymous> /home/user/tanka/vendor/loki/multi-zone.libsonnet:135:5-52 object <anonymous> Field "ingester_rollout_pdb" During manifestation

s1113950 commented 1 year ago

I hit this error as well, fixed it by rolling back jsonnet-libs/k8s-libsonnet from 1.26 to 1.24. 1.25 also didn't work.

thomasherrle commented 1 year ago

I had a similar problem

Error: evaluating jsonnet: RUNTIME ERROR: Field does not exist: v1
        /tmp/loki/vendor/loki/multi-zone.libsonnet:5:31-42
        /tmp/loki/vendor/loki/multi-zone.libsonnet:135:5-24
        Field "ingester_rollout_pdb"
        During manifestation    

The problem was fixed after I initiated anew with the correct kubernetes version: tk init --k8s=1.25

without the k8s parameter it used 1.20 by default.