| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588 | ---# Source: loki-stack/charts/loki/templates/serviceaccount.yamlapiVersion: v1kind: ServiceAccountmetadata:  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helm  annotations:    {}  name: loki  namespace: defaultautomountServiceAccountToken: true---# Source: loki-stack/charts/promtail/templates/serviceaccount.yamlapiVersion: v1kind: ServiceAccountmetadata:  name: loki-promtail  namespace: default  labels:    helm.sh/chart: promtail-6.7.4    app.kubernetes.io/name: promtail    app.kubernetes.io/instance: loki    app.kubernetes.io/version: "2.7.0"    app.kubernetes.io/managed-by: Helm---# Source: loki-stack/charts/loki/templates/secret.yamlapiVersion: v1kind: Secretmetadata:  name: loki  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helmdata:  loki.yaml: YXV0aF9lbmFibGVkOiBmYWxzZQpjaHVua19zdG9yZV9jb25maWc6CiAgbWF4X2xvb2tfYmFja19wZXJpb2Q6IDBz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vY2F0aW9uOiAvZGF0YS9sb2tpL2JvbHRkYi1zaGlwcGVyLWNhY2hlCiAgICBjYWNoZV90dGw6IDI0aAogICAgc2hhcmVkX3N0b3JlOiBmaWxlc3lzdGVtCiAgZmlsZXN5c3RlbToKICAgIGRpcmVjdG9yeTogL2RhdGEvbG9raS9jaHVua3MKdGFibGVfbWFuYWdlcjoKICByZXRlbnRpb25fZGVsZXRlc19lbmFibGVkOiBmYWxzZQogIHJldGVudGlvbl9wZXJpb2Q6IDBz---# Source: loki-stack/charts/promtail/templates/secret.yamlapiVersion: v1kind: Secretmetadata:  name: loki-promtail  namespace: default  labels:    helm.sh/chart: promtail-6.7.4    app.kubernetes.io/name: promtail    app.kubernetes.io/instance: loki    app.kubernetes.io/version: "2.7.0"    app.kubernetes.io/managed-by: HelmstringData:  promtail.yaml: |    server:      log_level: info      http_listen_port: 3101              clients:      - url: http://loki:3100/loki/api/v1/push        positions:      filename: /run/promtail/positions.yaml        scrape_configs:      # See also https://github.com/grafana/loki/blob/master/production/ksonnet/promtail/scrape_config.libsonnet for reference      - job_name: kubernetes-pods        pipeline_stages:          - cri: {}        kubernetes_sd_configs:          - role: pod        relabel_configs:          - source_labels:              - __meta_kubernetes_pod_controller_name            regex: ([0-9a-z-.]+?)(-[0-9a-f]{8,10})?            action: replace            target_label: __tmp_controller_name          - source_labels:              - __meta_kubernetes_pod_label_app_kubernetes_io_name              - __meta_kubernetes_pod_label_app              - __tmp_controller_name              - __meta_kubernetes_pod_name            regex: ^;*([^;]+)(;.*)?$            action: replace            target_label: app          - source_labels:              - __meta_kubernetes_pod_label_app_kubernetes_io_instance              - __meta_kubernetes_pod_label_release            regex: ^;*([^;]+)(;.*)?$            action: replace            target_label: instance          - source_labels:              - __meta_kubernetes_pod_label_app_kubernetes_io_component              - __meta_kubernetes_pod_label_component            regex: ^;*([^;]+)(;.*)?$            action: replace            target_label: component          - action: replace            source_labels:            - __meta_kubernetes_pod_node_name            target_label: node_name          - action: replace            source_labels:            - __meta_kubernetes_namespace            target_label: namespace          - action: replace            replacement: $1            separator: /            source_labels:            - namespace            - app            target_label: job          - action: replace            source_labels:            - __meta_kubernetes_pod_name            target_label: pod          - action: replace            source_labels:            - __meta_kubernetes_pod_container_name            target_label: container          - action: replace            replacement: /var/log/pods/*$1/*.log            separator: /            source_labels:            - __meta_kubernetes_pod_uid            - __meta_kubernetes_pod_container_name            target_label: __path__          - action: replace            regex: true/(.*)            replacement: /var/log/pods/*$1/*.log            separator: /            source_labels:            - __meta_kubernetes_pod_annotationpresent_kubernetes_io_config_hash            - __meta_kubernetes_pod_annotation_kubernetes_io_config_hash            - __meta_kubernetes_pod_container_name            target_label: __path__                    limits_config:---# Source: loki-stack/templates/datasources.yamlapiVersion: v1kind: ConfigMapmetadata:  name: loki-loki-stack  namespace: default  labels:    app: loki-stack    chart: loki-stack-2.8.9    release: loki    heritage: Helm    grafana_datasource: "1"data:  loki-stack-datasource.yaml: |-    apiVersion: 1    datasources:    - name: Loki      type: loki      access: proxy      url: "http://loki:3100"      version: 1      isDefault: true      jsonData:        {}---# Source: loki-stack/templates/tests/loki-test-configmap.yamlapiVersion: v1kind: ConfigMapmetadata:  name: loki-loki-stack-test  labels:    app: loki-stack    chart: loki-stack-2.8.9    release: loki    heritage: Helmdata:  test.sh: |    #!/usr/bin/env bash    LOKI_URI="http://${LOKI_SERVICE}:${LOKI_PORT}"    function setup() {      apk add -u curl jq      until (curl -s ${LOKI_URI}/loki/api/v1/label/app/values | jq -e '.data[] | select(. == "loki")'); do        sleep 1      done    }    @test "Has labels" {      curl -s ${LOKI_URI}/loki/api/v1/labels | \      jq -e '.data[] | select(. == "app")'    }    @test "Query log entry" {      curl -sG ${LOKI_URI}/api/prom/query?limit=10 --data-urlencode 'query={app="loki"}' | \      jq -e '.streams[].entries | length >=1'    }    @test "Push log entry" {      local timestamp=$(date +%s000000000)      local data=$(jq -n --arg timestamp "${timestamp}" '{"streams": [{"stream": {"app": "loki-test"}, "values": [[$timestamp, "foobar"]]}]}')      curl -s -X POST -H "Content-Type: application/json" ${LOKI_URI}/loki/api/v1/push --data-raw "${data}"      curl -sG ${LOKI_URI}/loki/api/v1/query_range?limit=1 --data-urlencode 'query={app="loki-test"}' | \      jq -e '.data.result[].values[][1] == "foobar"'    }---# Source: loki-stack/charts/promtail/templates/clusterrole.yamlkind: ClusterRoleapiVersion: rbac.authorization.k8s.io/v1metadata:  name: loki-promtail  labels:    helm.sh/chart: promtail-6.7.4    app.kubernetes.io/name: promtail    app.kubernetes.io/instance: loki    app.kubernetes.io/version: "2.7.0"    app.kubernetes.io/managed-by: Helmrules:  - apiGroups:      - ""    resources:      - nodes      - nodes/proxy      - services      - endpoints      - pods    verbs:      - get      - watch      - list---# Source: loki-stack/charts/promtail/templates/clusterrolebinding.yamlkind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1metadata:  name: loki-promtail  labels:    helm.sh/chart: promtail-6.7.4    app.kubernetes.io/name: promtail    app.kubernetes.io/instance: loki    app.kubernetes.io/version: "2.7.0"    app.kubernetes.io/managed-by: Helmsubjects:  - kind: ServiceAccount    name: loki-promtail    namespace: defaultroleRef:  kind: ClusterRole  name: loki-promtail  apiGroup: rbac.authorization.k8s.io---# Source: loki-stack/charts/loki/templates/role.yamlapiVersion: rbac.authorization.k8s.io/v1kind: Rolemetadata:  name: loki  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helmrules:- apiGroups:      ['extensions']  resources:      ['podsecuritypolicies']  verbs:          ['use']  resourceNames:  [loki]---# Source: loki-stack/charts/loki/templates/rolebinding.yamlapiVersion: rbac.authorization.k8s.io/v1kind: RoleBindingmetadata:  name: loki  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: HelmroleRef:  apiGroup: rbac.authorization.k8s.io  kind: Role  name: lokisubjects:- kind: ServiceAccount  name: loki---# Source: loki-stack/charts/loki/templates/service-headless.yamlapiVersion: v1kind: Servicemetadata:  name: loki-headless  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helm    variant: headlessspec:  clusterIP: None  ports:    - port: 3100      protocol: TCP      name: http-metrics      targetPort: http-metrics  selector:    app: loki    release: loki---# Source: loki-stack/charts/loki/templates/service-memberlist.yamlapiVersion: v1kind: Servicemetadata:  name: loki-memberlist  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helmspec:  type: ClusterIP  clusterIP: None  publishNotReadyAddresses: true  ports:    - name: http      port: 7946      targetPort: memberlist-port      protocol: TCP  selector:    app: loki    release: loki---# Source: loki-stack/charts/loki/templates/service.yamlapiVersion: v1kind: Servicemetadata:  name: loki  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helm  annotations:    {}spec:  type: ClusterIP  ports:    - port: 3100      protocol: TCP      name: http-metrics      targetPort: http-metrics  selector:    app: loki    release: loki---# Source: loki-stack/charts/promtail/templates/daemonset.yamlapiVersion: apps/v1kind: DaemonSetmetadata:  name: loki-promtail  namespace: default  labels:    helm.sh/chart: promtail-6.7.4    app.kubernetes.io/name: promtail    app.kubernetes.io/instance: loki    app.kubernetes.io/version: "2.7.0"    app.kubernetes.io/managed-by: Helmspec:  selector:    matchLabels:      app.kubernetes.io/name: promtail      app.kubernetes.io/instance: loki  updateStrategy:    {}  template:    metadata:      labels:        app.kubernetes.io/name: promtail        app.kubernetes.io/instance: loki      annotations:        checksum/config: d566bf766424f0ee767a237d2b599c0f88b3129f45721acdb2f519024885cd31    spec:      serviceAccountName: loki-promtail      enableServiceLinks: true      securityContext:        runAsGroup: 0        runAsUser: 0      containers:        - name: promtail          image: "docker.io/grafana/promtail:2.7.0"          imagePullPolicy: IfNotPresent          args:            - "-config.file=/etc/promtail/promtail.yaml"          volumeMounts:            - name: config              mountPath: /etc/promtail            - mountPath: /run/promtail              name: run            - mountPath: /var/lib/docker/containers              name: containers              readOnly: true            - mountPath: /var/log/pods              name: pods              readOnly: true          env:            - name: HOSTNAME              valueFrom:                fieldRef:                  fieldPath: spec.nodeName          ports:            - name: http-metrics              containerPort: 3101              protocol: TCP          securityContext:            allowPrivilegeEscalation: false            capabilities:              drop:              - ALL            readOnlyRootFilesystem: true          readinessProbe:            failureThreshold: 5            httpGet:              path: '/ready'              port: http-metrics            initialDelaySeconds: 10            periodSeconds: 10            successThreshold: 1            timeoutSeconds: 1      tolerations:        - effect: NoSchedule          key: node-role.kubernetes.io/master          operator: Exists        - effect: NoSchedule          key: node-role.kubernetes.io/control-plane          operator: Exists      volumes:        - name: config          secret:            secretName: loki-promtail        - hostPath:            path: /run/promtail          name: run        - hostPath:            path: /var/lib/docker/containers          name: containers        - hostPath:            path: /var/log/pods          name: pods---# Source: loki-stack/charts/loki/templates/statefulset.yamlapiVersion: apps/v1kind: StatefulSetmetadata:  name: loki  namespace: default  labels:    app: loki    chart: loki-2.16.0    release: loki    heritage: Helm  annotations:    {}spec:  podManagementPolicy: OrderedReady  replicas: 1  selector:    matchLabels:      app: loki      release: loki  serviceName: loki-headless  updateStrategy:    type: RollingUpdate  template:    metadata:      labels:        app: loki        name: loki        release: loki      annotations:        checksum/config: 70f817aa5a2dd5f771aca66233ce0b140c925212f36795fdeb95102ca96db046        prometheus.io/port: http-metrics        prometheus.io/scrape: "true"    spec:      serviceAccountName: loki      securityContext:        fsGroup: 10001        runAsGroup: 10001        runAsNonRoot: true        runAsUser: 10001      initContainers:        []      containers:        - name: loki          image: "grafana/loki:2.6.1"          imagePullPolicy: IfNotPresent          args:            - "-config.file=/etc/loki/loki.yaml"          volumeMounts:            - name: tmp              mountPath: /tmp            - name: config              mountPath: /etc/loki            - name: storage              mountPath: "/data"              subPath:           ports:            - name: http-metrics              containerPort: 3100              protocol: TCP            - name: grpc              containerPort: 9095              protocol: TCP            - name: memberlist-port              containerPort: 7946              protocol: TCP          livenessProbe:            httpGet:              path: /ready              port: http-metrics            initialDelaySeconds: 45          readinessProbe:            httpGet:              path: /ready              port: http-metrics            initialDelaySeconds: 45          resources:            {}          securityContext:            readOnlyRootFilesystem: true          env:      nodeSelector:        {}      affinity:        {}      tolerations:        []      terminationGracePeriodSeconds: 4800      volumes:        - name: tmp          emptyDir: {}        - name: config          secret:            secretName: loki        - name: storage          emptyDir: {}---# Source: loki-stack/templates/tests/loki-test-pod.yamlapiVersion: v1kind: Podmetadata:  annotations:    "helm.sh/hook": test-success  labels:    app: loki-stack    chart: loki-stack-2.8.9    release: loki    heritage: Helm  name: loki-loki-stack-testspec:  containers:  - name: test    image: "bats/bats:v1.1.0"    imagePullPolicy: ""    args:    - /var/lib/loki/test.sh    env:    - name: LOKI_SERVICE      value: loki    - name: LOKI_PORT      value: "3100"    volumeMounts:    - name: tests      mountPath: /var/lib/loki  restartPolicy: Never  volumes:  - name: tests    configMap:      name: loki-loki-stack-test
 |