holos-run / holos

Holos - The Holistic platform manager
https://holos.run
Apache License 2.0
24 stars 0 forks source link

Error rendering the loki chart with default values #347

Closed mcfearsome closed 2 hours ago

mcfearsome commented 2 hours ago

This is happening both with default values and if I actually configure the chart.

could not run: could not run helm template: Error: template: loki/templates/write/statefulset-write.yaml:50:28: executing "loki/templates/write/statefulset-write.yaml" at <include (print .Template.BasePath "/config.yaml") .>: error calling include: template: loki/templates/config.yaml:19:7: executing "loki/templates/config.yaml" at <include "loki.calculatedConfig" .>: error calling include: template: loki/templates/_helpers.tpl:508:24: executing "loki.calculatedConfig" at <tpl .Values.loki.config .>: error calling tpl: error during tpl function execution for "{{- if .Values.enterprise.enabled}}\n{{- tpl .Values.enterprise.config . }}\n{{- else }}\nauth_enabled: {{ .Values.loki.auth_enabled }}\n{{- end }}\n\n{{- with .Values.loki.server }}\nserver:\n  {{- toYaml . | nindent 2}}\n{{- end}}\n\npattern_ingester:\n  enabled: {{ .Values.loki.pattern_ingester.enabled }}\n\nmemberlist:\n{{- if .Values.loki.memberlistConfig }}\n  {{- toYaml .Values.loki.memberlistConfig | nindent 2 }}\n{{- else }}\n{{- if .Values.loki.extraMemberlistConfig}}\n{{- toYaml .Values.loki.extraMemberlistConfig | nindent 2}}\n{{- end }}\n  join_members:\n    - {{ include \"loki.memberlist\" . }}\n    {{- with .Values.migrate.fromDistributed }}\n    {{- if .enabled }}\n    - {{ .memberlistService }}\n    {{- end }}\n    {{- end }}\n{{- end }}\n\n{{- with .Values.loki.ingester }}\ningester:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- if .Values.loki.commonConfig}}\ncommon:\n{{- toYaml .Values.loki.commonConfig | nindent 2}}\n  storage:\n  {{- include \"loki.commonStorageConfig\" . | nindent 4}}\n{{- end}}\n\n{{- with .Values.loki.limits_config }}\nlimits_config:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\nruntime_config:\n  file: /etc/loki/runtime-config/runtime-config.yaml\n\n{{- with .Values.chunksCache }}\n{{- if .enabled }}\nchunk_store_config:\n  chunk_cache_config:\n    default_validity: {{ .defaultValidity }}\n    background:\n      writeback_goroutines: {{ .writebackParallelism }}\n      writeback_buffer: {{ .writebackBuffer }}\n      writeback_size_limit: {{ .writebackSizeLimit }}\n    memcached:\n      batch_size: {{ .batchSize }}\n      parallelism: {{ .parallelism }}\n    memcached_client:\n      addresses: dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-chunks-cache.{{ $.Release.Namespace }}.svc\n      consistent_hash: true\n      timeout: {{ .timeout }}\n      max_idle_conns: 72\n{{- end }}\n{{- end }}\n\n{{- if .Values.loki.schemaConfig }}\nschema_config:\n{{- toYaml .Values.loki.schemaConfig | nindent 2}}\n{{- end }}\n\n{{- if .Values.loki.useTestSchema }}\nschema_config:\n{{- toYaml .Values.loki.testSchemaConfig | nindent 2}}\n{{- end }}\n\n{{ include \"loki.rulerConfig\" . }}\n\n{{- if or .Values.tableManager.retention_deletes_enabled .Values.tableManager.retention_period }}\ntable_manager:\n  retention_deletes_enabled: {{ .Values.tableManager.retention_deletes_enabled }}\n  retention_period: {{ .Values.tableManager.retention_period }}\n{{- end }}\n\nquery_range:\n  align_queries_with_step: true\n  {{- with .Values.loki.query_range }}\n  {{- tpl (. | toYaml) $ | nindent 2 }}\n  {{- end }}\n  {{- if .Values.resultsCache.enabled }}\n  {{- with .Values.resultsCache }}\n  cache_results: true\n  results_cache:\n    cache:\n      default_validity: {{ .defaultValidity }}\n      background:\n        writeback_goroutines: {{ .writebackParallelism }}\n        writeback_buffer: {{ .writebackBuffer }}\n        writeback_size_limit: {{ .writebackSizeLimit }}\n      memcached_client:\n        consistent_hash: true\n        addresses: dnssrvnoa+_memcached-client._tcp.{{ template \"loki.fullname\" $ }}-results-cache.{{ $.Release.Namespace }}.svc\n        timeout: {{ .timeout }}\n        update_interval: 1m\n  {{- end }}\n  {{- end }}\n\n{{- with .Values.loki.storage_config }}\nstorage_config:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.query_scheduler }}\nquery_scheduler:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.compactor }}\ncompactor:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.analytics }}\nanalytics:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.querier }}\nquerier:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.index_gateway }}\nindex_gateway:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.frontend }}\nfrontend:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.frontend_worker }}\nfrontend_worker:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.distributor }}\ndistributor:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\ntracing:\n  enabled: {{ .Values.loki.tracing.enabled }}\n\n{{- with .Values.loki.bloom_build }}\nbloom_build:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n\n{{- with .Values.loki.bloom_gateway }}\nbloom_gateway:\n  {{- tpl (. | toYaml) $ | nindent 4 }}\n{{- end }}\n": template: gotpl:40:6: executing "gotpl" at <include "loki.commonStorageConfig" .>: error calling include: template: loki/templates/_helpers.tpl:228:19: executing "loki.commonStorageConfig" at <$.Values.loki.storage.bucketNames.chunks>: nil pointer evaluating interface {}.chunks: exit status 1 at builder/v1alpha5/builder.go:354
could not run: could not render component: exit status 1 at builder/v1alpha5/builder.go:136

chart.cue

package holos

holos: HelmChart.BuildPlan

HelmChart: #Helm & {
  Name: "loki"
  Chart: {
    version: "6.19.0"
    repository: {
      name: "loki"
      url: "https://grafana.github.io/helm-charts"
    }
  }
}

generating a values.cue from vendored chart but the error appears on initial render

mcfearsome commented 2 hours ago

The section in question is not in the default values but even if I define a values.cue with them defined I get the same error:

package holos

Helm: Values: {
    deploymentMode: "SimpleScalable"
    enterprise: enabled: false
    loki: {
        enableServiceLinks: true
    auth_enabled: true
        limits_config: {
            reject_old_samples:            true
            reject_old_samples_max_age:    "168h"
            max_cache_freshness_per_query: "10m"
            split_queries_by_interval:     "15m"
            query_timeout:                 "300s"
            volume_enabled:                true
        }
        storage: {
            bucketNames: {
                chunks: "ts-loki-echo-chest"
                ruler: "ts-loki-titan-vault"
                admin: "ts-loki-comet-store"
            }
            type: "s3"
            s3: {
                region:           "us-west-2"
                s3ForcePathStyle: false
                insecure:         false
            }
        }
        schemaConfig: {
            configs: [{
                from: "2024-04-01"
                store: "tsdb"
                object_store: "s3"
                schema: "v13"
                index: {
                    prefix: "loki_index_"
                    period: "24h"
                }
            }]
        }
        ingester: chunk_encoding: "snappy"
        tracing: enabled: true
    }
    lokiCanary: nodeSelector: "karpenter.sh/initialized": "true"
    serviceAccount: {
        create: false
        name: "loki"
    }
    rbac: namespaced: false
    gateway: {
        enabled: true
        autoscaling: enabled: true
        service: {
            type: "LoadBalancer"
            annotations: {
        "service.beta.kubernetes.io/aws-load-balancer-backend-protocol": "HTTP"
        "service.beta.kubernetes.io/aws-load-balancer-internal": "true"
        "service.beta.kubernetes.io/aws-load-balancer-type": "nlb"
        "service.beta.kubernetes.io/aws-load-balancer-proxy-protocol": "*"
            }
        }
        ingress: enabled: false
        basicAuth: enabled: false
    }
    ingress: enabled: false
    write: {
        replicas: 3
        persistence: size: "100Gi"
    }
    read: {
        replicas: 3
        persistence: size: "100Gi"
    }
    backend: {
        replicas: 3
        persistence: size: "100Gi"
    }
    ingester: replicas: 0
    distributor: replicas: 0
    querier: replicas: 0
    queryFrontend: replicas: 0
    queryScheduler: replicas: 0
    indexGateway: replicas: 0
    compactor: replicas: 0
    bloomGateway: replicas: 0
    bloomPlanner: replicas: 0
    bloomBuilder: replicas: 0
    patternIngester: replicas: 0
    minio: enabled: false
}
mcfearsome commented 2 hours ago

typo in my values.cue