├── demo ├── docker-compose-with-tempo │ ├── tempo │ │ ├── tempo-query.yaml │ │ └── tempo.yaml │ ├── redis.conf │ ├── jaeger-config.json │ ├── promtail-config.yaml │ ├── nginx.conf │ ├── local-config.yaml │ └── docker-compose.yaml ├── helm │ └── loki-cluster-demo │ │ ├── .gitignore │ │ ├── charts │ │ ├── loki-consul │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── pvc.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-minio │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── pvc.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-redis │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-ingester │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-querier │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-ruler │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ └── values.yaml │ │ ├── loki-cassandra │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── pvc.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-gateway │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── deploy.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── table-manager │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── loki-distributor │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ │ ├── service.yaml │ │ │ │ ├── _helpers.tpl │ │ │ │ └── sts.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ └── loki-querier-frontend │ │ │ ├── Chart.yaml │ │ │ ├── templates │ │ │ ├── service.yaml │ │ │ ├── _helpers.tpl │ │ │ └── deploy.yaml │ │ │ ├── values.yaml │ │ │ └── README.md │ │ ├── Chart.yaml │ │ ├── configmap │ │ ├── redis.conf │ │ └── rules.yaml │ │ ├── templates │ │ ├── configmap.yaml │ │ ├── _helpers.tpl │ │ ├── nginx.conf │ │ └── local-config.yaml │ │ ├── .helmignore │ │ ├── values.yaml │ │ └── README.md └── docker-compose │ ├── redis.conf │ ├── rules │ └── fake │ │ └── rules.yaml │ ├── nginx.conf │ ├── docker-compose.yaml │ └── local-config.yaml └── production └── loki-system ├── loki-redis ├── pvc.yaml ├── configmap.yaml ├── servicemonitor.yaml ├── service.yaml └── statefulset.yaml ├── loki-gateway ├── service.yaml ├── deploy.yaml └── configmap.yaml ├── loki-frontend ├── service.yaml ├── servicemonitor.yaml └── statefulset.yaml ├── loki-system ├── servicemonitor.yaml ├── service.yaml ├── statefulset.yaml └── configmap.yaml └── installation.sh /demo/docker-compose-with-tempo/tempo/tempo-query.yaml: -------------------------------------------------------------------------------- 1 | backend: "tempo:3100" -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | tools/ 3 | values/ 4 | /Pipeline.json 5 | /pipeline.yaml 6 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: consul 2 | name: loki-consul 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: minio 2 | name: loki-minio 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: redis 2 | name: loki-redis 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loku ingester 2 | name: loki-ingester 3 | version: 0.0.1 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loku querier 2 | name: loki-querier 3 | version: 0.0.1 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ruler/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loku ruler 2 | name: loki-ruler 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: cassandra 2 | name: loki-cassandra 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loki gateway 2 | name: loki-gateway 3 | version: 0.0.1 4 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loki table-manager 2 | name: table-manager 3 | version: 0.0.1 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loku distributor 2 | name: loki-distributor 3 | version: 0.0.1 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: loku querier-frontend 2 | name: loki-querier-frontend 3 | version: 0.0.1 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/Chart.yaml: -------------------------------------------------------------------------------- 1 | description: Deploy Loki Cluster, only for demo 2 | name: loki-cluster-demo 3 | version: 0.0.1 4 | app_version: 1.6.0 5 | -------------------------------------------------------------------------------- /demo/docker-compose/redis.conf: -------------------------------------------------------------------------------- 1 | bind 0.0.0.0 2 | port 6379 3 | tcp-backlog 511 4 | tcp-keepalive 300 5 | loglevel notice 6 | databases 2 7 | save "" 8 | appendonly no 9 | maxmemory 8589934592 10 | -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/redis.conf: -------------------------------------------------------------------------------- 1 | bind 0.0.0.0 2 | port 6379 3 | tcp-backlog 511 4 | tcp-keepalive 300 5 | loglevel notice 6 | databases 2 7 | save "" 8 | appendonly no 9 | maxmemory 8589934592 10 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/configmap/redis.conf: -------------------------------------------------------------------------------- 1 | bind 0.0.0.0 2 | port 6379 3 | tcp-backlog 511 4 | tcp-keepalive 300 5 | loglevel notice 6 | databases 2 7 | save "" 8 | appendonly no 9 | maxmemory 8589934592 10 | -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/jaeger-config.json: -------------------------------------------------------------------------------- 1 | { 2 | "service_name": "loki-gateway", 3 | "diabled": false, 4 | "reporter": { 5 | "logSpans": true, 6 | "localAgentHostPort": "jaeger-agent:6831" 7 | }, 8 | "sampler": { 9 | "type": "const", 10 | "param": "100" 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /production/loki-system/loki-redis/pvc.yaml: -------------------------------------------------------------------------------- 1 | kind: PersistentVolumeClaim 2 | apiVersion: v1 3 | metadata: 4 | name: loki-redis-data 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-redis 8 | spec: 9 | accessModes: 10 | - "ReadWriteOnce" 11 | resources: 12 | requests: 13 | storage: 20Gi -------------------------------------------------------------------------------- /production/loki-system/loki-gateway/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: loki-gateway 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-gateway 8 | spec: 9 | type: NodePort 10 | ports: 11 | - name: http-3100 12 | port: 3100 13 | protocol: TCP 14 | targetPort: 3100 15 | selector: 16 | app.kubernetes.io/name: loki-gateway -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/promtail-config.yaml: -------------------------------------------------------------------------------- 1 | server: 2 | http_listen_port: 9080 3 | grpc_listen_port: 0 4 | 5 | positions: 6 | filename: /tmp/positions.yaml 7 | 8 | clients: 9 | - url: http://gateway:3100/loki/api/v1/push 10 | 11 | scrape_configs: 12 | - job_name: trace 13 | static_configs: 14 | - targets: 15 | - localhost 16 | labels: 17 | job: logs 18 | __path__: /trace/trace.log 19 | -------------------------------------------------------------------------------- /production/loki-system/loki-frontend/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: loki-frontend 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-frontend 8 | spec: 9 | type: ClusterIP 10 | ports: 11 | - name: http-3100 12 | port: 3100 13 | protocol: TCP 14 | targetPort: 3100 15 | - name: grpc-9095 16 | port: 9095 17 | protocol: TCP 18 | targetPort: 9095 19 | selector: 20 | app.kubernetes.io/name: loki-frontend -------------------------------------------------------------------------------- /production/loki-system/loki-redis/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | namespace: loki 5 | labels: 6 | app.kubernetes.io/name: loki-redis 7 | name: loki-redis 8 | data: 9 | redis.conf: |- 10 | bind 0.0.0.0 11 | port 6379 12 | tcp-backlog 511 13 | tcp-keepalive 300 14 | loglevel notice 15 | databases 2 16 | save 900 1 17 | save 300 10 18 | save 60 10000 19 | dir /var/lib/redis 20 | appendonly no 21 | maxmemory 8589934592 -------------------------------------------------------------------------------- /production/loki-system/loki-redis/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: ServiceMonitor 3 | metadata: 4 | name: loki-redis-metrics 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-redis 8 | spec: 9 | jobLabel: jobLabel 10 | selector: 11 | matchLabels: 12 | app.kubernetes.io/name: loki-redis 13 | endpoints: 14 | - port: metrics 15 | path: /metrics 16 | relabelings: 17 | - sourceLabels: [__meta_kubernetes_pod_node_name] 18 | targetLabel: host -------------------------------------------------------------------------------- /production/loki-system/loki-frontend/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: ServiceMonitor 3 | metadata: 4 | name: loki-frontend-metrics 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-frontend 8 | spec: 9 | jobLabel: jobLabel 10 | selector: 11 | matchLabels: 12 | app.kubernetes.io/name: loki-frontend 13 | endpoints: 14 | - port: http-3100 15 | path: /metrics 16 | relabelings: 17 | - sourceLabels: [__meta_kubernetes_pod_node_name] 18 | targetLabel: host -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/templates/configmap.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | {{- range $cm := .Values.global.configmaps -}} 3 | {{- $configmap_glob := printf "configmap/%s*" $cm -}} 4 | --- 5 | apiVersion: v1 6 | kind: ConfigMap 7 | metadata: 8 | namespace: {{ $root.Release.Namespace }} 9 | labels: 10 | {{ include "simple.labels" $root | indent 4 }} 11 | name: {{ $cm }} 12 | data: 13 | {{- range $path, $bytes := $root.Files.Glob $configmap_glob }} 14 | {{ base $path }}: |- 15 | {{- $root.Files.Get $path | nindent 4 }} 16 | {{- end }} 17 | {{ end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ruler/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/.helmignore: -------------------------------------------------------------------------------- 1 | # Patterns to ignore when building packages. 2 | # This supports shell glob matching, relative path matching, and 3 | # negation (prefixed with !). Only one pattern per line. 4 | .DS_Store 5 | # Common VCS dirs 6 | .git/ 7 | .gitignore 8 | .bzr/ 9 | .bzrignore 10 | .hg/ 11 | .hgignore 12 | .svn/ 13 | # Common backup files 14 | *.swp 15 | *.bak 16 | *.tmp 17 | *~ 18 | # Various IDEs 19 | .project 20 | .idea/ 21 | *.tmproj 22 | .vscode/ 23 | # custom 24 | /*.tgz 25 | Makefile 26 | Pipeline.json 27 | pipeline.yaml 28 | values/ 29 | tools/ 30 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/templates/service.yaml: -------------------------------------------------------------------------------- 1 | {{- if and .Values.global .Values.global.ignoreService -}} 2 | {{- else }} 3 | apiVersion: v1 4 | kind: Service 5 | metadata: 6 | name: {{ include "app.svcname" . }} 7 | namespace: {{ .Release.Namespace }} 8 | labels: 9 | {{ include "app.labels" . | indent 4 }} 10 | spec: 11 | type: {{ .Values.service.type }} 12 | ports: 13 | {{- toYaml .Values.service.ports | nindent 4 }} 14 | selector: 15 | app: {{ include "app.name" . }} 16 | app.instance: {{ .Release.Name }} 17 | {{- end }} 18 | -------------------------------------------------------------------------------- /production/loki-system/loki-system/servicemonitor.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: monitoring.coreos.com/v1 2 | kind: ServiceMonitor 3 | metadata: 4 | name: loki-metrics 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-system 8 | spec: 9 | jobLabel: jobLabel 10 | selector: 11 | matchLabels: 12 | app.kubernetes.io/name: loki-system 13 | endpoints: 14 | - port: http-3100 15 | path: /metrics 16 | relabelings: 17 | - sourceLabels: [__meta_kubernetes_pod_node_name] 18 | targetLabel: host 19 | - sourceLabels: [__meta_kubernetes_service_name] 20 | regex: (.*headless) 21 | action: drop 22 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | {{- range .Values.persistence }} 3 | --- 4 | kind: PersistentVolumeClaim 5 | apiVersion: v1 6 | metadata: 7 | name: {{ include "app.fullname" $root }}-{{ .name }} 8 | namespace: {{ $root.Release.Namespace }} 9 | labels: 10 | {{ include "simple.labels" $root | indent 4 }} 11 | spec: 12 | accessModes: 13 | - {{ .accessMode | quote }} 14 | resources: 15 | requests: 16 | storage: {{ .size }} 17 | {{- if .storageClass }} 18 | {{- if (eq "-" .storageClass) }} 19 | storageClassName: "" 20 | {{- else }} 21 | storageClassName: "{{ .storageClass }}" 22 | {{- end }} 23 | {{- end }} 24 | {{- end}} 25 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | {{- range .Values.persistence }} 3 | --- 4 | kind: PersistentVolumeClaim 5 | apiVersion: v1 6 | metadata: 7 | name: {{ include "app.fullname" $root }}-{{ .name }} 8 | namespace: {{ $root.Release.Namespace }} 9 | labels: 10 | {{ include "simple.labels" $root | indent 4 }} 11 | spec: 12 | accessModes: 13 | - {{ .accessMode | quote }} 14 | resources: 15 | requests: 16 | storage: {{ .size }} 17 | {{- if .storageClass }} 18 | {{- if (eq "-" .storageClass) }} 19 | storageClassName: "" 20 | {{- else }} 21 | storageClassName: "{{ .storageClass }}" 22 | {{- end }} 23 | {{- end }} 24 | {{- end}} 25 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/templates/pvc.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | {{- range .Values.persistence }} 3 | --- 4 | kind: PersistentVolumeClaim 5 | apiVersion: v1 6 | metadata: 7 | name: {{ include "app.fullname" $root }}-{{ .name }} 8 | namespace: {{ $root.Release.Namespace }} 9 | labels: 10 | {{ include "simple.labels" $root | indent 4 }} 11 | spec: 12 | accessModes: 13 | - {{ .accessMode | quote }} 14 | resources: 15 | requests: 16 | storage: {{ .size }} 17 | {{- if .storageClass }} 18 | {{- if (eq "-" .storageClass) }} 19 | storageClassName: "" 20 | {{- else }} 21 | storageClassName: "{{ .storageClass }}" 22 | {{- end }} 23 | {{- end }} 24 | {{- end}} 25 | -------------------------------------------------------------------------------- /production/loki-system/loki-redis/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: loki-redis 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-redis 8 | spec: 9 | type: ClusterIP 10 | ports: 11 | - name: tcp-6379 12 | port: 6379 13 | protocol: TCP 14 | targetPort: 6379 15 | selector: 16 | app.kubernetes.io/name: loki-redis 17 | 18 | --- 19 | apiVersion: v1 20 | kind: Service 21 | metadata: 22 | name: loki-redis-metrics 23 | namespace: loki 24 | labels: 25 | app.kubernetes.io/name: loki-redis 26 | spec: 27 | type: ClusterIP 28 | clusterIP: None 29 | ports: 30 | - name: metrics 31 | port: 9121 32 | protocol: TCP 33 | targetPort: 9121 34 | selector: 35 | app.kubernetes.io/name: loki-redis -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: redis:5.0.6-alpine 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-6379 15 | port: 6379 16 | protocol: TCP 17 | targetPort: 6379 18 | 19 | resources: 20 | requests: 21 | cpu: 200m 22 | memory: 2Gi 23 | limits: 24 | cpu: "1" 25 | memory: 4Gi 26 | 27 | livenessProbe: 28 | failureThreshold: 3 29 | initialDelaySeconds: 120 30 | periodSeconds: 30 31 | successThreshold: 1 32 | timeoutSeconds: 5 33 | tcpSocket: 34 | port: 6379 35 | 36 | nodeSelector: {} 37 | tolerations: [] 38 | affinity: {} 39 | 40 | volumeMounts: [] 41 | 42 | volumes: [] 43 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 2 2 | 3 | image: 4 | repository: nginx:1.15.1-alpine 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: NodePort 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | 19 | resources: 20 | requests: 21 | cpu: 200m 22 | memory: 256Mi 23 | limits: 24 | cpu: "1" 25 | memory: 2Gi 26 | 27 | livenessProbe: 28 | failureThreshold: 3 29 | initialDelaySeconds: 120 30 | periodSeconds: 30 31 | successThreshold: 1 32 | timeoutSeconds: 5 33 | tcpSocket: 34 | port: 3100 35 | 36 | nodeSelector: {} 37 | tolerations: [] 38 | affinity: {} 39 | 40 | volumeMounts: [] 41 | 42 | volumes: [] 43 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: minio/minio:RELEASE.2020-09-21T22-31-59Z 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: NodePort 13 | ports: 14 | - name: http-9000 15 | port: 9000 16 | protocol: TCP 17 | targetPort: 9000 18 | 19 | resources: 20 | requests: 21 | cpu: 100m 22 | memory: 256Mi 23 | limits: 24 | cpu: "1" 25 | memory: 2Gi 26 | 27 | livenessProbe: 28 | failureThreshold: 3 29 | initialDelaySeconds: 120 30 | periodSeconds: 30 31 | successThreshold: 1 32 | timeoutSeconds: 5 33 | tcpSocket: 34 | port: 9000 35 | 36 | nodeSelector: {} 37 | tolerations: [] 38 | affinity: {} 39 | 40 | volumeMounts: [] 41 | 42 | volumes: [] 43 | -------------------------------------------------------------------------------- /demo/docker-compose/rules/fake/rules.yaml: -------------------------------------------------------------------------------- 1 | #groups: 2 | # - name: should_fire 3 | # rules: 4 | # - alert: HighPercentageError 5 | # expr: | 6 | # sum(rate({app="foo", env="production"} |= "error" [5m])) by (job) 7 | # / 8 | # sum(rate({app="foo", env="production"}[5m])) by (job) 9 | # > 0.05 10 | # for: 10m 11 | # labels: 12 | # severity: page 13 | # annotations: 14 | # summary: High request latency 15 | # - name: credentials_leak 16 | # rules: 17 | # - alert: http-credentials-leaked 18 | # annotations: 19 | # message: "{{ $labels.job }} is leaking http basic auth credentials." 20 | # expr: 'sum by (cluster, job, pod) (count_over_time({namespace="prod"} |~ "http(s?)://(\\w+):(\\w+)@" [5m]) > 0)' 21 | # for: 10m 22 | # labels: 23 | # severity: critical 24 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/configmap/rules.yaml: -------------------------------------------------------------------------------- 1 | #groups: 2 | # - name: should_fire 3 | # rules: 4 | # - alert: HighPercentageError 5 | # expr: | 6 | # sum(rate({app="foo", env="production"} |= "error" [5m])) by (job) 7 | # / 8 | # sum(rate({app="foo", env="production"}[5m])) by (job) 9 | # > 0.05 10 | # for: 10m 11 | # labels: 12 | # severity: page 13 | # annotations: 14 | # summary: High request latency 15 | # - name: credentials_leak 16 | # rules: 17 | # - alert: http-credentials-leaked 18 | # annotations: 19 | # message: "{{ $labels.job }} is leaking http basic auth credentials." 20 | # expr: 'sum by (cluster, job, pod) (count_over_time({namespace="prod"} |~ "http(s?)://(\\w+):(\\w+)@" [5m]) > 0)' 21 | # for: 10m 22 | # labels: 23 | # severity: critical 24 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 3 2 | 3 | image: 4 | repository: grafana/loki:1.6.0 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | - name: grpc-9095 19 | port: 9095 20 | protocol: TCP 21 | targetPort: 9095 22 | 23 | resources: 24 | requests: 25 | cpu: 200m 26 | memory: 256Mi 27 | limits: 28 | cpu: "1" 29 | memory: 1Gi 30 | 31 | livenessProbe: 32 | failureThreshold: 3 33 | initialDelaySeconds: 120 34 | periodSeconds: 30 35 | successThreshold: 1 36 | timeoutSeconds: 5 37 | tcpSocket: 38 | port: 3100 39 | 40 | nodeSelector: {} 41 | tolerations: [] 42 | affinity: {} 43 | 44 | volumeMounts: [] 45 | 46 | volumes: [] 47 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 3 2 | 3 | image: 4 | repository: grafana/loki:1.6.0 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | - name: grpc-9095 19 | port: 9095 20 | protocol: TCP 21 | targetPort: 9095 22 | 23 | resources: 24 | requests: 25 | cpu: 200m 26 | memory: 256Mi 27 | limits: 28 | cpu: "1" 29 | memory: 1Gi 30 | 31 | livenessProbe: 32 | failureThreshold: 3 33 | initialDelaySeconds: 120 34 | periodSeconds: 30 35 | successThreshold: 1 36 | timeoutSeconds: 5 37 | tcpSocket: 38 | port: 3100 39 | 40 | nodeSelector: {} 41 | tolerations: [] 42 | affinity: {} 43 | 44 | volumeMounts: [] 45 | 46 | volumes: [] 47 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ruler/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: grafana/loki:latest 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | - name: grpc-9095 19 | port: 9095 20 | protocol: TCP 21 | targetPort: 9095 22 | 23 | resources: 24 | requests: 25 | cpu: 200m 26 | memory: 256Mi 27 | limits: 28 | cpu: "1" 29 | memory: 1Gi 30 | 31 | livenessProbe: 32 | failureThreshold: 3 33 | initialDelaySeconds: 120 34 | periodSeconds: 30 35 | successThreshold: 1 36 | timeoutSeconds: 5 37 | tcpSocket: 38 | port: 3100 39 | 40 | nodeSelector: {} 41 | tolerations: [] 42 | affinity: {} 43 | 44 | volumeMounts: [] 45 | 46 | volumes: [] 47 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: bitnami/cassandra:3-debian-10 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-7000 15 | port: 7000 16 | protocol: TCP 17 | targetPort: 7000 18 | - name: http-9042 19 | port: 9042 20 | protocol: TCP 21 | targetPort: 9042 22 | 23 | resources: 24 | requests: 25 | cpu: 500m 26 | memory: 8Gi 27 | limits: 28 | cpu: "1" 29 | memory: 10Gi 30 | 31 | livenessProbe: 32 | failureThreshold: 130 33 | initialDelaySeconds: 300 34 | periodSeconds: 30 35 | successThreshold: 1 36 | timeoutSeconds: 10 37 | tcpSocket: 38 | port: 9042 39 | 40 | nodeSelector: {} 41 | tolerations: [] 42 | affinity: {} 43 | 44 | volumeMounts: [] 45 | 46 | volumes: [] -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: grafana/loki:1.6.0 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | - name: grpc-9095 19 | port: 9095 20 | protocol: TCP 21 | targetPort: 9095 22 | 23 | 24 | resources: 25 | requests: 26 | cpu: 200m 27 | memory: 256Mi 28 | limits: 29 | cpu: "1" 30 | memory: 1Gi 31 | 32 | livenessProbe: 33 | failureThreshold: 3 34 | initialDelaySeconds: 120 35 | periodSeconds: 30 36 | successThreshold: 1 37 | timeoutSeconds: 5 38 | tcpSocket: 39 | port: 3100 40 | 41 | nodeSelector: {} 42 | tolerations: [] 43 | affinity: {} 44 | 45 | volumeMounts: [] 46 | 47 | volumes: [] 48 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 2 2 | 3 | image: 4 | repository: grafana/loki:1.6.0 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | service: 12 | type: ClusterIP 13 | ports: 14 | - name: http-3100 15 | port: 3100 16 | protocol: TCP 17 | targetPort: 3100 18 | - name: grpc-9095 19 | port: 9095 20 | protocol: TCP 21 | targetPort: 9095 22 | 23 | resources: 24 | requests: 25 | cpu: 200m 26 | memory: 256Mi 27 | limits: 28 | cpu: "1" 29 | memory: 1Gi 30 | 31 | livenessProbe: 32 | failureThreshold: 3 33 | initialDelaySeconds: 120 34 | periodSeconds: 30 35 | successThreshold: 1 36 | timeoutSeconds: 5 37 | tcpSocket: 38 | port: 3100 39 | 40 | nodeSelector: {} 41 | tolerations: [] 42 | affinity: {} 43 | 44 | volumeMounts: [] 45 | 46 | volumes: [] 47 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 3 2 | loki-cassandra: 3 | svcNameOverride: 4 | 5 | image: 6 | repository: grafana/loki:1.6.0 7 | pullPolicy: IfNotPresent 8 | 9 | imagePullSecrets: [] 10 | nameOverride: "" 11 | svcNameOverride: "" 12 | 13 | service: 14 | type: ClusterIP 15 | ports: 16 | - name: http-3100 17 | port: 3100 18 | protocol: TCP 19 | targetPort: 3100 20 | - name: grpc-9095 21 | port: 9095 22 | protocol: TCP 23 | targetPort: 9095 24 | 25 | resources: 26 | requests: 27 | cpu: 200m 28 | memory: 256Mi 29 | limits: 30 | cpu: "1" 31 | memory: 1Gi 32 | 33 | livenessProbe: 34 | failureThreshold: 3 35 | initialDelaySeconds: 120 36 | periodSeconds: 30 37 | successThreshold: 1 38 | timeoutSeconds: 5 39 | tcpSocket: 40 | port: 3100 41 | 42 | nodeSelector: {} 43 | tolerations: [] 44 | affinity: {} 45 | 46 | volumeMounts: [] 47 | 48 | volumes: [] 49 | -------------------------------------------------------------------------------- /production/loki-system/installation.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #variable:_S3_HOST__ 4 | 5 | S3_HOST="1.1.1.1" 6 | S3_SECRET_KEY="xP1I3XBjqMnt62dZA9c2wXXCmLVPaMUOmMBt1M63" 7 | S3_ACCESS_KEY="5372OS9A1ZR5UD6WWE6O" 8 | 9 | 10 | function loki_install(){ 11 | 12 | kubectl create ns loki 13 | kubectl apply -n loki -f loki-redis/ 14 | sleep 30 15 | #sleep 120 16 | sed -i "s#__S3_SECRET_KEY__#${S3_SECRET_KEY}#g" loki-system/configmap.yaml 17 | sed -i "s#__S3_ACCESS_KEY__#${S3_ACCESS_KEY}#g" loki-system/configmap.yaml 18 | sed -i "s#__S3_HOST__#${S3_HOST}#g" ./loki-system/configmap.yaml 19 | 20 | kubectl apply -n loki -f loki-frontend/ 21 | kubectl apply -n loki -f loki-system/ 22 | kubectl apply -n loki -f loki-gateway/ 23 | } 24 | 25 | function loki_cleanup(){ 26 | 27 | kubectl delete -n loki -f loki-frontend/ 28 | kubectl delete -n loki -f loki-system/ 29 | kubectl delete -n loki -f loki-gateway/ 30 | kubectl delete -n loki -f loki-system/ 31 | sleep 30 32 | kubectl delete -n loki -f loki-redis/ 33 | } 34 | 35 | loki_install 36 | #loki_cleanup 37 | -------------------------------------------------------------------------------- /production/loki-system/loki-system/service.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: Service 3 | metadata: 4 | name: loki-system 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-system 8 | spec: 9 | type: ClusterIP 10 | ports: 11 | - name: http-3100 12 | port: 3100 13 | protocol: TCP 14 | targetPort: 3100 15 | - name: grpc-9095 16 | port: 9095 17 | protocol: TCP 18 | targetPort: 9095 19 | - name: tcp-7946 20 | port: 7946 21 | protocol: TCP 22 | targetPort: 7946 23 | selector: 24 | app.kubernetes.io/name: loki-system 25 | 26 | --- 27 | apiVersion: v1 28 | kind: Service 29 | metadata: 30 | name: loki-system-headless 31 | namespace: loki 32 | labels: 33 | app.kubernetes.io/name: loki-system 34 | spec: 35 | type: ClusterIP 36 | clusterIP: None 37 | ports: 38 | - name: http-3100 39 | port: 3100 40 | protocol: TCP 41 | targetPort: 3100 42 | - name: grpc-9095 43 | port: 9095 44 | protocol: TCP 45 | targetPort: 9095 46 | - name: tcp-7946 47 | port: 7946 48 | protocol: TCP 49 | targetPort: 7946 50 | selector: 51 | app.kubernetes.io/name: loki-system -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/values.yaml: -------------------------------------------------------------------------------- 1 | replicaCount: 1 2 | 3 | image: 4 | repository: consul:1.7.8 5 | pullPolicy: IfNotPresent 6 | 7 | imagePullSecrets: [] 8 | nameOverride: "" 9 | svcNameOverride: "" 10 | 11 | CONSUL_BIND_INTERFACE: eth0 12 | 13 | service: 14 | type: ClusterIP 15 | ports: 16 | - name: http-8500 17 | port: 8500 18 | protocol: TCP 19 | targetPort: 8500 20 | - name: http-8300 21 | port: 8300 22 | protocol: TCP 23 | targetPort: 8300 24 | - name: http-8301 25 | port: 8301 26 | protocol: TCP 27 | targetPort: 8301 28 | - name: http-8302 29 | port: 8302 30 | protocol: TCP 31 | targetPort: 8302 32 | - name: http-8600 33 | port: 8600 34 | protocol: TCP 35 | targetPort: 8600 36 | 37 | 38 | 39 | 40 | resources: 41 | requests: 42 | cpu: 200m 43 | memory: 128Mi 44 | limits: 45 | cpu: "1" 46 | memory: 512Mi 47 | 48 | livenessProbe: 49 | failureThreshold: 3 50 | initialDelaySeconds: 120 51 | periodSeconds: 30 52 | successThreshold: 1 53 | timeoutSeconds: 5 54 | tcpSocket: 55 | port: 8500 56 | 57 | nodeSelector: {} 58 | tolerations: [] 59 | affinity: {} 60 | 61 | volumeMounts: [] 62 | 63 | volumes: [] 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/README.md: -------------------------------------------------------------------------------- 1 | # loki-redis 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | redis 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"redis:5.0.6-alpine"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `6379` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `1` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"4Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"2Gi"` | | 28 | | service.ports[0].name | string | `"http-6379"` | | 29 | | service.ports[0].port | int | `6379` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `6379` | | 32 | | service.type | string | `"ClusterIP"` | | 33 | | svcNameOverride | string | `""` | | 34 | | tolerations | list | `[]` | | 35 | | volumeMounts | list | `[]` | | 36 | | volumes | list | `[]` | | 37 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/README.md: -------------------------------------------------------------------------------- 1 | # loki-gateway 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loki gateway 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"nginx:1.15.1-alpine"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `2` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"2Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-3100"` | | 29 | | service.ports[0].port | int | `3100` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `3100` | | 32 | | service.type | string | `"NodePort"` | | 33 | | svcNameOverride | string | `""` | | 34 | | tolerations | list | `[]` | | 35 | | volumeMounts | list | `[]` | | 36 | | volumes | list | `[]` | | 37 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/README.md: -------------------------------------------------------------------------------- 1 | # loki-minio 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | minio 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"minio/minio:RELEASE.2020-09-21T22-31-59Z"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `9000` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `1` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"2Gi"` | | 26 | | resources.requests.cpu | string | `"100m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-9000"` | | 29 | | service.ports[0].port | int | `9000` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `9000` | | 32 | | service.type | string | `"NodePort"` | | 33 | | svcNameOverride | string | `""` | | 34 | | tolerations | list | `[]` | | 35 | | volumeMounts | list | `[]` | | 36 | | volumes | list | `[]` | | 37 | -------------------------------------------------------------------------------- /demo/docker-compose/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 16; 2 | error_log /dev/stderr; 3 | pid /tmp/nginx.pid; 4 | worker_rlimit_nofile 8192; 5 | 6 | events { 7 | worker_connections 4096; 8 | } 9 | 10 | http { 11 | client_max_body_size 1024M; 12 | default_type application/octet-stream; 13 | resolver 127.0.0.11; 14 | access_log /dev/stdout; 15 | sendfile on; 16 | tcp_nopush on; 17 | 18 | server { 19 | listen 3100 default_server; 20 | 21 | location = / { 22 | proxy_pass http://querier:3100/ready; 23 | } 24 | 25 | location = /api/prom/push { 26 | proxy_pass http://distributor:3100$request_uri; 27 | } 28 | 29 | location = /api/prom/tail { 30 | proxy_pass http://querier:3100$request_uri; 31 | proxy_set_header Upgrade $http_upgrade; 32 | proxy_set_header Connection "upgrade"; 33 | } 34 | 35 | location ~ /api/prom/rules.* { 36 | proxy_pass http://ruler:3100$request_uri; 37 | } 38 | 39 | location ~ /api/prom/.* { 40 | proxy_pass http://querier-frontend:3100$request_uri; 41 | } 42 | 43 | location = /loki/api/v1/push { 44 | proxy_pass http://distributor:3100$request_uri; 45 | } 46 | 47 | location = /loki/api/v1/tail { 48 | proxy_pass http://querier:3100$request_uri; 49 | proxy_set_header Upgrade $http_upgrade; 50 | proxy_set_header Connection "upgrade"; 51 | } 52 | 53 | location ~ /loki/api/v1/rules.* { 54 | proxy_pass http://ruler:3100$request_uri; 55 | } 56 | 57 | location ~ /loki/api/.* { 58 | proxy_pass http://querier-frontend:3100$request_uri; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/README.md: -------------------------------------------------------------------------------- 1 | # loki-querier 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loku querier 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"grafana/loki:1.6.0"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `3` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"1Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-3100"` | | 29 | | service.ports[0].port | int | `3100` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `3100` | | 32 | | service.ports[1].name | string | `"grpc-9095"` | | 33 | | service.ports[1].port | int | `9095` | | 34 | | service.ports[1].protocol | string | `"TCP"` | | 35 | | service.ports[1].targetPort | int | `9095` | | 36 | | service.type | string | `"ClusterIP"` | | 37 | | svcNameOverride | string | `""` | | 38 | | tolerations | list | `[]` | | 39 | | volumeMounts | list | `[]` | | 40 | | volumes | list | `[]` | | 41 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/README.md: -------------------------------------------------------------------------------- 1 | # loki-ingester 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loku ingester 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"grafana/loki:1.6.0"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `3` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"1Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-3100"` | | 29 | | service.ports[0].port | int | `3100` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `3100` | | 32 | | service.ports[1].name | string | `"grpc-9095"` | | 33 | | service.ports[1].port | int | `9095` | | 34 | | service.ports[1].protocol | string | `"TCP"` | | 35 | | service.ports[1].targetPort | int | `9095` | | 36 | | service.type | string | `"ClusterIP"` | | 37 | | svcNameOverride | string | `""` | | 38 | | tolerations | list | `[]` | | 39 | | volumeMounts | list | `[]` | | 40 | | volumes | list | `[]` | | 41 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/README.md: -------------------------------------------------------------------------------- 1 | # table-manager 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loki table-manager 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"grafana/loki:1.6.0"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `1` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"1Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-3100"` | | 29 | | service.ports[0].port | int | `3100` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `3100` | | 32 | | service.ports[1].name | string | `"grpc-9095"` | | 33 | | service.ports[1].port | int | `9095` | | 34 | | service.ports[1].protocol | string | `"TCP"` | | 35 | | service.ports[1].targetPort | int | `9095` | | 36 | | service.type | string | `"ClusterIP"` | | 37 | | svcNameOverride | string | `""` | | 38 | | tolerations | list | `[]` | | 39 | | volumeMounts | list | `[]` | | 40 | | volumes | list | `[]` | | 41 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/README.md: -------------------------------------------------------------------------------- 1 | # loki-cassandra 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | cassandra 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"bitnami/cassandra:3-debian-10"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `130` | | 16 | | livenessProbe.initialDelaySeconds | int | `300` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `9042` | | 20 | | livenessProbe.timeoutSeconds | int | `10` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `1` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"10Gi"` | | 26 | | resources.requests.cpu | string | `"500m"` | | 27 | | resources.requests.memory | string | `"8Gi"` | | 28 | | service.ports[0].name | string | `"http-7000"` | | 29 | | service.ports[0].port | int | `7000` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `7000` | | 32 | | service.ports[1].name | string | `"http-9042"` | | 33 | | service.ports[1].port | int | `9042` | | 34 | | service.ports[1].protocol | string | `"TCP"` | | 35 | | service.ports[1].targetPort | int | `9042` | | 36 | | service.type | string | `"ClusterIP"` | | 37 | | svcNameOverride | string | `""` | | 38 | | tolerations | list | `[]` | | 39 | | volumeMounts | list | `[]` | | 40 | | volumes | list | `[]` | | 41 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/README.md: -------------------------------------------------------------------------------- 1 | # loki-querier-frontend 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loku querier-frontend 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"grafana/loki:1.6.0"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | nameOverride | string | `""` | | 22 | | nodeSelector | object | `{}` | | 23 | | replicaCount | int | `2` | | 24 | | resources.limits.cpu | string | `"1"` | | 25 | | resources.limits.memory | string | `"1Gi"` | | 26 | | resources.requests.cpu | string | `"200m"` | | 27 | | resources.requests.memory | string | `"256Mi"` | | 28 | | service.ports[0].name | string | `"http-3100"` | | 29 | | service.ports[0].port | int | `3100` | | 30 | | service.ports[0].protocol | string | `"TCP"` | | 31 | | service.ports[0].targetPort | int | `3100` | | 32 | | service.ports[1].name | string | `"grpc-9095"` | | 33 | | service.ports[1].port | int | `9095` | | 34 | | service.ports[1].protocol | string | `"TCP"` | | 35 | | service.ports[1].targetPort | int | `9095` | | 36 | | service.type | string | `"ClusterIP"` | | 37 | | svcNameOverride | string | `""` | | 38 | | tolerations | list | `[]` | | 39 | | volumeMounts | list | `[]` | | 40 | | volumes | list | `[]` | | 41 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/README.md: -------------------------------------------------------------------------------- 1 | # loki-distributor 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | loku distributor 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | affinity | object | `{}` | | 12 | | image.pullPolicy | string | `"IfNotPresent"` | | 13 | | image.repository | string | `"grafana/loki:1.6.0"` | | 14 | | imagePullSecrets | list | `[]` | | 15 | | livenessProbe.failureThreshold | int | `3` | | 16 | | livenessProbe.initialDelaySeconds | int | `120` | | 17 | | livenessProbe.periodSeconds | int | `30` | | 18 | | livenessProbe.successThreshold | int | `1` | | 19 | | livenessProbe.tcpSocket.port | int | `3100` | | 20 | | livenessProbe.timeoutSeconds | int | `5` | | 21 | | loki-cassandra.svcNameOverride | string | `nil` | | 22 | | nameOverride | string | `""` | | 23 | | nodeSelector | object | `{}` | | 24 | | replicaCount | int | `3` | | 25 | | resources.limits.cpu | string | `"1"` | | 26 | | resources.limits.memory | string | `"1Gi"` | | 27 | | resources.requests.cpu | string | `"200m"` | | 28 | | resources.requests.memory | string | `"256Mi"` | | 29 | | service.ports[0].name | string | `"http-3100"` | | 30 | | service.ports[0].port | int | `3100` | | 31 | | service.ports[0].protocol | string | `"TCP"` | | 32 | | service.ports[0].targetPort | int | `3100` | | 33 | | service.ports[1].name | string | `"grpc-9095"` | | 34 | | service.ports[1].port | int | `9095` | | 35 | | service.ports[1].protocol | string | `"TCP"` | | 36 | | service.ports[1].targetPort | int | `9095` | | 37 | | service.type | string | `"ClusterIP"` | | 38 | | svcNameOverride | string | `""` | | 39 | | tolerations | list | `[]` | | 40 | | volumeMounts | list | `[]` | | 41 | | volumes | list | `[]` | | 42 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ruler/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/templates/_helpers.tpl: -------------------------------------------------------------------------------- 1 | {{/* vim: set filetype=mustache: */}} 2 | {{/* 3 | Expand the name of the chart. 4 | */}} 5 | {{- define "app.name" -}} 6 | {{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} 7 | {{- end -}} 8 | 9 | {{/* 10 | Expand the name of the chart. 11 | */}} 12 | {{- define "app.svcname" -}} 13 | {{- default .Chart.Name .Values.svcNameOverride | trunc 63 | trimSuffix "-" -}} 14 | {{- end -}} 15 | 16 | {{/* 17 | Create a default fully qualified app name. 18 | */}} 19 | {{- define "app.fullname" -}} 20 | {{- if .Values.fullnameOverride -}} 21 | {{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} 22 | {{- else -}} 23 | {{- $name := default .Chart.Name .Values.nameOverride -}} 24 | {{- if contains $name .Release.Name -}} 25 | {{- .Release.Name | trunc 63 | trimSuffix "-" -}} 26 | {{- else -}} 27 | {{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} 28 | {{- end -}} 29 | {{- end -}} 30 | {{- end -}} 31 | 32 | {{/* 33 | Create chart name and version as used by the chart label. 34 | */}} 35 | {{- define "app.chart" -}} 36 | {{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} 37 | {{- end -}} 38 | 39 | {{/* 40 | Common labels 41 | */}} 42 | {{- define "app.labels" -}} 43 | app: {{ include "app.name" . }} 44 | app.instance: {{ .Release.Name }} 45 | helm.sh/chart: {{ include "app.chart" . }} 46 | {{- if .Values.global }} 47 | {{- if .Values.global.name }} 48 | app.kubernetes.io/name: {{ .Values.global.name | quote }} 49 | {{- end }} 50 | {{- end }} 51 | {{- if .Chart.AppVersion }} 52 | app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} 53 | {{- end }} 54 | app.kubernetes.io/managed-by: {{ .Release.Service }} 55 | {{- end -}} 56 | 57 | {{/* 58 | Simple labels 59 | */}} 60 | {{- define "simple.labels" -}} 61 | app: {{ include "app.name" . }} 62 | app.kubernetes.io/managed-by: {{ .Release.Service }} 63 | {{- end -}} 64 | -------------------------------------------------------------------------------- /production/loki-system/loki-gateway/deploy.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: Deployment 3 | metadata: 4 | labels: 5 | app.kubernetes.io/name: loki-gateway 6 | name: loki-gateway 7 | namespace: loki 8 | spec: 9 | replicas: 2 10 | selector: 11 | matchLabels: 12 | app.kubernetes.io/name: loki-gateway 13 | strategy: 14 | rollingUpdate: 15 | maxSurge: 25% 16 | maxUnavailable: 25% 17 | type: RollingUpdate 18 | template: 19 | metadata: 20 | labels: 21 | app.kubernetes.io/name: loki-gateway 22 | spec: 23 | affinity: 24 | podAffinity: 25 | podAntiAffinity: 26 | preferredDuringSchedulingIgnoredDuringExecution: 27 | - podAffinityTerm: 28 | labelSelector: 29 | matchLabels: 30 | app.kubernetes.io/name: loki-gateway 31 | topologyKey: kubernetes.io/hostname 32 | weight: 1 33 | nodeAffinity: 34 | containers: 35 | - image: nginx:1.15.1-alpine 36 | imagePullPolicy: IfNotPresent 37 | livenessProbe: 38 | failureThreshold: 3 39 | initialDelaySeconds: 120 40 | periodSeconds: 30 41 | successThreshold: 1 42 | tcpSocket: 43 | port: 3100 44 | timeoutSeconds: 5 45 | name: loki-gateway 46 | ports: 47 | - containerPort: 3100 48 | name: http-3100 49 | protocol: TCP 50 | resources: 51 | limits: 52 | cpu: "1" 53 | memory: 2Gi 54 | requests: 55 | cpu: 200m 56 | memory: 256Mi 57 | volumeMounts: 58 | - mountPath: /etc/nginx/nginx.conf 59 | name: loki-gateway-config 60 | readOnly: true 61 | subPath: nginx.conf 62 | dnsPolicy: ClusterFirst 63 | restartPolicy: Always 64 | volumes: 65 | - configMap: 66 | defaultMode: 420 67 | name: loki-gateway 68 | name: loki-gateway-config -------------------------------------------------------------------------------- /production/loki-system/loki-gateway/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | data: 3 | nginx.conf: |- 4 | worker_processes 8; 5 | error_log /dev/stderr; 6 | pid /tmp/nginx.pid; 7 | worker_rlimit_nofile 8192; 8 | events { 9 | worker_connections 4096; 10 | } 11 | http { 12 | client_max_body_size 1024M; 13 | resolver kube-dns.kube-system.svc.cluster.local; 14 | default_type application/octet-stream; 15 | access_log /dev/stdout; 16 | sendfile on; 17 | tcp_nopush on; 18 | server { 19 | listen 3100 default_server; 20 | location = / { 21 | proxy_pass http://loki-system.loki.svc.cluster.local:3100/ready; 22 | } 23 | location = /ring { 24 | proxy_pass http://loki-system.loki.svc.cluster.local:3100$request_uri; 25 | } 26 | location = /api/prom/push { 27 | proxy_pass http://loki-system.loki.svc.cluster.local:3100$request_uri; 28 | } 29 | location = /api/prom/tail { 30 | proxy_pass http://loki-system.loki.svc.cluster.local:3100$request_uri; 31 | proxy_set_header Upgrade $http_upgrade; 32 | proxy_set_header Connection "upgrade"; 33 | } 34 | location ~ /api/prom/.* { 35 | proxy_pass http://loki-frontend.loki.svc.cluster.local:3100$request_uri; 36 | } 37 | location = /loki/api/v1/push { 38 | proxy_pass http://loki-system.loki.svc.cluster.local:3100$request_uri; 39 | } 40 | location = /loki/api/v1/tail { 41 | proxy_pass http://loki-system.loki.svc.cluster.local:3100$request_uri; 42 | proxy_set_header Upgrade $http_upgrade; 43 | proxy_set_header Connection "upgrade"; 44 | } 45 | location ~ /loki/api/.* { 46 | proxy_pass http://loki-frontend.loki.svc.cluster.local:3100$request_uri; 47 | } 48 | } 49 | } 50 | kind: ConfigMap 51 | metadata: 52 | labels: 53 | name: loki-gateway 54 | namespace: loki -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/tempo/tempo.yaml: -------------------------------------------------------------------------------- 1 | auth_enabled: false 2 | 3 | server: 4 | http_listen_port: 3100 5 | 6 | distributor: 7 | receivers: # this configuration will listen on all ports and protocols that tempo is capable of. 8 | jaeger: # the receives all come from the OpenTelemetry collector. more configuration information can 9 | protocols: # be found there: https://github.com/open-telemetry/opentelemetry-collector/tree/master/receiver 10 | thrift_http: # 11 | grpc: # for a production deployment you should only enable the receivers you need! 12 | thrift_binary: 13 | thrift_compact: 14 | zipkin: 15 | otlp: 16 | protocols: 17 | http: 18 | grpc: 19 | opencensus: 20 | 21 | ingester: 22 | trace_idle_period: 10s # the length of time after a trace has not received spans to consider it complete and flush it 23 | traces_per_block: 100 # cut the head block when it his this number of traces or ... 24 | max_block_duration: 5m # this much time passes 25 | 26 | compactor: 27 | compaction: 28 | compaction_window: 1h # blocks in this time window will be compacted together 29 | max_compaction_objects: 1000000 # maximum size of compacted blocks 30 | block_retention: 1h 31 | compacted_block_retention: 10m 32 | 33 | storage: 34 | trace: 35 | backend: s3 # backend configuration to use 36 | wal: 37 | path: /tmp/tempo/wal # where to store the the wal locally 38 | bloom_filter_false_positive: .05 # bloom filter false positive rate. lower values create larger filters but fewer false positives 39 | index_downsample: 10 # number of traces per index record 40 | s3: 41 | bucket: tempo # how to store data in s3 42 | endpoint: minio:9000 43 | access_key: key123456 44 | secret_key: password123456 45 | insecure: true 46 | pool: 47 | max_workers: 100 # the worker pool mainly drives querying, but is also used for polling the blocklist 48 | queue_depth: 10000 49 | -------------------------------------------------------------------------------- /production/loki-system/loki-frontend/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: loki-frontend 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-frontend 8 | spec: 9 | replicas: 2 10 | serviceName: loki-frontend 11 | selector: 12 | matchLabels: 13 | app.kubernetes.io/name: loki-frontend 14 | template: 15 | metadata: 16 | labels: 17 | app.kubernetes.io/name: loki-frontend 18 | spec: 19 | affinity: 20 | podAffinity: 21 | podAntiAffinity: 22 | preferredDuringSchedulingIgnoredDuringExecution: 23 | - podAffinityTerm: 24 | labelSelector: 25 | matchLabels: 26 | app.kubernetes.io/name: loki-frontend 27 | topologyKey: kubernetes.io/hostname 28 | weight: 1 29 | nodeAffinity: 30 | containers: 31 | - name: loki-frontend 32 | image: grafana/loki:2.2.1 33 | args: 34 | - "-config.file=/etc/loki/local-config.yaml" 35 | - "-target=query-frontend" 36 | imagePullPolicy: IfNotPresent 37 | ports: 38 | - containerPort: 3100 39 | name: http-3100 40 | protocol: TCP 41 | - containerPort: 9095 42 | name: http-9095 43 | protocol: TCP 44 | resources: 45 | limits: 46 | cpu: "4" 47 | memory: 8Gi 48 | requests: 49 | cpu: "1" 50 | memory: "2Gi" 51 | volumeMounts: 52 | - name: loki-config 53 | mountPath: /etc/loki/ 54 | readOnly: true 55 | livenessProbe: 56 | failureThreshold: 3 57 | initialDelaySeconds: 120 58 | periodSeconds: 30 59 | successThreshold: 1 60 | tcpSocket: 61 | port: 3100 62 | timeoutSeconds: 5 63 | securityContext: 64 | capabilities: 65 | add: [] 66 | drop: 67 | - ALL 68 | readOnlyRootFilesystem: false 69 | runAsNonRoot: true 70 | runAsUser: 1001 71 | securityContext: 72 | fsGroup: 100 73 | volumes: 74 | - name: loki-config 75 | configMap: 76 | name: loki-local-config -------------------------------------------------------------------------------- /production/loki-system/loki-redis/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: loki-redis 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-redis 8 | spec: 9 | replicas: 1 10 | serviceName: loki-redis 11 | selector: 12 | matchLabels: 13 | app.kubernetes.io/name: loki-redis 14 | template: 15 | metadata: 16 | labels: 17 | app.kubernetes.io/name: loki-redis 18 | spec: 19 | containers: 20 | - name: loki-redis 21 | image: redis:5.0.6-alpine 22 | imagePullPolicy: IfNotPresent 23 | args: ["/etc/redis.conf"] 24 | ports: 25 | - containerPort: 6379 26 | name: tcp-6379 27 | protocol: TCP 28 | resources: 29 | limits: 30 | cpu: "1" 31 | memory: 8Gi 32 | requests: 33 | cpu: 200m 34 | memory: 4Gi 35 | volumeMounts: 36 | - name: redis-config 37 | mountPath: /etc/redis.conf 38 | subPath: redis.conf 39 | readOnly: true 40 | - name: data 41 | mountPath: /var/lib/redis 42 | livenessProbe: 43 | failureThreshold: 3 44 | initialDelaySeconds: 120 45 | periodSeconds: 30 46 | successThreshold: 1 47 | tcpSocket: 48 | port: 6379 49 | timeoutSeconds: 5 50 | securityContext: 51 | capabilities: 52 | add: [] 53 | drop: 54 | - ALL 55 | readOnlyRootFilesystem: false 56 | runAsNonRoot: true 57 | runAsUser: 1001 58 | - name: loki-redis-exporter 59 | image: oliver006/redis_exporter:v1.0.3 60 | imagePullPolicy: IfNotPresent 61 | args: 62 | - -redis.addr=loki-redis:6379 63 | ports: 64 | - containerPort: 9121 65 | name: metrics 66 | protocol: TCP 67 | resources: 68 | limits: 69 | cpu: "50m" 70 | memory: 32Mi 71 | requests: 72 | cpu: 10m 73 | memory: 16Mi 74 | securityContext: 75 | fsGroup: 100 76 | volumes: 77 | - name: redis-config 78 | configMap: 79 | name: loki-redis 80 | - persistentVolumeClaim: 81 | claimName: loki-redis-data 82 | name: data -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/README.md: -------------------------------------------------------------------------------- 1 | # loki-consul 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | consul 6 | 7 | ## Values 8 | 9 | | Key | Type | Default | Description | 10 | |-----|------|---------|-------------| 11 | | CONSUL_BIND_INTERFACE | string | `"eth0"` | | 12 | | affinity | object | `{}` | | 13 | | image.pullPolicy | string | `"IfNotPresent"` | | 14 | | image.repository | string | `"consul:1.7.8"` | | 15 | | imagePullSecrets | list | `[]` | | 16 | | livenessProbe.failureThreshold | int | `3` | | 17 | | livenessProbe.initialDelaySeconds | int | `120` | | 18 | | livenessProbe.periodSeconds | int | `30` | | 19 | | livenessProbe.successThreshold | int | `1` | | 20 | | livenessProbe.tcpSocket.port | int | `8500` | | 21 | | livenessProbe.timeoutSeconds | int | `5` | | 22 | | nameOverride | string | `""` | | 23 | | nodeSelector | object | `{}` | | 24 | | replicaCount | int | `1` | | 25 | | resources.limits.cpu | string | `"1"` | | 26 | | resources.limits.memory | string | `"512Mi"` | | 27 | | resources.requests.cpu | string | `"200m"` | | 28 | | resources.requests.memory | string | `"128Mi"` | | 29 | | service.ports[0].name | string | `"http-8500"` | | 30 | | service.ports[0].port | int | `8500` | | 31 | | service.ports[0].protocol | string | `"TCP"` | | 32 | | service.ports[0].targetPort | int | `8500` | | 33 | | service.ports[1].name | string | `"http-8300"` | | 34 | | service.ports[1].port | int | `8300` | | 35 | | service.ports[1].protocol | string | `"TCP"` | | 36 | | service.ports[1].targetPort | int | `8300` | | 37 | | service.ports[2].name | string | `"http-8301"` | | 38 | | service.ports[2].port | int | `8301` | | 39 | | service.ports[2].protocol | string | `"TCP"` | | 40 | | service.ports[2].targetPort | int | `8301` | | 41 | | service.ports[3].name | string | `"http-8302"` | | 42 | | service.ports[3].port | int | `8302` | | 43 | | service.ports[3].protocol | string | `"TCP"` | | 44 | | service.ports[3].targetPort | int | `8302` | | 45 | | service.ports[4].name | string | `"http-8600"` | | 46 | | service.ports[4].port | int | `8600` | | 47 | | service.ports[4].protocol | string | `"TCP"` | | 48 | | service.ports[4].targetPort | int | `8600` | | 49 | | service.type | string | `"ClusterIP"` | | 50 | | svcNameOverride | string | `""` | | 51 | | tolerations | list | `[]` | | 52 | | volumeMounts | list | `[]` | | 53 | | volumes | list | `[]` | | 54 | -------------------------------------------------------------------------------- /production/loki-system/loki-system/statefulset.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: apps/v1 2 | kind: StatefulSet 3 | metadata: 4 | name: loki-system 5 | namespace: loki 6 | labels: 7 | app.kubernetes.io/name: loki-system 8 | spec: 9 | replicas: 3 10 | serviceName: loki-system-headless 11 | selector: 12 | matchLabels: 13 | app.kubernetes.io/name: loki-system 14 | template: 15 | metadata: 16 | labels: 17 | app.kubernetes.io/name: loki-system 18 | spec: 19 | affinity: 20 | podAffinity: 21 | 22 | podAntiAffinity: 23 | preferredDuringSchedulingIgnoredDuringExecution: 24 | - podAffinityTerm: 25 | labelSelector: 26 | matchLabels: 27 | app.kubernetes.io/name: loki-system 28 | topologyKey: kubernetes.io/hostname 29 | weight: 1 30 | nodeAffinity: 31 | containers: 32 | - name: loki-system 33 | image: grafana/loki:2.2.1 34 | imagePullPolicy: IfNotPresent 35 | ports: 36 | - containerPort: 3100 37 | name: http-3100 38 | protocol: TCP 39 | - containerPort: 9095 40 | name: grpc-9095 41 | protocol: TCP 42 | - containerPort: 7946 43 | name: tcp-7946 44 | protocol: TCP 45 | resources: 46 | limits: 47 | cpu: "8" 48 | memory: 24Gi 49 | requests: 50 | cpu: "4" 51 | memory: "8Gi" 52 | volumeMounts: 53 | - name: loki-config 54 | mountPath: /etc/loki/ 55 | readOnly: true 56 | - name: data 57 | mountPath: /loki/ 58 | livenessProbe: 59 | failureThreshold: 3 60 | initialDelaySeconds: 120 61 | periodSeconds: 30 62 | successThreshold: 1 63 | tcpSocket: 64 | port: 3100 65 | timeoutSeconds: 5 66 | securityContext: 67 | capabilities: 68 | add: [] 69 | drop: 70 | - ALL 71 | readOnlyRootFilesystem: false 72 | runAsNonRoot: true 73 | runAsUser: 1001 74 | securityContext: 75 | fsGroup: 100 76 | volumes: 77 | - name: loki-config 78 | configMap: 79 | name: loki-local-config 80 | volumeClaimTemplates: 81 | - metadata: 82 | name: data 83 | labels: 84 | app.kubernetes.io/name: loging-system 85 | spec: 86 | accessModes: ["ReadWriteOnce"] 87 | resources: 88 | requests: 89 | storage: "100Gi" 90 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/templates/nginx.conf: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | namespace: {{ $root.Release.Namespace }} 6 | labels: 7 | {{ include "simple.labels" $root | indent 4 }} 8 | name: nginx-conf 9 | data: 10 | nginx.conf: | 11 | worker_processes 16; 12 | error_log /dev/stderr; 13 | pid /tmp/nginx.pid; 14 | worker_rlimit_nofile 8192; 15 | 16 | events { 17 | worker_connections 4096; 18 | } 19 | 20 | http { 21 | client_max_body_size 1024M; 22 | resolver kube-dns.kube-system.svc.cluster.local; 23 | default_type application/octet-stream; 24 | access_log /dev/stdout; 25 | sendfile on; 26 | tcp_nopush on; 27 | 28 | server { 29 | listen 3100 default_server; 30 | 31 | location = / { 32 | proxy_pass http://{{ index .Values "loki-querier" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100/ready; 33 | } 34 | 35 | location = /api/prom/push { 36 | proxy_pass http://{{ index .Values "loki-distributor" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 37 | } 38 | 39 | location = /api/prom/tail { 40 | proxy_pass http://{{ index .Values "loki-querier" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 41 | proxy_set_header Upgrade $http_upgrade; 42 | proxy_set_header Connection "upgrade"; 43 | } 44 | 45 | location ~ /api/prom/rules.* { 46 | proxy_pass http://{{ index .Values "loki-ruler" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 47 | } 48 | 49 | location ~ /api/prom/.* { 50 | proxy_pass http://{{ index .Values "loki-querier-frontend" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 51 | } 52 | 53 | location = /loki/api/v1/push { 54 | proxy_pass http://{{ index .Values "loki-distributor" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 55 | } 56 | 57 | location = /loki/api/v1/tail { 58 | proxy_pass http://{{ index .Values "loki-querier" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 59 | proxy_set_header Upgrade $http_upgrade; 60 | proxy_set_header Connection "upgrade"; 61 | } 62 | 63 | location ~ /loki/api/v1/rules.* { 64 | proxy_pass http://{{ index .Values "loki-ruler" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 65 | } 66 | 67 | location ~ /loki/api/.* { 68 | proxy_pass http://{{ index .Values "loki-querier-frontend" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local:3100$request_uri; 69 | } 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-consul/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: 1 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | env: 58 | - name: CONSUL_BIND_INTERFACE 59 | value: {{ .Values.CONSUL_BIND_INTERFACE }} 60 | {{- with .Values.resources }} 61 | resources: 62 | {{- toYaml . | nindent 10 }} 63 | {{- end }} 64 | {{- range .Values.persistence }} 65 | volumeMounts: 66 | - name: {{ .name }} 67 | mountPath: {{ .mount_path }} 68 | {{- end }} 69 | {{- with .Values.livenessProbe }} 70 | livenessProbe: 71 | {{- toYaml . | nindent 10 }} 72 | {{- end }} 73 | {{- with .Values.readinessProbe }} 74 | readinessProbe: 75 | {{- toYaml . | nindent 10 }} 76 | {{- end }} 77 | {{- with .Values.nodeSelector }} 78 | nodeSelector: 79 | {{- toYaml . | nindent 8 }} 80 | {{- end }} 81 | {{- with .Values.affinity }} 82 | affinity: 83 | {{- toYaml . | nindent 8 }} 84 | {{- end }} 85 | {{- with .Values.tolerations }} 86 | tolerations: 87 | {{- toYaml . | nindent 6 }} 88 | {{- end }} 89 | volumes: 90 | {{- with .Values.volumes }} 91 | {{- toYaml . | nindent 6 }} 92 | {{- end }} 93 | {{- range .Values.persistence }} 94 | - persistentVolumeClaim: 95 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 96 | name: {{ .name }} 97 | {{- end }} 98 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-gateway/templates/deploy.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | {{- with .Values.strategy }} 12 | strategy: 13 | {{- toYaml . | nindent 4 }} 14 | {{- end }} 15 | selector: 16 | matchLabels: 17 | app: {{ include "app.name" . }} 18 | app.instance: {{ .Release.Name }} 19 | template: 20 | metadata: 21 | labels: 22 | app: {{ include "app.name" . }} 23 | app.instance: {{ .Release.Name }} 24 | {{- if .Values.image.tag }} 25 | app.image.version: {{ .Values.image.tag | quote }} 26 | {{- end }} 27 | {{- if .Values.logColect }} 28 | log-collect: "true" 29 | {{- end }} 30 | annotations: 31 | {{- if .Values.istioInject }} 32 | sidecar.istio.io/inject: "true" 33 | {{- else }} 34 | sidecar.istio.io/inject: "false" 35 | {{- end }} 36 | {{- with .Values.podAnnotations }} 37 | {{- toYaml . | nindent 8 }} 38 | {{- end }} 39 | spec: 40 | {{- with .Values.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 6 }} 43 | {{- end }} 44 | containers: 45 | - name: {{ .Chart.Name }} 46 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 47 | imagePullPolicy: {{ .Values.image.pullPolicy }} 48 | {{- with .Values.service }} 49 | ports: 50 | {{- range .ports }} 51 | - containerPort: {{ .targetPort }} 52 | name: {{ .name }} 53 | protocol: {{ .protocol }} 54 | {{- end }} 55 | {{- end}} 56 | {{- with .Values.resources }} 57 | resources: 58 | {{- toYaml . | nindent 10 }} 59 | {{- end }} 60 | volumeMounts: 61 | - name: loki-gateway-config 62 | mountPath: /etc/nginx/nginx.conf 63 | subPath: nginx.conf 64 | readOnly: true 65 | {{- range .Values.persistence }} 66 | - name: {{ .name }} 67 | mountPath: {{ .mount_path }} 68 | {{- end }} 69 | {{- with .Values.livenessProbe }} 70 | livenessProbe: 71 | {{- toYaml . | nindent 10 }} 72 | {{- end }} 73 | {{- with .Values.readinessProbe }} 74 | readinessProbe: 75 | {{- toYaml . | nindent 10 }} 76 | {{- end }} 77 | {{- with .Values.nodeSelector }} 78 | nodeSelector: 79 | {{- toYaml . | nindent 8 }} 80 | {{- end }} 81 | {{- with .Values.affinity }} 82 | affinity: 83 | {{- toYaml . | nindent 8 }} 84 | {{- end }} 85 | {{- with .Values.tolerations }} 86 | tolerations: 87 | {{- toYaml . | nindent 6 }} 88 | {{- end }} 89 | volumes: 90 | - name: loki-gateway-config 91 | configMap: 92 | name: nginx-conf 93 | {{- with .Values.volumes }} 94 | {{- toYaml . | nindent 6 }} 95 | {{- end }} 96 | {{- range .Values.persistence }} 97 | - persistentVolumeClaim: 98 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 99 | name: {{ .name }} 100 | {{- end }} 101 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier-frontend/templates/deploy.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: Deployment 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | {{- with .Values.strategy }} 12 | strategy: 13 | {{- toYaml . | nindent 4 }} 14 | {{- end }} 15 | selector: 16 | matchLabels: 17 | app: {{ include "app.name" . }} 18 | app.instance: {{ .Release.Name }} 19 | template: 20 | metadata: 21 | labels: 22 | app: {{ include "app.name" . }} 23 | app.instance: {{ .Release.Name }} 24 | {{- if .Values.image.tag }} 25 | app.image.version: {{ .Values.image.tag | quote }} 26 | {{- end }} 27 | {{- if .Values.logColect }} 28 | log-collect: "true" 29 | {{- end }} 30 | annotations: 31 | {{- if .Values.istioInject }} 32 | sidecar.istio.io/inject: "true" 33 | {{- else }} 34 | sidecar.istio.io/inject: "false" 35 | {{- end }} 36 | {{- with .Values.podAnnotations }} 37 | {{- toYaml . | nindent 8 }} 38 | {{- end }} 39 | spec: 40 | {{- with .Values.imagePullSecrets }} 41 | imagePullSecrets: 42 | {{- toYaml . | nindent 6 }} 43 | {{- end }} 44 | containers: 45 | - name: {{ .Chart.Name }} 46 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 47 | imagePullPolicy: {{ .Values.image.pullPolicy }} 48 | {{- with .Values.service }} 49 | ports: 50 | {{- range .ports }} 51 | - containerPort: {{ .targetPort }} 52 | name: {{ .name }} 53 | protocol: {{ .protocol }} 54 | {{- end }} 55 | {{- end}} 56 | {{- with .Values.resources }} 57 | resources: 58 | {{- toYaml . | nindent 10 }} 59 | {{- end }} 60 | args: ["-target=query-frontend", "-config.file=/etc/loki/local-config.yaml"] 61 | volumeMounts: 62 | - name: loki-config 63 | mountPath: /etc/loki/ 64 | readOnly: true 65 | {{- range .Values.persistence }} 66 | - name: {{ .name }} 67 | mountPath: {{ .mount_path }} 68 | {{- end }} 69 | {{- with .Values.livenessProbe }} 70 | livenessProbe: 71 | {{- toYaml . | nindent 10 }} 72 | {{- end }} 73 | {{- with .Values.readinessProbe }} 74 | readinessProbe: 75 | {{- toYaml . | nindent 10 }} 76 | {{- end }} 77 | {{- with .Values.nodeSelector }} 78 | nodeSelector: 79 | {{- toYaml . | nindent 8 }} 80 | {{- end }} 81 | {{- with .Values.affinity }} 82 | affinity: 83 | {{- toYaml . | nindent 8 }} 84 | {{- end }} 85 | {{- with .Values.tolerations }} 86 | tolerations: 87 | {{- toYaml . | nindent 6 }} 88 | {{- end }} 89 | volumes: 90 | - name: loki-config 91 | configMap: 92 | name: local-config 93 | {{- with .Values.volumes }} 94 | {{- toYaml . | nindent 6 }} 95 | {{- end }} 96 | {{- range .Values.persistence }} 97 | - persistentVolumeClaim: 98 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 99 | name: {{ .name }} 100 | {{- end }} 101 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-redis/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: 1 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | args: ["/etc/redis.conf"] 51 | ports: 52 | {{- range .ports }} 53 | - containerPort: {{ .targetPort }} 54 | name: {{ .name }} 55 | protocol: {{ .protocol }} 56 | {{- end }} 57 | {{- end}} 58 | {{- with .Values.resources }} 59 | resources: 60 | {{- toYaml . | nindent 10 }} 61 | {{- end }} 62 | volumeMounts: 63 | - name: redis-config 64 | mountPath: /etc/redis.conf 65 | subPath: redis.conf 66 | readOnly: true 67 | {{- range .Values.persistence }} 68 | - name: {{ .name }} 69 | mountPath: {{ .mount_path }} 70 | {{- end }} 71 | {{- with .Values.livenessProbe }} 72 | livenessProbe: 73 | {{- toYaml . | nindent 10 }} 74 | {{- end }} 75 | {{- with .Values.readinessProbe }} 76 | readinessProbe: 77 | {{- toYaml . | nindent 10 }} 78 | {{- end }} 79 | {{- with .Values.nodeSelector }} 80 | nodeSelector: 81 | {{- toYaml . | nindent 8 }} 82 | {{- end }} 83 | {{- with .Values.affinity }} 84 | affinity: 85 | {{- toYaml . | nindent 8 }} 86 | {{- end }} 87 | {{- with .Values.tolerations }} 88 | tolerations: 89 | {{- toYaml . | nindent 6 }} 90 | {{- end }} 91 | volumes: 92 | - name: redis-config 93 | configMap: 94 | name: redis.conf 95 | {{- with .Values.volumes }} 96 | {{- toYaml . | nindent 6 }} 97 | {{- end }} 98 | {{- range .Values.persistence }} 99 | - persistentVolumeClaim: 100 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 101 | name: {{ .name }} 102 | {{- end }} 103 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ingester/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | {{- with .Values.resources }} 58 | resources: 59 | {{- toYaml . | nindent 10 }} 60 | {{- end }} 61 | args: ["-target=ingester", "-config.file=/etc/loki/local-config.yaml"] 62 | volumeMounts: 63 | - name: loki-config 64 | mountPath: /etc/loki/ 65 | readOnly: true 66 | {{- range .Values.persistence }} 67 | - name: {{ .name }} 68 | mountPath: {{ .mount_path }} 69 | {{- end }} 70 | {{- with .Values.livenessProbe }} 71 | livenessProbe: 72 | {{- toYaml . | nindent 10 }} 73 | {{- end }} 74 | {{- with .Values.readinessProbe }} 75 | readinessProbe: 76 | {{- toYaml . | nindent 10 }} 77 | {{- end }} 78 | {{- with .Values.nodeSelector }} 79 | nodeSelector: 80 | {{- toYaml . | nindent 8 }} 81 | {{- end }} 82 | {{- with .Values.affinity }} 83 | affinity: 84 | {{- toYaml . | nindent 8 }} 85 | {{- end }} 86 | {{- with .Values.tolerations }} 87 | tolerations: 88 | {{- toYaml . | nindent 6 }} 89 | {{- end }} 90 | volumes: 91 | - name: loki-config 92 | configMap: 93 | name: local-config 94 | {{- with .Values.volumes }} 95 | {{- toYaml . | nindent 6 }} 96 | {{- end }} 97 | {{- range .Values.persistence }} 98 | - persistentVolumeClaim: 99 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 100 | name: {{ .name }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-querier/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | {{- with .Values.resources }} 58 | resources: 59 | {{- toYaml . | nindent 10 }} 60 | {{- end }} 61 | args: ["-target=querier", "-config.file=/etc/loki/local-config.yaml"] 62 | volumeMounts: 63 | - name: loki-config 64 | mountPath: /etc/loki/ 65 | readOnly: true 66 | {{- range .Values.persistence }} 67 | - name: {{ .name }} 68 | mountPath: {{ .mount_path }} 69 | {{- end }} 70 | {{- with .Values.livenessProbe }} 71 | livenessProbe: 72 | {{- toYaml . | nindent 10 }} 73 | {{- end }} 74 | {{- with .Values.readinessProbe }} 75 | readinessProbe: 76 | {{- toYaml . | nindent 10 }} 77 | {{- end }} 78 | {{- with .Values.nodeSelector }} 79 | nodeSelector: 80 | {{- toYaml . | nindent 8 }} 81 | {{- end }} 82 | {{- with .Values.affinity }} 83 | affinity: 84 | {{- toYaml . | nindent 8 }} 85 | {{- end }} 86 | {{- with .Values.tolerations }} 87 | tolerations: 88 | {{- toYaml . | nindent 6 }} 89 | {{- end }} 90 | volumes: 91 | - name: loki-config 92 | configMap: 93 | name: local-config 94 | {{- with .Values.volumes }} 95 | {{- toYaml . | nindent 6 }} 96 | {{- end }} 97 | {{- range .Values.persistence }} 98 | - persistentVolumeClaim: 99 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 100 | name: {{ .name }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-distributor/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | {{- with .Values.resources }} 58 | resources: 59 | {{- toYaml . | nindent 10 }} 60 | {{- end }} 61 | args: ["-target=distributor", "-config.file=/etc/loki/local-config.yaml"] 62 | volumeMounts: 63 | - name: loki-config 64 | mountPath: /etc/loki/ 65 | readOnly: true 66 | {{- range .Values.persistence }} 67 | - name: {{ .name }} 68 | mountPath: {{ .mount_path }} 69 | {{- end }} 70 | {{- with .Values.livenessProbe }} 71 | livenessProbe: 72 | {{- toYaml . | nindent 10 }} 73 | {{- end }} 74 | {{- with .Values.readinessProbe }} 75 | readinessProbe: 76 | {{- toYaml . | nindent 10 }} 77 | {{- end }} 78 | {{- with .Values.nodeSelector }} 79 | nodeSelector: 80 | {{- toYaml . | nindent 8 }} 81 | {{- end }} 82 | {{- with .Values.affinity }} 83 | affinity: 84 | {{- toYaml . | nindent 8 }} 85 | {{- end }} 86 | {{- with .Values.tolerations }} 87 | tolerations: 88 | {{- toYaml . | nindent 6 }} 89 | {{- end }} 90 | volumes: 91 | - name: loki-config 92 | configMap: 93 | name: local-config 94 | {{- with .Values.volumes }} 95 | {{- toYaml . | nindent 6 }} 96 | {{- end }} 97 | {{- range .Values.persistence }} 98 | - persistentVolumeClaim: 99 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 100 | name: {{ .name }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/table-manager/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | {{- with .Values.resources }} 58 | resources: 59 | {{- toYaml . | nindent 10 }} 60 | {{- end }} 61 | args: ["-target=table-manager", "-config.file=/etc/loki/local-config.yaml"] 62 | volumeMounts: 63 | - name: loki-config 64 | mountPath: /etc/loki/ 65 | readOnly: true 66 | {{- range .Values.persistence }} 67 | - name: {{ .name }} 68 | mountPath: {{ .mount_path }} 69 | {{- end }} 70 | {{- with .Values.livenessProbe }} 71 | livenessProbe: 72 | {{- toYaml . | nindent 10 }} 73 | {{- end }} 74 | {{- with .Values.readinessProbe }} 75 | readinessProbe: 76 | {{- toYaml . | nindent 10 }} 77 | {{- end }} 78 | {{- with .Values.nodeSelector }} 79 | nodeSelector: 80 | {{- toYaml . | nindent 8 }} 81 | {{- end }} 82 | {{- with .Values.affinity }} 83 | affinity: 84 | {{- toYaml . | nindent 8 }} 85 | {{- end }} 86 | {{- with .Values.tolerations }} 87 | tolerations: 88 | {{- toYaml . | nindent 6 }} 89 | {{- end }} 90 | volumes: 91 | - name: loki-config 92 | configMap: 93 | name: local-config 94 | {{- with .Values.volumes }} 95 | {{- toYaml . | nindent 6 }} 96 | {{- end }} 97 | {{- range .Values.persistence }} 98 | - persistentVolumeClaim: 99 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 100 | name: {{ .name }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-cassandra/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | env: 58 | - name: CASSANDRA_SEEDS 59 | value: "{{ .Values.fullnameOverride}}-0.{{ .Values.svcNameOverride }}.{{ .Release.Namespace }}.svc.cluster.local" 60 | - name: CASSANDRA_PASSWORD_SEEDER 61 | value: "yes" 62 | - name: CASSANDRA_PASSWORD 63 | value: "{{ .Values.cassandra_password }}" 64 | {{- with .Values.resources }} 65 | resources: 66 | {{- toYaml . | nindent 10 }} 67 | {{- end }} 68 | {{- range .Values.persistence }} 69 | volumeMounts: 70 | - name: {{ .name }} 71 | mountPath: {{ .mount_path }} 72 | {{- end }} 73 | {{- with .Values.livenessProbe }} 74 | livenessProbe: 75 | {{- toYaml . | nindent 10 }} 76 | {{- end }} 77 | {{- with .Values.readinessProbe }} 78 | readinessProbe: 79 | {{- toYaml . | nindent 10 }} 80 | {{- end }} 81 | {{- with .Values.nodeSelector }} 82 | nodeSelector: 83 | {{- toYaml . | nindent 8 }} 84 | {{- end }} 85 | {{- with .Values.affinity }} 86 | affinity: 87 | {{- toYaml . | nindent 8 }} 88 | {{- end }} 89 | {{- with .Values.tolerations }} 90 | tolerations: 91 | {{- toYaml . | nindent 6 }} 92 | {{- end }} 93 | volumes: 94 | {{- with .Values.volumes }} 95 | {{- toYaml . | nindent 6 }} 96 | {{- end }} 97 | {{- range .Values.persistence }} 98 | - persistentVolumeClaim: 99 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 100 | name: {{ .name }} 101 | {{- end }} 102 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-ruler/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: {{ .Values.replicaCount }} 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | {{- with .Values.resources }} 58 | resources: 59 | {{- toYaml . | nindent 10 }} 60 | {{- end }} 61 | args: ["-target=ruler", "-config.file=/etc/loki/local-config.yaml"] 62 | volumeMounts: 63 | - name: rules-config 64 | mountPath: /loki/rules/fake 65 | - name: loki-config 66 | mountPath: /etc/loki/ 67 | readOnly: true 68 | {{- range .Values.persistence }} 69 | - name: {{ .name }} 70 | mountPath: {{ .mount_path }} 71 | {{- end }} 72 | {{- with .Values.livenessProbe }} 73 | livenessProbe: 74 | {{- toYaml . | nindent 10 }} 75 | {{- end }} 76 | {{- with .Values.readinessProbe }} 77 | readinessProbe: 78 | {{- toYaml . | nindent 10 }} 79 | {{- end }} 80 | {{- with .Values.nodeSelector }} 81 | nodeSelector: 82 | {{- toYaml . | nindent 8 }} 83 | {{- end }} 84 | {{- with .Values.affinity }} 85 | affinity: 86 | {{- toYaml . | nindent 8 }} 87 | {{- end }} 88 | {{- with .Values.tolerations }} 89 | tolerations: 90 | {{- toYaml . | nindent 6 }} 91 | {{- end }} 92 | volumes: 93 | - name: rules-config 94 | configMap: 95 | name: rules.yaml 96 | - name: loki-config 97 | configMap: 98 | name: local-config 99 | {{- with .Values.volumes }} 100 | {{- toYaml . | nindent 6 }} 101 | {{- end }} 102 | {{- range .Values.persistence }} 103 | - persistentVolumeClaim: 104 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 105 | name: {{ .name }} 106 | {{- end }} 107 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/charts/loki-minio/templates/sts.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: apps/v1 3 | kind: StatefulSet 4 | metadata: 5 | name: {{ include "app.fullname" . }} 6 | namespace: {{ .Release.Namespace }} 7 | labels: 8 | {{ include "app.labels" . | indent 4 }} 9 | spec: 10 | replicas: 1 11 | serviceName: {{ .Values.svcNameOverride }} 12 | {{- with .Values.strategy }} 13 | strategy: 14 | {{- toYaml . | nindent 4 }} 15 | {{- end }} 16 | selector: 17 | matchLabels: 18 | app: {{ include "app.name" . }} 19 | app.instance: {{ .Release.Name }} 20 | template: 21 | metadata: 22 | labels: 23 | app: {{ include "app.name" . }} 24 | app.instance: {{ .Release.Name }} 25 | {{- if .Values.image.tag }} 26 | app.image.version: {{ .Values.image.tag | quote }} 27 | {{- end }} 28 | {{- if .Values.logColect }} 29 | log-collect: "true" 30 | {{- end }} 31 | annotations: 32 | {{- if .Values.istioInject }} 33 | sidecar.istio.io/inject: "true" 34 | {{- else }} 35 | sidecar.istio.io/inject: "false" 36 | {{- end }} 37 | {{- with .Values.podAnnotations }} 38 | {{- toYaml . | nindent 8 }} 39 | {{- end }} 40 | spec: 41 | {{- with .Values.imagePullSecrets }} 42 | imagePullSecrets: 43 | {{- toYaml . | nindent 6 }} 44 | {{- end }} 45 | containers: 46 | - name: {{ .Chart.Name }} 47 | image: {{ .Values.image.repository }}{{ if .Values.image.tag }}{{ printf ":%s" .Values.image.tag }}{{ end }} 48 | imagePullPolicy: {{ .Values.image.pullPolicy }} 49 | {{- with .Values.service }} 50 | ports: 51 | {{- range .ports }} 52 | - containerPort: {{ .targetPort }} 53 | name: {{ .name }} 54 | protocol: {{ .protocol }} 55 | {{- end }} 56 | {{- end}} 57 | env: 58 | - name: MINIO_ACCESS_KEY 59 | value: {{ .Values.access_key }} 60 | - name: MINIO_SECRET_KEY 61 | value: {{ .Values.secret_key }} 62 | {{- with .Values.resources }} 63 | resources: 64 | {{- toYaml . | nindent 10 }} 65 | {{- end }} 66 | {{- range .Values.persistence }} 67 | args: ["server", "{{ .mount_path }}"] 68 | volumeMounts: 69 | - name: {{ .name }} 70 | mountPath: {{ .mount_path }} 71 | {{- end }} 72 | {{- with .Values.livenessProbe }} 73 | livenessProbe: 74 | {{- toYaml . | nindent 10 }} 75 | {{- end }} 76 | {{- with .Values.readinessProbe }} 77 | readinessProbe: 78 | {{- toYaml . | nindent 10 }} 79 | {{- end }} 80 | initContainers: 81 | - image: busybox 82 | imagePullPolicy: IfNotPresent 83 | name: minio-init 84 | {{- range .Values.persistence }} 85 | command: ["mkdir", "-p", "{{ .mount_path }}/loki"] 86 | volumeMounts: 87 | - name: {{ .name }} 88 | mountPath: {{ .mount_path }} 89 | {{- end }} 90 | {{- with .Values.nodeSelector }} 91 | nodeSelector: 92 | {{- toYaml . | nindent 8 }} 93 | {{- end }} 94 | {{- with .Values.affinity }} 95 | affinity: 96 | {{- toYaml . | nindent 8 }} 97 | {{- end }} 98 | {{- with .Values.tolerations }} 99 | tolerations: 100 | {{- toYaml . | nindent 6 }} 101 | {{- end }} 102 | volumes: 103 | {{- with .Values.volumes }} 104 | {{- toYaml . | nindent 6 }} 105 | {{- end }} 106 | {{- range .Values.persistence }} 107 | - persistentVolumeClaim: 108 | claimName: {{ include "app.fullname" $root }}-{{ .name }} 109 | name: {{ .name }} 110 | {{- end }} 111 | -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/nginx.conf: -------------------------------------------------------------------------------- 1 | worker_processes 16; 2 | error_log /dev/stderr; 3 | pid /tmp/nginx.pid; 4 | worker_rlimit_nofile 8192; 5 | 6 | load_module modules/ngx_http_opentracing_module.so; 7 | 8 | events { 9 | worker_connections 4096; 10 | } 11 | 12 | http { 13 | # opentraing config 14 | opentracing on; 15 | opentracing_load_tracer /usr/local/lib/libjaegertracing_plugin.so /etc/jaeger-config.json; 16 | 17 | log_format opentracing '{"@timestamp":"$time_iso8601",' 18 | '"@source":"$server_addr",' 19 | '"hostname":"$hostname",' 20 | '"ip":"$http_x_forwarded_for",' 21 | '"traceID":"$opentracing_context_uber_trace_id",' 22 | '"client":"$remote_addr",' 23 | '"request_method":"$request_method",' 24 | '"scheme":"$scheme",' 25 | '"domain":"$server_name",' 26 | '"referer":"$http_referer",' 27 | '"request":"$request_uri",' 28 | '"args":"$args",' 29 | '"size":$body_bytes_sent,' 30 | '"status": $status,' 31 | '"responsetime":$request_time,' 32 | '"upstreamtime":"$upstream_response_time",' 33 | '"upstreamaddr":"$upstream_addr",' 34 | '"http_user_agent":"$http_user_agent",' 35 | '"https":"$https"' 36 | '}'; 37 | 38 | 39 | client_max_body_size 1024M; 40 | default_type application/octet-stream; 41 | resolver 127.0.0.11; 42 | access_log /var/log/nginx/trace.log opentracing; 43 | sendfile on; 44 | tcp_nopush on; 45 | 46 | server { 47 | listen 3100 default_server; 48 | 49 | location = / { 50 | opentracing_operation_name $uri; 51 | opentracing_trace_locations off; 52 | opentracing_propagate_context; 53 | proxy_pass http://querier:3100/ready; 54 | } 55 | 56 | location = /api/prom/push { 57 | opentracing_operation_name $uri; 58 | opentracing_trace_locations off; 59 | opentracing_propagate_context; 60 | proxy_pass http://distributor:3100$request_uri; 61 | } 62 | 63 | location = /api/prom/tail { 64 | opentracing_operation_name $uri; 65 | opentracing_trace_locations off; 66 | opentracing_propagate_context; 67 | proxy_pass http://querier:3100$request_uri; 68 | proxy_set_header Upgrade $http_upgrade; 69 | proxy_set_header Connection "upgrade"; 70 | } 71 | 72 | location ~ /api/prom/rules.* { 73 | opentracing_operation_name $uri; 74 | opentracing_trace_locations off; 75 | opentracing_propagate_context; 76 | proxy_pass http://ruler:3100$request_uri; 77 | } 78 | 79 | location ~ /api/prom/.* { 80 | opentracing_operation_name $uri; 81 | opentracing_trace_locations off; 82 | opentracing_propagate_context; 83 | proxy_pass http://querier-frontend:3100$request_uri; 84 | } 85 | 86 | location = /loki/api/v1/push { 87 | opentracing_operation_name $uri; 88 | opentracing_trace_locations off; 89 | opentracing_propagate_context; 90 | proxy_pass http://distributor:3100$request_uri; 91 | } 92 | 93 | location = /loki/api/v1/tail { 94 | opentracing_operation_name $uri; 95 | opentracing_trace_locations off; 96 | opentracing_propagate_context; 97 | proxy_pass http://querier:3100$request_uri; 98 | proxy_set_header Upgrade $http_upgrade; 99 | proxy_set_header Connection "upgrade"; 100 | } 101 | 102 | location ~ /loki/api/v1/rules.* { 103 | opentracing_operation_name $uri; 104 | opentracing_trace_locations off; 105 | opentracing_propagate_context; 106 | proxy_pass http://ruler:3100$request_uri; 107 | } 108 | 109 | location ~ /loki/api/.* { 110 | opentracing_operation_name $uri; 111 | opentracing_trace_locations off; 112 | opentracing_propagate_context; 113 | proxy_pass http://querier-frontend:3100$request_uri; 114 | } 115 | } 116 | } 117 | -------------------------------------------------------------------------------- /demo/docker-compose/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | services: 3 | consul: 4 | image: consul:1.7.8 5 | runtime: runc 6 | restart: always 7 | ports: 8 | - 8500:8500 9 | environment: 10 | - CONSUL_BIND_INTERFACE=eth0 11 | volumes: 12 | - 'consul_data:/consul/data' 13 | distributor: 14 | image: grafana/loki:2.0.0 15 | runtime: runc 16 | scale: 3 17 | volumes: 18 | - ./local-config.yaml:/etc/loki/local-config.yaml 19 | command: -target=distributor -config.file=/etc/loki/local-config.yaml 20 | depends_on: 21 | - cassandra 22 | - redis 23 | - minio 24 | - consul 25 | restart: always 26 | user: root 27 | ingester: 28 | image: grafana/loki:2.0.0 29 | runtime: runc 30 | scale: 3 31 | volumes: 32 | - ./local-config.yaml:/etc/loki/local-config.yaml 33 | command: -target=ingester -config.file=/etc/loki/local-config.yaml -log.level=debug 34 | depends_on: 35 | - cassandra 36 | - redis 37 | - minio 38 | - consul 39 | restart: always 40 | user: root 41 | querier-frontend: 42 | image: grafana/loki:2.0.0 43 | runtime: runc 44 | scale: 2 45 | volumes: 46 | - ./local-config.yaml:/etc/loki/local-config.yaml 47 | command: -target=query-frontend -config.file=/etc/loki/local-config.yaml 48 | depends_on: 49 | - cassandra 50 | - redis 51 | - minio 52 | - consul 53 | restart: always 54 | user: root 55 | querier: 56 | image: grafana/loki:2.0.0 57 | runtime: runc 58 | scale: 3 59 | volumes: 60 | - ./local-config.yaml:/etc/loki/local-config.yaml 61 | command: -target=querier -config.file=/etc/loki/local-config.yaml 62 | depends_on: 63 | - cassandra 64 | - redis 65 | - minio 66 | - consul 67 | restart: always 68 | user: root 69 | table-manager: 70 | image: grafana/loki:2.0.0 71 | runtime: runc 72 | volumes: 73 | - ./local-config.yaml:/etc/loki/local-config.yaml 74 | command: -target=table-manager -config.file=/etc/loki/local-config.yaml 75 | depends_on: 76 | - cassandra 77 | - redis 78 | - minio 79 | - consul 80 | restart: always 81 | user: root 82 | ruler: 83 | image: grafana/loki:2.0.0 84 | runtime: runc 85 | volumes: 86 | - ./local-config.yaml:/etc/loki/local-config.yaml 87 | - 'minio_data:/data' 88 | command: -target=ruler -config.file=/etc/loki/local-config.yaml —log.level=debug 89 | depends_on: 90 | - cassandra 91 | - redis 92 | - minio 93 | - consul 94 | - querier 95 | - distributor 96 | - ingester 97 | - querier-frontend 98 | - gateway 99 | restart: always 100 | user: root 101 | cassandra: 102 | image: bitnami/cassandra:3-debian-10 103 | runtime: runc 104 | volumes: 105 | - 'cassandra_data:/bitnami' 106 | environment: 107 | - CASSANDRA_SEEDS=cassandra 108 | - CASSANDRA_PASSWORD_SEEDER=yes 109 | - CASSANDRA_PASSWORD=cassandra 110 | redis: 111 | image: redis:5.0.6-alpine 112 | runtime: runc 113 | restart: always 114 | command: /etc/redis.conf 115 | volumes: 116 | - ./redis.conf:/etc/redis.conf:ro 117 | depends_on: 118 | - cassandra 119 | - minio 120 | - consul 121 | minio: 122 | image: minio/minio:RELEASE.2020-09-21T22-31-59Z 123 | runtime: runc 124 | restart: always 125 | ports: 126 | - 9000:9000 127 | environment: 128 | - MINIO_ACCESS_KEY=key123456 129 | - MINIO_SECRET_KEY=password123456 130 | volumes: 131 | - 'minio_data:/data:rw' 132 | command: server /data 133 | depends_on: 134 | - minio-init 135 | gateway: 136 | image: nginx:1.15.1-alpine 137 | runtime: runc 138 | container_name: gateway 139 | restart: always 140 | ports: 141 | - 3100:3100 142 | volumes: 143 | - ./nginx.conf:/etc/nginx/nginx.conf 144 | depends_on: 145 | - querier 146 | - querier-frontend 147 | - distributor 148 | - ingester 149 | - consul 150 | - table-manager 151 | minio-init: 152 | image: busybox 153 | runtime: runc 154 | command: mkdir -p /data/loki && mkdir -p /data/rules/fake 155 | volumes: 156 | - 'minio_data:/data:rw' 157 | volumes: 158 | cassandra_data: 159 | driver: local 160 | consul_data: 161 | driver: local 162 | minio_data: 163 | driver: local 164 | -------------------------------------------------------------------------------- /demo/docker-compose/local-config.yaml: -------------------------------------------------------------------------------- 1 | auth_enabled: false 2 | chunk_store_config: 3 | chunk_cache_config: 4 | redis: 5 | endpoint: redis:6379 6 | expiration: 1h 7 | max_look_back_period: 0 8 | write_dedupe_cache_config: 9 | redis: 10 | endpoint: redis:6379 11 | expiration: 1h 12 | distributor: 13 | ring: 14 | kvstore: 15 | consul: 16 | consistent_reads: false 17 | host: consul:8500 18 | http_client_timeout: 20s 19 | watch_burst_size: 1 20 | watch_rate_limit: 1 21 | store: consul 22 | frontend: 23 | compress_responses: true 24 | max_outstanding_per_tenant: 200 25 | downstream_url: http://querier:3100 26 | frontend_worker: 27 | frontend_address: querier-frontend:9095 28 | grpc_client_config: 29 | max_send_msg_size: 20971520 30 | parallelism: 10 31 | ingester: 32 | chunk_block_size: 262144 33 | chunk_idle_period: 30m 34 | chunk_target_size: 0 35 | max_chunk_age: 1h 36 | lifecycler: 37 | heartbeat_period: 5s 38 | interface_names: 39 | - eth0 40 | join_after: 30s 41 | num_tokens: 512 42 | ring: 43 | heartbeat_timeout: 1m 44 | kvstore: 45 | consul: 46 | consistent_reads: true 47 | host: consul:8500 48 | http_client_timeout: 20s 49 | store: consul 50 | replication_factor: 2 51 | max_transfer_retries: 10 52 | ingester_client: 53 | grpc_client_config: 54 | max_recv_msg_size: 20971520 55 | remote_timeout: 1s 56 | limits_config: 57 | enforce_metric_name: false 58 | ingestion_burst_size_mb: 100 59 | ingestion_rate_mb: 10 60 | ingestion_rate_strategy: global 61 | max_global_streams_per_user: 10000 62 | max_entries_limit_per_query: 10000 63 | max_query_length: 12000h 64 | max_query_parallelism: 32 65 | max_streams_per_user: 0 66 | reject_old_samples: true 67 | reject_old_samples_max_age: 168h 68 | query_range: 69 | align_queries_with_step: true 70 | cache_results: true 71 | max_retries: 5 72 | results_cache: 73 | cache: 74 | redis: 75 | endpoint: redis:6379 76 | expiration: 1h 77 | #max_freshness: 10m 78 | split_queries_by_interval: 6h 79 | schema_config: 80 | configs: 81 | - from: 2020-09-20 82 | store: cassandra 83 | object_store: aws 84 | schema: v11 85 | index: 86 | prefix: index_ 87 | period: 720h 88 | chunks: 89 | prefix: chunks_ 90 | period: 720h 91 | server: 92 | graceful_shutdown_timeout: 5s 93 | grpc_server_max_concurrent_streams: 0 94 | grpc_server_max_recv_msg_size: 100000000 95 | grpc_server_max_send_msg_size: 100000000 96 | http_listen_port: 3100 97 | http_server_idle_timeout: 120s 98 | http_server_write_timeout: 1m 99 | storage_config: 100 | cassandra: 101 | username: cassandra 102 | password: cassandra 103 | addresses: cassandra 104 | auth: true 105 | keyspace: lokiindex 106 | consistency: LOCAL_ONE 107 | 108 | aws: 109 | s3: s3://key123456:password123456@minio.:9000/loki 110 | s3forcepathstyle: true 111 | 112 | index_queries_cache_config: 113 | redis: 114 | endpoint: redis:6379 115 | expiration: 1h 116 | table_manager: 117 | chunk_tables_provisioning: 118 | inactive_read_throughput: 0 119 | inactive_write_throughput: 0 120 | provisioned_read_throughput: 0 121 | provisioned_write_throughput: 0 122 | index_tables_provisioning: 123 | inactive_read_throughput: 0 124 | inactive_write_throughput: 0 125 | provisioned_read_throughput: 0 126 | provisioned_write_throughput: 0 127 | retention_deletes_enabled: false 128 | retention_period: 0 129 | ruler: 130 | storage: 131 | type: local 132 | local: 133 | directory: /data/rules/ 134 | ring: 135 | kvstore: 136 | consul: 137 | host: consul:8500 138 | store: consul 139 | rule_path: /tmp/scratch 140 | enable_api: true 141 | enable_sharding: true 142 | enable_alertmanager_v2: true 143 | alertmanager_url: "http://127.0.0.1:9093" 144 | -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/local-config.yaml: -------------------------------------------------------------------------------- 1 | auth_enabled: false 2 | chunk_store_config: 3 | chunk_cache_config: 4 | redis: 5 | endpoint: redis:6379 6 | expiration: 1h 7 | max_look_back_period: 0 8 | write_dedupe_cache_config: 9 | redis: 10 | endpoint: redis:6379 11 | expiration: 1h 12 | distributor: 13 | ring: 14 | kvstore: 15 | consul: 16 | consistent_reads: false 17 | host: consul:8500 18 | http_client_timeout: 20s 19 | watch_burst_size: 1 20 | watch_rate_limit: 1 21 | store: consul 22 | frontend: 23 | compress_responses: true 24 | max_outstanding_per_tenant: 200 25 | downstream_url: http://querier:3100 26 | frontend_worker: 27 | frontend_address: querier-frontend:9095 28 | grpc_client_config: 29 | max_send_msg_size: 20971520 30 | parallelism: 10 31 | ingester: 32 | chunk_block_size: 262144 33 | chunk_idle_period: 30m 34 | chunk_target_size: 0 35 | max_chunk_age: 1h 36 | lifecycler: 37 | heartbeat_period: 5s 38 | interface_names: 39 | - eth0 40 | join_after: 30s 41 | num_tokens: 512 42 | ring: 43 | heartbeat_timeout: 1m 44 | kvstore: 45 | consul: 46 | consistent_reads: true 47 | host: consul:8500 48 | http_client_timeout: 20s 49 | store: consul 50 | replication_factor: 2 51 | max_transfer_retries: 10 52 | ingester_client: 53 | grpc_client_config: 54 | max_recv_msg_size: 20971520 55 | remote_timeout: 1s 56 | limits_config: 57 | enforce_metric_name: false 58 | ingestion_burst_size_mb: 100 59 | ingestion_rate_mb: 10 60 | ingestion_rate_strategy: global 61 | max_global_streams_per_user: 10000 62 | max_entries_limit_per_query: 10000 63 | max_query_length: 12000h 64 | max_query_parallelism: 32 65 | max_streams_per_user: 0 66 | reject_old_samples: true 67 | reject_old_samples_max_age: 168h 68 | query_range: 69 | align_queries_with_step: true 70 | cache_results: true 71 | max_retries: 5 72 | results_cache: 73 | cache: 74 | redis: 75 | endpoint: redis:6379 76 | expiration: 1h 77 | #max_freshness: 10m 78 | split_queries_by_interval: 6h 79 | schema_config: 80 | configs: 81 | - from: 2020-09-20 82 | store: cassandra 83 | object_store: aws 84 | schema: v11 85 | index: 86 | prefix: index_ 87 | period: 720h 88 | chunks: 89 | prefix: chunks_ 90 | period: 720h 91 | server: 92 | graceful_shutdown_timeout: 5s 93 | grpc_server_max_concurrent_streams: 0 94 | grpc_server_max_recv_msg_size: 100000000 95 | grpc_server_max_send_msg_size: 100000000 96 | http_listen_port: 3100 97 | http_server_idle_timeout: 120s 98 | http_server_write_timeout: 1m 99 | storage_config: 100 | cassandra: 101 | username: cassandra 102 | password: cassandra 103 | addresses: cassandra 104 | auth: true 105 | keyspace: lokiindex 106 | consistency: LOCAL_ONE 107 | 108 | aws: 109 | s3: s3://key123456:password123456@minio.:9000/loki 110 | s3forcepathstyle: true 111 | 112 | index_queries_cache_config: 113 | redis: 114 | endpoint: redis:6379 115 | expiration: 1h 116 | table_manager: 117 | chunk_tables_provisioning: 118 | inactive_read_throughput: 0 119 | inactive_write_throughput: 0 120 | provisioned_read_throughput: 0 121 | provisioned_write_throughput: 0 122 | index_tables_provisioning: 123 | inactive_read_throughput: 0 124 | inactive_write_throughput: 0 125 | provisioned_read_throughput: 0 126 | provisioned_write_throughput: 0 127 | retention_deletes_enabled: false 128 | retention_period: 0 129 | #ruler: 130 | # storage: 131 | # type: local 132 | # local: 133 | # directory: /loki/rules 134 | # ring: 135 | # kvstore: 136 | # consul: 137 | # host: consul:8500 138 | # store: consul 139 | # rule_path: /tmp/rules 140 | # enable_api: true 141 | # enable_sharding: true 142 | # enable_alertmanager_v2: true 143 | # alertmanager_url: "http://172.16.31.9:9093" 144 | -------------------------------------------------------------------------------- /production/loki-system/loki-system/configmap.yaml: -------------------------------------------------------------------------------- 1 | apiVersion: v1 2 | kind: ConfigMap 3 | metadata: 4 | namespace: loki 5 | labels: 6 | app.kubernetes.io/name: loki-system 7 | name: loki-local-config 8 | data: 9 | local-config.yaml: |- 10 | auth_enabled: false 11 | 12 | server: 13 | http_listen_port: 3100 14 | http_listen_address: 0.0.0.0 15 | grpc_listen_port: 9095 16 | grpc_listen_address: 0.0.0.0 17 | grpc_server_max_recv_msg_size: 10000000 18 | grpc_server_max_send_msg_size: 10000000 19 | grpc_server_max_concurrent_streams: 0 20 | 21 | memberlist: 22 | join_members: ["loki-system-0.loki-system-headless.loki.svc.cluster.local", "loki-system-1.loki-system-headless.loki.svc.cluster.local", "loki-system-2.loki-system-headless.loki.svc.cluster.local"] 23 | dead_node_reclaim_time: 30s 24 | gossip_to_dead_nodes_time: 15s 25 | left_ingesters_timeout: 30s 26 | bind_addr: ['0.0.0.0'] 27 | bind_port: 7946 28 | 29 | querier: 30 | query_ingesters_within: 2h 31 | 32 | frontend: 33 | compress_responses: true 34 | log_queries_longer_than: 5s 35 | downstream_url: http://loki-system:3100 36 | 37 | query_range: 38 | split_queries_by_interval: 24h 39 | align_queries_with_step: true 40 | max_retries: 5 41 | results_cache: 42 | cache: 43 | redis: 44 | endpoint: loki-redis-0.loki-redis.loki.svc.cluster.local:6379 45 | expiration: 1h 46 | cache_results: true 47 | 48 | ingester: 49 | lifecycler: 50 | join_after: 60s 51 | observe_period: 5s 52 | ring: 53 | replication_factor: 2 54 | kvstore: 55 | store: memberlist 56 | final_sleep: 0s 57 | chunk_idle_period: 1h 58 | max_chunk_age: 1h 59 | chunk_retain_period: 1m 60 | max_transfer_retries: 1 61 | chunk_encoding: snappy 62 | chunk_target_size: 0 63 | chunk_block_size: 262144 64 | 65 | ingester_client: 66 | grpc_client_config: 67 | max_recv_msg_size: 20971520 68 | remote_timeout: 1s 69 | 70 | schema_config: 71 | configs: 72 | - from: 2021-04-25 73 | store: boltdb-shipper 74 | object_store: aws 75 | schema: v11 76 | index: 77 | prefix: index_ 78 | period: 24h 79 | 80 | storage_config: 81 | boltdb_shipper: 82 | shared_store: aws 83 | active_index_directory: /loki/index 84 | cache_location: /loki/boltdb-cache 85 | 86 | aws: 87 | s3: s3://__S3_ACCESS_KEY__:__S3_SECRET_KEY__@__S3_HOST__/logchunks 88 | s3forcepathstyle: true 89 | insecure: true 90 | 91 | index_queries_cache_config: 92 | redis: 93 | endpoint: loki-redis-0.loki-redis.loki.svc.cluster.local:6379 94 | expiration: 1h 95 | 96 | chunk_store_config: 97 | chunk_cache_config: 98 | redis: 99 | endpoint: loki-redis-0.loki-redis.loki.svc.cluster.local:6379 100 | expiration: 1h 101 | max_look_back_period: 0 102 | write_dedupe_cache_config: 103 | redis: 104 | endpoint: loki-redis-0.loki-redis.loki.svc.cluster.local:6379 105 | expiration: 1h 106 | 107 | limits_config: 108 | enforce_metric_name: false 109 | reject_old_samples: true 110 | reject_old_samples_max_age: 168h 111 | ingestion_rate_mb: 64 112 | ingestion_burst_size_mb: 128 113 | max_entries_limit_per_query: 50000 114 | 115 | ruler: 116 | storage: 117 | type: s3 118 | s3: 119 | s3: s3://__S3_ACCESS_KEY__:__S3_SECRET_KEY__@__S3_HOST__/logrules 120 | s3forcepathstyle: true 121 | insecure: true 122 | http_config: 123 | insecure_skip_verify: true 124 | enable_api: true 125 | enable_alertmanager_v2: true 126 | alertmanager_url: "http://" 127 | ring: 128 | kvstore: 129 | store: inmemory 130 | 131 | table_manager: 132 | chunk_tables_provisioning: 133 | inactive_read_throughput: 0 134 | inactive_write_throughput: 0 135 | provisioned_read_throughput: 0 136 | provisioned_write_throughput: 0 137 | index_tables_provisioning: 138 | inactive_read_throughput: 0 139 | inactive_write_throughput: 0 140 | provisioned_read_throughput: 0 141 | provisioned_write_throughput: 0 142 | retention_deletes_enabled: false 143 | retention_period: 0 -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/values.yaml: -------------------------------------------------------------------------------- 1 | global: 2 | name: loki-cluster-demo 3 | 4 | configmaps: 5 | - redis.conf 6 | - rules.yaml 7 | 8 | loki-minio: 9 | svcNameOverride: loki-minio 10 | nameOverride: loki-minio 11 | fullnameOverride: loki-minio 12 | access_key: key123456 13 | secret_key: password123456 14 | image: 15 | repository: minio/minio:RELEASE.2020-09-21T22-31-59Z 16 | pullPolicy: IfNotPresent 17 | resources: 18 | requests: 19 | cpu: "200m" 20 | memory: "256Mi" 21 | limits: 22 | cpu: "1" 23 | memory: "1Gi" 24 | persistence: 25 | - name: data 26 | storageClass: "local-path" 27 | size: 10Gi 28 | accessMode: ReadWriteOnce 29 | mount_path: /data 30 | 31 | loki-consul: 32 | svcNameOverride: loki-consul 33 | nameOverride: loki-consul 34 | fullnameOverride: loki-consul 35 | CONSUL_BIND_INTERFACE: eth0 36 | image: 37 | repository: consul:1.7.8 38 | pullPolicy: IfNotPresent 39 | resources: 40 | requests: 41 | cpu: "200m" 42 | memory: "256Mi" 43 | limits: 44 | cpu: "1" 45 | memory: "1Gi" 46 | persistence: 47 | - name: data 48 | storageClass: "local-path" 49 | size: 1Gi 50 | accessMode: ReadWriteOnce 51 | mount_path: /consul/data 52 | 53 | loki-cassandra: 54 | svcNameOverride: loki-cassandra 55 | nameOverride: loki-cassandra 56 | fullnameOverride: loki-cassandra 57 | cassandra_password: cassandra 58 | image: 59 | repository: bitnami/cassandra:3-debian-10 60 | pullPolicy: IfNotPresent 61 | resources: 62 | requests: 63 | cpu: "500m" 64 | memory: "8Gi" 65 | limits: 66 | cpu: "1" 67 | memory: "10Gi" 68 | persistence: 69 | - name: data 70 | storageClass: "local-path" 71 | size: 5Gi 72 | accessMode: ReadWriteOnce 73 | mount_path: /bitnami 74 | 75 | loki-redis: 76 | svcNameOverride: loki-redis 77 | nameOverride: loki-redis 78 | fullnameOverride: loki-redis 79 | image: 80 | repository: redis:5.0.6-alpine 81 | pullPolicy: IfNotPresent 82 | resources: 83 | requests: 84 | cpu: "200m" 85 | memory: "2Gi" 86 | limits: 87 | cpu: "1" 88 | memory: "4Gi" 89 | 90 | loki-querier: 91 | replicaCount: 3 92 | svcNameOverride: loki-querier 93 | nameOverride: loki-querier 94 | fullnameOverride: loki-querier 95 | image: 96 | repository: grafana/loki:latest 97 | pullPolicy: IfNotPresent 98 | resources: 99 | requests: 100 | cpu: "200m" 101 | memory: "256Mi" 102 | limits: 103 | cpu: "1" 104 | memory: "1Gi" 105 | 106 | loki-querier-frontend: 107 | replicaCount: 2 108 | svcNameOverride: loki-querier-frontend 109 | nameOverride: loki-querier-frontend 110 | fullnameOverride: loki-querier-frontend 111 | image: 112 | repository: grafana/loki:latest 113 | pullPolicy: IfNotPresent 114 | resources: 115 | requests: 116 | cpu: "200m" 117 | memory: "256Mi" 118 | limits: 119 | cpu: "1" 120 | memory: "1Gi" 121 | 122 | loki-distributor: 123 | replicaCount: 3 124 | svcNameOverride: loki-distributor 125 | nameOverride: loki-distributor 126 | fullnameOverride: loki-distributor 127 | image: 128 | repository: grafana/loki:latest 129 | pullPolicy: IfNotPresent 130 | resources: 131 | requests: 132 | cpu: "200m" 133 | memory: "256Mi" 134 | limits: 135 | cpu: "1" 136 | memory: "1Gi" 137 | 138 | loki-ingester: 139 | replicaCount: 3 140 | svcNameOverride: loki-ingester 141 | nameOverride: loki-ingester 142 | fullnameOverride: loki-ingester 143 | image: 144 | repository: grafana/loki:latest 145 | pullPolicy: IfNotPresent 146 | resources: 147 | requests: 148 | cpu: "200m" 149 | memory: "256Mi" 150 | limits: 151 | cpu: "1" 152 | memory: "1Gi" 153 | 154 | table-manager: 155 | replicaCount: 1 156 | svcNameOverride: table-manager 157 | nameOverride: table-manager 158 | fullnameOverride: table-manager 159 | image: 160 | repository: grafana/loki:latest 161 | pullPolicy: IfNotPresent 162 | resources: 163 | requests: 164 | cpu: "200m" 165 | memory: "256Mi" 166 | limits: 167 | cpu: "1" 168 | memory: "1Gi" 169 | 170 | loki-gateway: 171 | replicaCount: 2 172 | svcNameOverride: loki-gateway 173 | nameOverride: loki-gateway 174 | fullnameOverride: loki-gateway 175 | image: 176 | repository: nginx:1.15.1-alpine 177 | pullPolicy: IfNotPresent 178 | resources: 179 | requests: 180 | cpu: "200m" 181 | memory: "256Mi" 182 | limits: 183 | cpu: "1" 184 | memory: "2Gi" 185 | loki-ruler: 186 | replicaCount: 1 187 | svcNameOverride: loki-ruler 188 | nameOverride: loki-ruler 189 | fullnameOverride: loki-ruler 190 | image: 191 | repository: grafana/loki:latest 192 | pullPolicy: IfNotPresent 193 | resources: 194 | requests: 195 | cpu: "200m" 196 | memory: "256Mi" 197 | limits: 198 | cpu: "1" 199 | memory: "1Gi" 200 | 201 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/templates/local-config.yaml: -------------------------------------------------------------------------------- 1 | {{- $root := . -}} 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | namespace: {{ $root.Release.Namespace }} 6 | labels: 7 | {{ include "simple.labels" $root | indent 4 }} 8 | name: local-config 9 | data: 10 | local-config.yaml: | 11 | auth_enabled: false 12 | chunk_store_config: 13 | chunk_cache_config: 14 | redis: 15 | endpoint: {{ index .Values "loki-redis" "svcNameOverride" }}:6379 16 | expiration: 1h 17 | max_look_back_period: 0 18 | write_dedupe_cache_config: 19 | redis: 20 | endpoint: {{ index .Values "loki-redis" "svcNameOverride" }}:6379 21 | expiration: 1h 22 | distributor: 23 | ring: 24 | kvstore: 25 | consul: 26 | consistent_reads: false 27 | host: {{ index .Values "loki-consul" "svcNameOverride" }}:8500 28 | http_client_timeout: 20s 29 | watch_burst_size: 1 30 | watch_rate_limit: 1 31 | store: consul 32 | frontend: 33 | compress_responses: true 34 | max_outstanding_per_tenant: 200 35 | downstream_url: http://{{ index .Values "loki-querier" "svcNameOverride" }}:3100 36 | frontend_worker: 37 | frontend_address: {{ index .Values "loki-querier-frontend" "svcNameOverride" }}:9095 38 | grpc_client_config: 39 | max_send_msg_size: 20971520 40 | parallelism: 20 41 | ingester: 42 | chunk_block_size: 262144 43 | chunk_idle_period: 30m 44 | chunk_target_size: 0 45 | max_chunk_age: 1h 46 | lifecycler: 47 | heartbeat_period: 5s 48 | interface_names: 49 | - eth0 50 | join_after: 30s 51 | num_tokens: 512 52 | ring: 53 | heartbeat_timeout: 1m 54 | kvstore: 55 | consul: 56 | consistent_reads: true 57 | host: {{ index .Values "loki-consul" "svcNameOverride" }}:8500 58 | http_client_timeout: 20s 59 | store: consul 60 | replication_factor: 2 61 | max_transfer_retries: 10 62 | ingester_client: 63 | grpc_client_config: 64 | max_recv_msg_size: 20971520 65 | remote_timeout: 1s 66 | limits_config: 67 | enforce_metric_name: false 68 | ingestion_burst_size_mb: 100 69 | ingestion_rate_mb: 10 70 | ingestion_rate_strategy: global 71 | max_global_streams_per_user: 10000 72 | max_entries_limit_per_query: 10000 73 | max_query_length: 12000h 74 | max_query_parallelism: 32 75 | max_streams_per_user: 0 76 | reject_old_samples: true 77 | reject_old_samples_max_age: 168h 78 | query_range: 79 | align_queries_with_step: true 80 | cache_results: true 81 | max_retries: 5 82 | results_cache: 83 | cache: 84 | redis: 85 | endpoint: {{ index .Values "loki-redis" "svcNameOverride" }}:6379 86 | expiration: 1h 87 | #max_freshness: 10m 88 | split_queries_by_interval: 2h 89 | schema_config: 90 | configs: 91 | - from: 2020-09-20 92 | store: cassandra 93 | object_store: aws 94 | schema: v11 95 | index: 96 | prefix: index_ 97 | period: 720h 98 | chunks: 99 | prefix: chunks_ 100 | period: 720h 101 | server: 102 | graceful_shutdown_timeout: 5s 103 | grpc_server_max_concurrent_streams: 0 104 | grpc_server_max_recv_msg_size: 100000000 105 | grpc_server_max_send_msg_size: 100000000 106 | http_listen_port: 3100 107 | http_server_idle_timeout: 120s 108 | http_server_write_timeout: 1m 109 | storage_config: 110 | cassandra: 111 | username: cassandra 112 | password: cassandra 113 | addresses: {{ index .Values "loki-cassandra" "svcNameOverride" }} 114 | auth: true 115 | keyspace: lokiindex 116 | 117 | aws: 118 | s3: s3://{{ index .Values "loki-minio" "access_key" }}:{{ index .Values "loki-minio" "secret_key" }}@{{ index .Values "loki-minio" "svcNameOverride" }}.{{ $root.Release.Namespace }}.svc.cluster.local.:9000/loki 119 | s3forcepathstyle: true 120 | 121 | index_queries_cache_config: 122 | redis: 123 | endpoint: {{ index .Values "loki-redis" "svcNameOverride" }}:6379 124 | expiration: 1h 125 | table_manager: 126 | chunk_tables_provisioning: 127 | inactive_read_throughput: 0 128 | inactive_write_throughput: 0 129 | provisioned_read_throughput: 0 130 | provisioned_write_throughput: 0 131 | index_tables_provisioning: 132 | inactive_read_throughput: 0 133 | inactive_write_throughput: 0 134 | provisioned_read_throughput: 0 135 | provisioned_write_throughput: 0 136 | retention_deletes_enabled: false 137 | retention_period: 0 138 | -------------------------------------------------------------------------------- /demo/docker-compose-with-tempo/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: "2.4" 2 | services: 3 | consul: 4 | image: consul:1.7.8 5 | runtime: runc 6 | restart: always 7 | ports: 8 | - 8500:8500 9 | environment: 10 | - CONSUL_BIND_INTERFACE=eth0 11 | volumes: 12 | - 'consul_data:/consul/data' 13 | 14 | distributor: 15 | image: grafana/loki:2.0.0 16 | runtime: runc 17 | scale: 3 18 | environment: 19 | - JAEGER_AGENT_HOST=tempo 20 | - JAEGER_ENDPOINT=http://tempo:14268/api/traces 21 | - JAEGER_SAMPLER_TYPE=const 22 | - JAEGER_SAMPLER_PARAM=100 23 | volumes: 24 | - ./local-config.yaml:/etc/loki/local-config.yaml 25 | command: -target=distributor -config.file=/etc/loki/local-config.yaml 26 | depends_on: 27 | - cassandra 28 | - redis 29 | - minio 30 | - consul 31 | restart: always 32 | user: root 33 | 34 | ingester: 35 | image: grafana/loki:2.0.0 36 | runtime: runc 37 | scale: 3 38 | environment: 39 | - JAEGER_AGENT_HOST=tempo 40 | - JAEGER_ENDPOINT=http://tempo:14268/api/traces 41 | - JAEGER_SAMPLER_TYPE=const 42 | - JAEGER_SAMPLER_PARAM=100 43 | volumes: 44 | - ./local-config.yaml:/etc/loki/local-config.yaml 45 | command: -target=ingester -config.file=/etc/loki/local-config.yaml -log.level=debug 46 | depends_on: 47 | - cassandra 48 | - redis 49 | - minio 50 | - consul 51 | restart: always 52 | user: root 53 | 54 | querier-frontend: 55 | image: grafana/loki:2.0.0 56 | runtime: runc 57 | scale: 2 58 | environment: 59 | - JAEGER_AGENT_HOST=tempo 60 | - JAEGER_ENDPOINT=http://tempo:14268/api/traces 61 | - JAEGER_SAMPLER_TYPE=const 62 | - JAEGER_SAMPLER_PARAM=100 63 | volumes: 64 | - ./local-config.yaml:/etc/loki/local-config.yaml 65 | command: -target=query-frontend -config.file=/etc/loki/local-config.yaml 66 | depends_on: 67 | - cassandra 68 | - redis 69 | - minio 70 | - consul 71 | restart: always 72 | user: root 73 | 74 | querier: 75 | image: grafana/loki:2.0.0 76 | runtime: runc 77 | scale: 3 78 | environment: 79 | - JAEGER_AGENT_HOST=tempo 80 | - JAEGER_ENDPOINT=http://tempo:14268/api/traces 81 | - JAEGER_SAMPLER_TYPE=const 82 | - JAEGER_SAMPLER_PARAM=100 83 | volumes: 84 | - ./local-config.yaml:/etc/loki/local-config.yaml 85 | command: -target=querier -config.file=/etc/loki/local-config.yaml 86 | depends_on: 87 | - cassandra 88 | - redis 89 | - minio 90 | - consul 91 | restart: always 92 | user: root 93 | 94 | table-manager: 95 | image: grafana/loki:2.0.0 96 | runtime: runc 97 | environment: 98 | - JAEGER_AGENT_HOST=tempo 99 | - JAEGER_ENDPOINT=http://tempo:14268/api/traces 100 | - JAEGER_SAMPLER_TYPE=const 101 | - JAEGER_SAMPLER_PARAM=100 102 | volumes: 103 | - ./local-config.yaml:/etc/loki/local-config.yaml 104 | command: -target=table-manager -config.file=/etc/loki/local-config.yaml 105 | depends_on: 106 | - cassandra 107 | - redis 108 | - minio 109 | - consul 110 | restart: always 111 | user: root 112 | 113 | cassandra: 114 | image: bitnami/cassandra:3-debian-10 115 | runtime: runc 116 | volumes: 117 | - 'cassandra_data:/bitnami' 118 | environment: 119 | - CASSANDRA_SEEDS=cassandra 120 | - CASSANDRA_PASSWORD_SEEDER=yes 121 | - CASSANDRA_PASSWORD=cassandra 122 | 123 | redis: 124 | image: redis:5.0.6-alpine 125 | runtime: runc 126 | restart: always 127 | command: /etc/redis.conf 128 | volumes: 129 | - ./redis.conf:/etc/redis.conf:ro 130 | depends_on: 131 | - cassandra 132 | - minio 133 | - consul 134 | 135 | minio: 136 | image: minio/minio:RELEASE.2020-09-21T22-31-59Z 137 | runtime: runc 138 | restart: always 139 | ports: 140 | - 9000:9000 141 | environment: 142 | - MINIO_ACCESS_KEY=key123456 143 | - MINIO_SECRET_KEY=password123456 144 | volumes: 145 | - 'minio_data:/data:rw' 146 | command: server /data 147 | depends_on: 148 | - minio-init 149 | 150 | gateway: 151 | image: quay.io/cloudxiaobai/nginx-jaeger:1.14.0 152 | runtime: runc 153 | restart: always 154 | ports: 155 | - 3100:3100 156 | volumes: 157 | - ./nginx.conf:/etc/nginx/nginx.conf 158 | - ./jaeger-config.json:/etc/jaeger-config.json 159 | - 'gateway_trace_log:/var/log/nginx/' 160 | 161 | minio-init: 162 | image: busybox 163 | runtime: runc 164 | command: mkdir -p /data/loki && mkdir -p /data/tempo 165 | volumes: 166 | - 'minio_data:/data:rw' 167 | 168 | jaeger-agent: 169 | image: jaegertracing/jaeger-agent:1.20 170 | runtime: runc 171 | restart: always 172 | command: ["--reporter.grpc.host-port=tempo:14250"] 173 | ports: 174 | - "5775:5775/udp" 175 | - "6831:6831/udp" 176 | - "6832:6832/udp" 177 | - "5778:5778" 178 | 179 | tempo: 180 | image: grafana/tempo:latest 181 | command: 182 | - "-storage.trace.backend=local" 183 | - "-storage.trace.local.path=/tmp/tempo/traces" 184 | - "-storage.trace.wal.path=/tmp/tempo/wal" 185 | - "-auth.enabled=false" 186 | - "-server.http-listen-port=3100" 187 | volumes: 188 | - ./tempo/tempo.yaml:/etc/tempo.yaml 189 | - 'tempo_data:/tmp/tempo' 190 | ports: 191 | - "14268" 192 | - "14250" 193 | depends_on: 194 | - minio 195 | 196 | tempo-query: 197 | image: grafana/tempo-query:latest 198 | command: ["--grpc-storage-plugin.configuration-file=/etc/tempo-query.yaml"] 199 | volumes: 200 | - ./tempo/tempo-query.yaml:/etc/tempo-query.yaml 201 | ports: 202 | - "16686:16686" 203 | depends_on: 204 | - minio 205 | - tempo 206 | 207 | grafana: 208 | image: grafana/grafana:7.3.0-beta1 209 | environment: 210 | - GF_AUTH_ANONYMOUS_ENABLED=true 211 | - GF_AUTH_ANONYMOUS_ORG_ROLE=Admin 212 | - GF_AUTH_DISABLE_LOGIN_FORM=true 213 | ports: 214 | - "3000:3000" 215 | 216 | promtail: 217 | image: grafana/promtail 218 | restart: always 219 | volumes: 220 | - ./promtail-config.yaml:/etc/promtail/config.yml 221 | - /var/log:/var/log 222 | - 'gateway_trace_log:/trace/' 223 | command: 224 | - -config.file=/etc/promtail/config.yml 225 | 226 | volumes: 227 | cassandra_data: 228 | driver: local 229 | consul_data: 230 | driver: local 231 | minio_data: 232 | driver: local 233 | tempo_data: 234 | driver: local 235 | gateway_trace_log: 236 | driver: local 237 | -------------------------------------------------------------------------------- /demo/helm/loki-cluster-demo/README.md: -------------------------------------------------------------------------------- 1 | # loki-cluster-demo 2 | 3 | ![Version: 0.0.1](https://img.shields.io/badge/Version-0.0.1-informational?style=flat-square) 4 | 5 | Deploy Loki Cluster, only for demo. 6 | 7 | ``` 8 | helm template --name stable --namespace . - | kubectl apply -f - 9 | ``` 10 | 11 | ## Values 12 | 13 | | Key | Type | Default | Description | 14 | |-----|------|---------|-------------| 15 | | global.configmaps[0] | string | `"redis.conf"` | | 16 | | global.name | string | `"loki-cluster-demo"` | | 17 | | loki-cassandra.cassandra_password | string | `"cassandra"` | | 18 | | loki-cassandra.fullnameOverride | string | `"loki-cassandra"` | | 19 | | loki-cassandra.image.pullPolicy | string | `"IfNotPresent"` | | 20 | | loki-cassandra.image.repository | string | `"bitnami/cassandra:3-debian-10"` | | 21 | | loki-cassandra.nameOverride | string | `"loki-cassandra"` | | 22 | | loki-cassandra.persistence[0].accessMode | string | `"ReadWriteOnce"` | | 23 | | loki-cassandra.persistence[0].mount_path | string | `"/bitnami"` | | 24 | | loki-cassandra.persistence[0].name | string | `"data"` | | 25 | | loki-cassandra.persistence[0].size | string | `"5Gi"` | | 26 | | loki-cassandra.persistence[0].storageClass | string | `"local-path"` | | 27 | | loki-cassandra.resources.limits.cpu | string | `"1"` | | 28 | | loki-cassandra.resources.limits.memory | string | `"10Gi"` | | 29 | | loki-cassandra.resources.requests.cpu | string | `"500m"` | | 30 | | loki-cassandra.resources.requests.memory | string | `"8Gi"` | | 31 | | loki-cassandra.svcNameOverride | string | `"loki-cassandra"` | | 32 | | loki-consul.CONSUL_BIND_INTERFACE | string | `"eth0"` | | 33 | | loki-consul.fullnameOverride | string | `"loki-consul"` | | 34 | | loki-consul.image.pullPolicy | string | `"IfNotPresent"` | | 35 | | loki-consul.image.repository | string | `"consul:1.7.8"` | | 36 | | loki-consul.nameOverride | string | `"loki-consul"` | | 37 | | loki-consul.persistence[0].accessMode | string | `"ReadWriteOnce"` | | 38 | | loki-consul.persistence[0].mount_path | string | `"/consul/data"` | | 39 | | loki-consul.persistence[0].name | string | `"data"` | | 40 | | loki-consul.persistence[0].size | string | `"1Gi"` | | 41 | | loki-consul.persistence[0].storageClass | string | `"local-path"` | | 42 | | loki-consul.resources.limits.cpu | string | `"1"` | | 43 | | loki-consul.resources.limits.memory | string | `"1Gi"` | | 44 | | loki-consul.resources.requests.cpu | string | `"200m"` | | 45 | | loki-consul.resources.requests.memory | string | `"256Mi"` | | 46 | | loki-consul.svcNameOverride | string | `"loki-consul"` | | 47 | | loki-distributor.fullnameOverride | string | `"loki-distributor"` | | 48 | | loki-distributor.image.pullPolicy | string | `"IfNotPresent"` | | 49 | | loki-distributor.image.repository | string | `"grafana/loki:1.6.0"` | | 50 | | loki-distributor.nameOverride | string | `"loki-distributor"` | | 51 | | loki-distributor.replicaCount | int | `3` | | 52 | | loki-distributor.resources.limits.cpu | string | `"1"` | | 53 | | loki-distributor.resources.limits.memory | string | `"1Gi"` | | 54 | | loki-distributor.resources.requests.cpu | string | `"200m"` | | 55 | | loki-distributor.resources.requests.memory | string | `"256Mi"` | | 56 | | loki-distributor.svcNameOverride | string | `"loki-distributor"` | | 57 | | loki-gateway.fullnameOverride | string | `"loki-gateway"` | | 58 | | loki-gateway.image.pullPolicy | string | `"IfNotPresent"` | | 59 | | loki-gateway.image.repository | string | `"nginx:1.15.1-alpine"` | | 60 | | loki-gateway.nameOverride | string | `"loki-gateway"` | | 61 | | loki-gateway.replicaCount | int | `2` | | 62 | | loki-gateway.resources.limits.cpu | string | `"1"` | | 63 | | loki-gateway.resources.limits.memory | string | `"2Gi"` | | 64 | | loki-gateway.resources.requests.cpu | string | `"200m"` | | 65 | | loki-gateway.resources.requests.memory | string | `"256Mi"` | | 66 | | loki-gateway.svcNameOverride | string | `"loki-gateway"` | | 67 | | loki-ingester.fullnameOverride | string | `"loki-ingester"` | | 68 | | loki-ingester.image.pullPolicy | string | `"IfNotPresent"` | | 69 | | loki-ingester.image.repository | string | `"grafana/loki:1.6.0"` | | 70 | | loki-ingester.nameOverride | string | `"loki-ingester"` | | 71 | | loki-ingester.replicaCount | int | `3` | | 72 | | loki-ingester.resources.limits.cpu | string | `"1"` | | 73 | | loki-ingester.resources.limits.memory | string | `"1Gi"` | | 74 | | loki-ingester.resources.requests.cpu | string | `"200m"` | | 75 | | loki-ingester.resources.requests.memory | string | `"256Mi"` | | 76 | | loki-ingester.svcNameOverride | string | `"loki-ingester"` | | 77 | | loki-minio.access_key | string | `"key123456"` | | 78 | | loki-minio.fullnameOverride | string | `"loki-minio"` | | 79 | | loki-minio.image.pullPolicy | string | `"IfNotPresent"` | | 80 | | loki-minio.image.repository | string | `"minio/minio:RELEASE.2020-09-21T22-31-59Z"` | | 81 | | loki-minio.nameOverride | string | `"loki-minio"` | | 82 | | loki-minio.persistence[0].accessMode | string | `"ReadWriteOnce"` | | 83 | | loki-minio.persistence[0].mount_path | string | `"/data"` | | 84 | | loki-minio.persistence[0].name | string | `"data"` | | 85 | | loki-minio.persistence[0].size | string | `"10Gi"` | | 86 | | loki-minio.persistence[0].storageClass | string | `"local-path"` | | 87 | | loki-minio.resources.limits.cpu | string | `"1"` | | 88 | | loki-minio.resources.limits.memory | string | `"1Gi"` | | 89 | | loki-minio.resources.requests.cpu | string | `"200m"` | | 90 | | loki-minio.resources.requests.memory | string | `"256Mi"` | | 91 | | loki-minio.secret_key | string | `"password123456"` | | 92 | | loki-minio.svcNameOverride | string | `"loki-minio"` | | 93 | | loki-querier-frontend.fullnameOverride | string | `"loki-querier-frontend"` | | 94 | | loki-querier-frontend.image.pullPolicy | string | `"IfNotPresent"` | | 95 | | loki-querier-frontend.image.repository | string | `"grafana/loki:1.6.0"` | | 96 | | loki-querier-frontend.nameOverride | string | `"loki-querier-frontend"` | | 97 | | loki-querier-frontend.replicaCount | int | `2` | | 98 | | loki-querier-frontend.resources.limits.cpu | string | `"1"` | | 99 | | loki-querier-frontend.resources.limits.memory | string | `"1Gi"` | | 100 | | loki-querier-frontend.resources.requests.cpu | string | `"200m"` | | 101 | | loki-querier-frontend.resources.requests.memory | string | `"256Mi"` | | 102 | | loki-querier-frontend.svcNameOverride | string | `"loki-querier-frontend"` | | 103 | | loki-querier.fullnameOverride | string | `"loki-querier"` | | 104 | | loki-querier.image.pullPolicy | string | `"IfNotPresent"` | | 105 | | loki-querier.image.repository | string | `"grafana/loki:1.6.0"` | | 106 | | loki-querier.nameOverride | string | `"loki-querier"` | | 107 | | loki-querier.replicaCount | int | `3` | | 108 | | loki-querier.resources.limits.cpu | string | `"1"` | | 109 | | loki-querier.resources.limits.memory | string | `"1Gi"` | | 110 | | loki-querier.resources.requests.cpu | string | `"200m"` | | 111 | | loki-querier.resources.requests.memory | string | `"256Mi"` | | 112 | | loki-querier.svcNameOverride | string | `"loki-querier"` | | 113 | | loki-redis.fullnameOverride | string | `"loki-redis"` | | 114 | | loki-redis.image.pullPolicy | string | `"IfNotPresent"` | | 115 | | loki-redis.image.repository | string | `"redis:5.0.6-alpine"` | | 116 | | loki-redis.nameOverride | string | `"loki-redis"` | | 117 | | loki-redis.resources.limits.cpu | string | `"1"` | | 118 | | loki-redis.resources.limits.memory | string | `"4Gi"` | | 119 | | loki-redis.resources.requests.cpu | string | `"200m"` | | 120 | | loki-redis.resources.requests.memory | string | `"2Gi"` | | 121 | | loki-redis.svcNameOverride | string | `"loki-redis"` | | 122 | | table-manager.fullnameOverride | string | `"table-manager"` | | 123 | | table-manager.image.pullPolicy | string | `"IfNotPresent"` | | 124 | | table-manager.image.repository | string | `"grafana/loki:1.6.0"` | | 125 | | table-manager.nameOverride | string | `"table-manager"` | | 126 | | table-manager.replicaCount | int | `1` | | 127 | | table-manager.resources.limits.cpu | string | `"1"` | | 128 | | table-manager.resources.limits.memory | string | `"1Gi"` | | 129 | | table-manager.resources.requests.cpu | string | `"200m"` | | 130 | | table-manager.resources.requests.memory | string | `"256Mi"` | | 131 | | table-manager.svcNameOverride | string | `"table-manager"` | | 132 | --------------------------------------------------------------------------------