added repo
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
@@ -0,0 +1,12 @@
|
||||
dependencies:
|
||||
- name: grafana-agent
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 0.44.2
|
||||
- name: alloy
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 1.5.2
|
||||
- name: minio
|
||||
repository: https://charts.min.io/
|
||||
version: 4.1.0
|
||||
digest: sha256:6539cf3e08af8a90406747cea8b186872b43b8cd33b19bb479e5d011daa90b7e
|
||||
generated: "2026-01-19T02:29:04.501652875Z"
|
||||
@@ -0,0 +1,27 @@
|
||||
apiVersion: v2
|
||||
appVersion: 1.19.0
|
||||
dependencies:
|
||||
- alias: agent
|
||||
condition: agent.enabled
|
||||
name: grafana-agent
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 0.44.2
|
||||
- alias: alloy
|
||||
condition: alloy.enabled
|
||||
name: alloy
|
||||
repository: https://grafana.github.io/helm-charts
|
||||
version: 1.5.2
|
||||
- alias: minio
|
||||
condition: minio.enabled
|
||||
name: minio
|
||||
repository: https://charts.min.io/
|
||||
version: 4.1.0
|
||||
description: "\U0001F525 horizontally-scalable, highly-available, multi-tenant continuous
|
||||
profiling aggregation system"
|
||||
home: https://grafana.com/oss/pyroscope/
|
||||
name: pyroscope
|
||||
sources:
|
||||
- https://github.com/grafana/pyroscope
|
||||
- https://github.com/grafana/pyroscope/tree/main/operations/pyroscope/helm/pyroscope
|
||||
type: application
|
||||
version: 1.19.1
|
||||
@@ -0,0 +1,120 @@
|
||||
# pyroscope
|
||||
|
||||
  
|
||||
|
||||
🔥 horizontally-scalable, highly-available, multi-tenant continuous profiling aggregation system
|
||||
|
||||
**Homepage:** <https://grafana.com/oss/pyroscope/>
|
||||
|
||||
## Source Code
|
||||
|
||||
* <https://github.com/grafana/pyroscope>
|
||||
* <https://github.com/grafana/pyroscope/tree/main/operations/pyroscope/helm/pyroscope>
|
||||
|
||||
## Requirements
|
||||
|
||||
| Repository | Name | Version |
|
||||
|------------|------|---------|
|
||||
| https://charts.min.io/ | minio(minio) | 4.1.0 |
|
||||
| https://grafana.github.io/helm-charts | alloy(alloy) | 1.5.2 |
|
||||
| https://grafana.github.io/helm-charts | agent(grafana-agent) | 0.44.2 |
|
||||
|
||||
## Values
|
||||
|
||||
| Key | Type | Default | Description |
|
||||
|-----|------|---------|-------------|
|
||||
| agent | object | `{"agent":{"clustering":{"enabled":true},"configMap":{"create":false,"name":"grafana-agent-config-pyroscope"}},"controller":{"podAnnotations":{"profiles.grafana.com/cpu.port_name":"http-metrics","profiles.grafana.com/cpu.scrape":"true","profiles.grafana.com/goroutine.port_name":"http-metrics","profiles.grafana.com/goroutine.scrape":"true","profiles.grafana.com/memory.port_name":"http-metrics","profiles.grafana.com/memory.scrape":"true"},"replicas":1,"type":"statefulset"},"enabled":false}` | ----------------------------------- |
|
||||
| alloy | object | `{"alloy":{"clustering":{"enabled":true},"configMap":{"create":false,"name":"alloy-config-pyroscope"},"stabilityLevel":"public-preview"},"controller":{"podAnnotations":{"profiles.grafana.com/cpu.port_name":"http-metrics","profiles.grafana.com/cpu.scrape":"true","profiles.grafana.com/goroutine.port_name":"http-metrics","profiles.grafana.com/goroutine.scrape":"true","profiles.grafana.com/memory.port_name":"http-metrics","profiles.grafana.com/memory.scrape":"true","profiles.grafana.com/service_git_ref":"v1.8.1","profiles.grafana.com/service_repository":"https://github.com/grafana/alloy"},"replicas":1,"type":"statefulset"},"enabled":true}` | ----------------------------------- |
|
||||
| architecture.deployUnifiedServices | bool | `false` | Deploy unified write/read services. These endpoints will can be used no matter if the helm chart is configured as single-binary or microservices |
|
||||
| architecture.microservices.clusterLabelSuffix | string | `"-micro-services"` | Memberlist cluster label that will be used for all members of this cluster |
|
||||
| architecture.microservices.enabled | bool | `false` | Enable micro-services deployment mode. This is recommend for larger scale deployment and allow right size each aspect of Pyroscope. |
|
||||
| architecture.overwriteResources | object | `{}` | This flag is useful for testing, it will overwrite all pods resource statements with its contents |
|
||||
| architecture.storage.migration.ingesterWeight | float | `1` | Specifies the fraction [0:1] that should be send to the v1 write path / ingester in combined mode. 0 means no traffics is sent to ingester. 1 means 100% of requests are sent to ingester. |
|
||||
| architecture.storage.migration.queryBackend | bool | `true` | Specify a time stamp from when the v2 read path should serve traffic. |
|
||||
| architecture.storage.migration.queryBackendFrom | string | `"auto"` | Specify a time stamp from when the v2 read path should serve traffic. |
|
||||
| architecture.storage.migration.segmentWriterWeight | float | `1` | Specifies the fraction [0:1] that should be send to the v2 write path / segment-writer in combined mode. 0 means no traffics is sent to segment-writer. 1 means 100% of requests are sent to segment-writer. |
|
||||
| architecture.storage.v1 | bool | `true` | Enable v1 storage layer. |
|
||||
| architecture.storage.v2 | bool | `false` | Enable v2 storage layer. |
|
||||
| global.imageRegistry | string | `nil` | Overrides the Docker registry globally for all images |
|
||||
| ingress.annotations | object | `{}` | |
|
||||
| ingress.className | string | `""` | |
|
||||
| ingress.enabled | bool | `false` | |
|
||||
| ingress.labels | object | `{}` | |
|
||||
| ingress.pathType | string | `"ImplementationSpecific"` | |
|
||||
| minio | object | `{"buckets":[{"name":"grafana-pyroscope-data","policy":"none","purge":false}],"drivesPerNode":2,"enabled":false,"persistence":{"size":"5Gi"},"podAnnotations":{},"replicas":1,"resources":{"requests":{"cpu":"100m","memory":"128Mi"}},"rootPassword":"supersecret","rootUser":"grafana-pyroscope"}` | ----------------------------------- |
|
||||
| pyroscope.affinity | object | `{}` | |
|
||||
| pyroscope.cluster_domain | string | `".cluster.local."` | Kubernetes cluster domain suffix for DNS discovery |
|
||||
| pyroscope.components | object | `{}` | |
|
||||
| pyroscope.config | string | The config depends on other values been set, details can be found in [`values.yaml`](./values.yaml) | Contains Pyroscope's configuration as a string. |
|
||||
| pyroscope.disableSelfProfile | bool | `true` | Enable or disable Self profile push, useful to test |
|
||||
| pyroscope.dnsPolicy | string | `"ClusterFirst"` | |
|
||||
| pyroscope.extraArgs."log.level" | string | `"debug"` | |
|
||||
| pyroscope.extraContainers | list | `[]` | |
|
||||
| pyroscope.extraCustomEnvVars | object | `{}` | |
|
||||
| pyroscope.extraEnvFrom | list | `[]` | Environment variables from secrets or configmaps to add to the pods |
|
||||
| pyroscope.extraEnvVars | object | `{}` | |
|
||||
| pyroscope.extraLabels | object | `{}` | |
|
||||
| pyroscope.extraVolumeMounts | list | `[]` | |
|
||||
| pyroscope.extraVolumes | list | `[]` | |
|
||||
| pyroscope.fullnameOverride | string | `""` | |
|
||||
| pyroscope.grpc.port | int | `9095` | |
|
||||
| pyroscope.grpc.port_name | string | `"grpc"` | |
|
||||
| pyroscope.image.pullPolicy | string | `"IfNotPresent"` | |
|
||||
| pyroscope.image.registry | string | `""` | |
|
||||
| pyroscope.image.repository | string | `"grafana/pyroscope"` | |
|
||||
| pyroscope.image.tag | string | `""` | |
|
||||
| pyroscope.imagePullSecrets | list | `[]` | |
|
||||
| pyroscope.initContainers | list | `[]` | |
|
||||
| pyroscope.memberlist.port | int | `7946` | |
|
||||
| pyroscope.memberlist.port_name | string | `"memberlist"` | |
|
||||
| pyroscope.metastore.port | int | `9099` | |
|
||||
| pyroscope.metastore.port_name | string | `"raft"` | |
|
||||
| pyroscope.nameOverride | string | `""` | |
|
||||
| pyroscope.nodeSelector | object | `{}` | |
|
||||
| pyroscope.persistence.accessModes[0] | string | `"ReadWriteOnce"` | |
|
||||
| pyroscope.persistence.annotations | object | `{}` | |
|
||||
| pyroscope.persistence.enabled | bool | `false` | |
|
||||
| pyroscope.persistence.metastore.subPath | string | `".metastore"` | |
|
||||
| pyroscope.persistence.shared.enabled | bool | `true` | |
|
||||
| pyroscope.persistence.shared.subPath | string | `".shared"` | |
|
||||
| pyroscope.persistence.size | string | `"10Gi"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/cpu.port_name" | string | `"http2"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/cpu.scrape" | string | `"true"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/goroutine.port_name" | string | `"http2"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/goroutine.scrape" | string | `"true"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/memory.port_name" | string | `"http2"` | |
|
||||
| pyroscope.podAnnotations."profiles.grafana.com/memory.scrape" | string | `"true"` | |
|
||||
| pyroscope.podDisruptionBudget.enabled | bool | `true` | |
|
||||
| pyroscope.podDisruptionBudget.maxUnavailable | int | `1` | |
|
||||
| pyroscope.podSecurityContext.fsGroup | int | `10001` | |
|
||||
| pyroscope.podSecurityContext.runAsNonRoot | bool | `true` | |
|
||||
| pyroscope.podSecurityContext.runAsUser | int | `10001` | |
|
||||
| pyroscope.replicaCount | int | `1` | |
|
||||
| pyroscope.resources | object | `{}` | |
|
||||
| pyroscope.securityContext | object | `{}` | |
|
||||
| pyroscope.service.annotations | object | `{}` | |
|
||||
| pyroscope.service.headlessAnnotations | object | `{}` | |
|
||||
| pyroscope.service.port | int | `4040` | |
|
||||
| pyroscope.service.port_name | string | `"http2"` | |
|
||||
| pyroscope.service.scheme | string | `"HTTP"` | |
|
||||
| pyroscope.service.type | string | `"ClusterIP"` | |
|
||||
| pyroscope.serviceAccount.annotations | object | `{}` | |
|
||||
| pyroscope.serviceAccount.create | bool | `true` | |
|
||||
| pyroscope.serviceAccount.name | string | `""` | |
|
||||
| pyroscope.structuredConfig | object | `{}` | Allows to override Pyroscope's configuration using structured format. |
|
||||
| pyroscope.tenantOverrides | object | `{}` | Allows to add tenant specific overrides to the default limit configuration. |
|
||||
| pyroscope.tolerations | list | `[]` | |
|
||||
| pyroscope.topologySpreadConstraints | list | `[]` | Topology Spread Constraints |
|
||||
| serviceMonitor.annotations | object | `{}` | ServiceMonitor annotations |
|
||||
| serviceMonitor.enabled | bool | `false` | If enabled, ServiceMonitor resources for Prometheus Operator are created |
|
||||
| serviceMonitor.interval | string | `nil` | ServiceMonitor scrape interval |
|
||||
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
|
||||
| serviceMonitor.matchExpressions | list | `[]` | Optional expressions to match on |
|
||||
| serviceMonitor.metricRelabelings | list | `[]` | ServiceMonitor metric relabel configs to apply to samples before ingestion https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint |
|
||||
| serviceMonitor.namespaceSelector | object | `{}` | Namespace selector for ServiceMonitor resources |
|
||||
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabel configs to apply to samples before scraping https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig |
|
||||
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor will use http by default, but you can pick https as well |
|
||||
| serviceMonitor.scrapeTimeout | string | `nil` | ServiceMonitor scrape timeout in Go duration format (e.g. 15s) |
|
||||
| serviceMonitor.targetLabels | list | `[]` | ServiceMonitor will add labels from the service to the Prometheus metric https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec |
|
||||
| serviceMonitor.tlsConfig | string | `nil` | ServiceMonitor will use these tlsConfig settings to make the health check requests |
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
# Default values for pyroscope.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
pyroscope:
|
||||
components:
|
||||
querier:
|
||||
kind: Deployment
|
||||
replicaCount: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 32Mi
|
||||
cpu: 10m
|
||||
query-frontend:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 32Mi
|
||||
cpu: 10m
|
||||
query-scheduler:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 32Mi
|
||||
cpu: 10m
|
||||
distributor:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 32Mi
|
||||
cpu: 50m
|
||||
ingester:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
store-gateway:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
persistence:
|
||||
# The store-gateway needs not need persistent storage, but we still run it as a StatefulSet
|
||||
# This is to avoid having blocks of data being
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 64Mi
|
||||
cpu: 20m
|
||||
initContainers:
|
||||
- name: create-bucket
|
||||
image: minio/mc:RELEASE.2025-04-08T15-39-49Z
|
||||
command:
|
||||
- /bin/sh
|
||||
- -c
|
||||
- |
|
||||
export MC_CONFIG_DIR="/tmp/mc"
|
||||
mkdir -p "$MC_CONFIG_DIR"
|
||||
until mc config host add myminio http://$MINIO_ENDPOINT:9000 grafana-pyroscope supersecret; do
|
||||
echo "Waiting for Minio to be available..."
|
||||
sleep 5
|
||||
done
|
||||
mc mb myminio/grafana-pyroscope-data --ignore-existing
|
||||
env:
|
||||
- name: POD_NAMESPACE
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.namespace
|
||||
- name: MINIO_ENDPOINT
|
||||
value: $(POD_NAMESPACE)-minio
|
||||
|
||||
minio:
|
||||
enabled: true
|
||||
@@ -0,0 +1 @@
|
||||
---
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
|
||||
Thanks for deploying Grafana Pyroscope.
|
||||
|
||||
# Pyroscope UI & Grafana
|
||||
|
||||
Pyroscope database comes with a built-in UI, to access it from your localhost you can use:
|
||||
|
||||
```
|
||||
{{ include "pyroscope.kubectl_port_forward_read" . }}
|
||||
```
|
||||
|
||||
You can also use Grafana to explore Pyroscope data.
|
||||
For that, you'll need to add the Pyroscope data source to your Grafana instance and configure the query URL accordingly.
|
||||
See https://grafana.com/docs/grafana/latest/datasources/grafana-pyroscope/ for more details.
|
||||
|
||||
The in-cluster query URL for the data source in Grafana is:
|
||||
|
||||
```
|
||||
{{ include "pyroscope.read_url" . }}
|
||||
```
|
||||
|
||||
# Collecting profiles.
|
||||
|
||||
{{ if or .Values.agent.enabled .Values.alloy.enabled }}
|
||||
The Grafana {{ if .Values.alloy.enabled }}Alloy{{ else }}Agent{{ end }} has been installed to scrape and discover pprof profiles endpoint via pod annotations.
|
||||
|
||||
As an example, to start collecting memory and cpu profile using the 8080 port, add the following annotations to your workload:
|
||||
|
||||
```
|
||||
profiles.grafana.com/memory.scrape: "true"
|
||||
profiles.grafana.com/memory.port: "8080"
|
||||
profiles.grafana.com/cpu.scrape: "true"
|
||||
profiles.grafana.com/cpu.port: "8080"
|
||||
```
|
||||
|
||||
|
||||
To learn more supported annotations, read our guide https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/#optional-scrape-your-own-workloads-profiles
|
||||
{{- end }}
|
||||
|
||||
There are various ways to collect profiles from your application depending on your needs.
|
||||
Follow our guide to setup profiling data collection for your workload:
|
||||
|
||||
https://grafana.com/docs/pyroscope/latest/configure-client/
|
||||
|
||||
{{- $storage := .Values.architecture.storage }}
|
||||
{{- if and $storage.v1 $storage.v2 }}
|
||||
|
||||
# Pyroscope v2 Migration is active
|
||||
|
||||
Write traffic will be written to:
|
||||
- {{ mul $storage.migration.ingesterWeight 100 }}% v1: ingester
|
||||
- {{ mul $storage.migration.segmentWriterWeight 100 }}% v2: segment-writer
|
||||
|
||||
{{ if $storage.migration.queryBackend }}
|
||||
Read traffic is served from v2 read path from {{if eq $storage.migration.queryBackendFrom "auto"}}as soon as data was first ingested to v2{{else}}{{$storage.migration.queryBackendFrom}}{{end}}.
|
||||
{{- else }}
|
||||
Read traffic is served from v1 read path.
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and (not $storage.v1) (not $storage.v2) }}
|
||||
{{- fail "you need to set at least one of .Values.architecture.storage.v1, .Values.architecture.storage.v2 to true" }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,161 @@
|
||||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "pyroscope.name" -}}
|
||||
{{- default .Chart.Name .Values.pyroscope.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "pyroscope.fullname" -}}
|
||||
{{- if .Values.pyroscope.fullnameOverride }}
|
||||
{{- .Values.pyroscope.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.pyroscope.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "pyroscope.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "pyroscope.labels" -}}
|
||||
helm.sh/chart: {{ include "pyroscope.chart" . }}
|
||||
{{ include "pyroscope.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- range $k, $v := .Values.pyroscope.extraLabels }}
|
||||
{{$k}}: {{ $v | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "pyroscope.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "pyroscope.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Template labels
|
||||
*/}}
|
||||
{{- define "pyroscope.templateLabels" -}}
|
||||
{{ include "pyroscope.selectorLabels" . }}
|
||||
{{- range $k, $v := .Values.pyroscope.extraLabels }}
|
||||
{{$k}}: {{ $v | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "pyroscope.serviceAccountName" -}}
|
||||
{{- if .Values.pyroscope.serviceAccount.create }}
|
||||
{{- default (include "pyroscope.fullname" .) .Values.pyroscope.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.pyroscope.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a list of components that should be deployed.
|
||||
*/}}
|
||||
{{- define "pyroscope.components" -}}
|
||||
{{- $full_name := (include "pyroscope.fullname" .) }}
|
||||
{{- $components := dict }}
|
||||
{{- if .Values.architecture.microservices.enabled }}
|
||||
{{- if .Values.architecture.storage.v1 }}
|
||||
{{- $components = mustMergeOverwrite (deepCopy $components) (.Values.architecture.microservices.v1 | default dict)}}
|
||||
{{- end }}
|
||||
{{- if .Values.architecture.storage.v2 }}
|
||||
{{- $components = mustMergeOverwrite (deepCopy $components) (.Values.architecture.microservices.v2 | default dict)}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- $components = mustMergeOverwrite (deepCopy $components) (.Values.pyroscope.components | default dict)}}
|
||||
{{- range $k, $v := $components }}
|
||||
{{- $v := set $v "name" (printf "%s-%s" $full_name $k) }}
|
||||
{{$k}}: {{ $v | toJson }}
|
||||
{{- end }}
|
||||
{{/*
|
||||
If no components are defined fall back to single binary statefulset
|
||||
*/}}
|
||||
{{- if eq (len $components) 0 }}
|
||||
all: {kind: "StatefulSet", name: "{{$full_name}}"}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
|
||||
{{/*
|
||||
Return the URL for sending profiles to Pyroscope.
|
||||
*/}}
|
||||
{{- define "pyroscope.write_url" -}}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) -}}
|
||||
{{- if .Values.architecture.deployUnifiedServices -}}
|
||||
http://{{ include "pyroscope.fullname" . }}-write.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}
|
||||
{{- else if hasKey $components "distributor" -}}
|
||||
http://{{ include "pyroscope.fullname" . }}-distributor.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ ($components.distributor.service).port | default .Values.pyroscope.service.port}}
|
||||
{{- else -}}
|
||||
http://{{ include "pyroscope.fullname" . }}.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ .Values.pyroscope.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the URL for querying profiles from Pyroscope.
|
||||
*/}}
|
||||
{{- define "pyroscope.read_url" -}}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) -}}
|
||||
{{- if .Values.architecture.deployUnifiedServices -}}
|
||||
http://{{ include "pyroscope.fullname" . }}-read.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}
|
||||
{{- else if hasKey $components "query-frontend" -}}A
|
||||
{{- $port := ((index $components "query-frontend").service).port | default .Values.pyroscope.service.port }}
|
||||
http://{{ include "pyroscope.fullname" . }}-query-frontend.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ $port }}
|
||||
{{- else -}}
|
||||
http://{{ include "pyroscope.fullname" . }}.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ .Values.pyroscope.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Return the kubectl port-forward command for querying profiles from Pyroscope.
|
||||
*/}}
|
||||
{{- define "pyroscope.kubectl_port_forward_read" -}}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) -}}
|
||||
{{- if .Values.architecture.deployUnifiedServices -}}
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "pyroscope.fullname" . }}-read {{ .Values.pyroscope.service.port }}:80
|
||||
{{- else if hasKey $components "query-frontend" -}}
|
||||
{{- $port := ((index $components "query-frontend").service).port | default .Values.pyroscope.service.port }}
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "pyroscope.fullname" . }}-query-frontend {{ $port }}:{{ $port }}
|
||||
{{- else -}}
|
||||
kubectl --namespace {{ .Release.Namespace }} port-forward svc/{{ include "pyroscope.fullname" . }} {{ .Values.pyroscope.service.port }}:{{ .Values.pyroscope.service.port }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- define "pyroscope.defaultAutoscalingComponents" -}}
|
||||
enabled: false
|
||||
minReplicas: 1
|
||||
maxReplicas: 3
|
||||
targetCPUUtilizationPercentage: 60
|
||||
targetMemoryUtilizationPercentage: null
|
||||
customMetrics: []
|
||||
behavior:
|
||||
enabled: false
|
||||
scaleDown: {}
|
||||
scaleUp: {}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,190 @@
|
||||
{{- /* Note this config file is depreacted, use the alloy one instead */}}
|
||||
{{- if and (.Values.agent.enabled) (not .Values.agent.agent.configMap.create) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Values.agent.agent.configMap.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
data:
|
||||
config.river: |
|
||||
logging {
|
||||
level = "info"
|
||||
format = "logfmt"
|
||||
}
|
||||
|
||||
discovery.kubernetes "pyroscope_kubernetes" {
|
||||
role = "pod"
|
||||
}
|
||||
|
||||
// The default scrape config allows to define annotations based scraping.
|
||||
//
|
||||
// For example the following annotations:
|
||||
//
|
||||
// ```
|
||||
// profiles.grafana.com/memory.scrape: "true"
|
||||
// profiles.grafana.com/memory.port: "8080"
|
||||
// profiles.grafana.com/cpu.scrape: "true"
|
||||
// profiles.grafana.com/cpu.port: "8080"
|
||||
// profiles.grafana.com/goroutine.scrape: "true"
|
||||
// profiles.grafana.com/goroutine.port: "8080"
|
||||
// ```
|
||||
//
|
||||
// will scrape the `memory`, `cpu` and `goroutine` profiles from the `8080` port of the pod.
|
||||
//
|
||||
// For more information see https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/#optional-scrape-your-own-workloads-profiles
|
||||
discovery.relabel "kubernetes_pods" {
|
||||
targets = concat(discovery.kubernetes.pyroscope_kubernetes.targets)
|
||||
|
||||
rule {
|
||||
action = "drop"
|
||||
source_labels = ["__meta_kubernetes_pod_phase"]
|
||||
regex = "Pending|Succeeded|Failed|Completed"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "labelmap"
|
||||
regex = "__meta_kubernetes_pod_label_(.+)"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_namespace"]
|
||||
target_label = "namespace"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_name"]
|
||||
target_label = "pod"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_container_name"]
|
||||
target_label = "container"
|
||||
}
|
||||
}
|
||||
{{- $profileTypes := list "memory" "cpu" "goroutine" "block" "mutex" "fgprof" }}
|
||||
{{- range $profileTypes }}
|
||||
|
||||
discovery.relabel "kubernetes_pods_{{.}}_default_name" {
|
||||
targets = concat(discovery.relabel.kubernetes_pods.output)
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scrape"]
|
||||
action = "keep"
|
||||
regex = "true"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"]
|
||||
action = "keep"
|
||||
regex = ""
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_container_port_number"]
|
||||
target_label = "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"
|
||||
action = "keepequal"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scheme"]
|
||||
action = "replace"
|
||||
regex = "(https?)"
|
||||
target_label = "__scheme__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_path"]
|
||||
action = "replace"
|
||||
regex = "(.+)"
|
||||
target_label = "__profile_path__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__address__", "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"]
|
||||
action = "replace"
|
||||
regex = "(.+?)(?::\\d+)?;(\\d+)"
|
||||
target_label = "__address__"
|
||||
replacement = "$1:$2"
|
||||
}
|
||||
}
|
||||
|
||||
discovery.relabel "kubernetes_pods_{{.}}_custom_name" {
|
||||
targets = concat(discovery.relabel.kubernetes_pods.output)
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scrape"]
|
||||
action = "keep"
|
||||
regex = "true"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"]
|
||||
action = "drop"
|
||||
regex = ""
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_container_port_name"]
|
||||
target_label = "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"
|
||||
action = "keepequal"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scheme"]
|
||||
action = "replace"
|
||||
regex = "(https?)"
|
||||
target_label = "__scheme__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_path"]
|
||||
action = "replace"
|
||||
regex = "(.+)"
|
||||
target_label = "__profile_path__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__address__", "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"]
|
||||
action = "replace"
|
||||
regex = "(.+?)(?::\\d+)?;(\\d+)"
|
||||
target_label = "__address__"
|
||||
replacement = "$1:$2"
|
||||
}
|
||||
}
|
||||
|
||||
pyroscope.scrape "pyroscope_scrape_{{.}}" {
|
||||
clustering {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
targets = concat(discovery.relabel.kubernetes_pods_{{.}}_default_name.output, discovery.relabel.kubernetes_pods_{{.}}_custom_name.output)
|
||||
forward_to = [pyroscope.write.pyroscope_write.receiver]
|
||||
|
||||
profiling_config {
|
||||
{{- $currentType := . -}}
|
||||
{{- range $profileTypes }}
|
||||
profile.{{if eq . "cpu"}}process_cpu{{else}}{{.}}{{end}} {
|
||||
enabled = {{if eq . $currentType}}true{{else}}false{{end}}
|
||||
}
|
||||
{{- if ne . (last $profileTypes) }}{{ printf "\n" }}{{ end }}
|
||||
{{- end }}
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
pyroscope.write "pyroscope_write" {
|
||||
endpoint {
|
||||
url = "{{ include "pyroscope.write_url" . }}"
|
||||
}
|
||||
}
|
||||
|
||||
{{- end }}
|
||||
@@ -0,0 +1,207 @@
|
||||
{{- if and (.Values.alloy.enabled) (not .Values.alloy.alloy.configMap.create) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ .Values.alloy.alloy.configMap.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
data:
|
||||
config.alloy: |
|
||||
logging {
|
||||
level = "info"
|
||||
format = "logfmt"
|
||||
}
|
||||
|
||||
discovery.kubernetes "pyroscope_kubernetes" {
|
||||
role = "pod"
|
||||
}
|
||||
|
||||
// The default scrape config allows to define annotations based scraping.
|
||||
//
|
||||
// For example the following annotations:
|
||||
//
|
||||
// ```
|
||||
// profiles.grafana.com/memory.scrape: "true"
|
||||
// profiles.grafana.com/memory.port: "8080"
|
||||
// profiles.grafana.com/cpu.scrape: "true"
|
||||
// profiles.grafana.com/cpu.port: "8080"
|
||||
// profiles.grafana.com/goroutine.scrape: "true"
|
||||
// profiles.grafana.com/goroutine.port: "8080"
|
||||
// ```
|
||||
//
|
||||
// will scrape the `memory`, `cpu` and `goroutine` profiles from the `8080` port of the pod.
|
||||
//
|
||||
// For more information see https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/#optional-scrape-your-own-workloads-profiles
|
||||
discovery.relabel "kubernetes_pods" {
|
||||
targets = concat(discovery.kubernetes.pyroscope_kubernetes.targets)
|
||||
|
||||
rule {
|
||||
action = "drop"
|
||||
source_labels = ["__meta_kubernetes_pod_phase"]
|
||||
regex = "Pending|Succeeded|Failed|Completed"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "labelmap"
|
||||
regex = "__meta_kubernetes_pod_label_(.+)"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_namespace"]
|
||||
target_label = "namespace"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_name"]
|
||||
target_label = "pod"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_container_name"]
|
||||
target_label = "container"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_service_repository"]
|
||||
target_label = "service_repository"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_service_git_ref"]
|
||||
target_label = "service_git_ref"
|
||||
}
|
||||
|
||||
rule {
|
||||
action = "replace"
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_service_root_path"]
|
||||
target_label = "service_root_path"
|
||||
}
|
||||
}
|
||||
{{- $profileTypes := list "memory" "cpu" "goroutine" "block" "mutex" "fgprof" }}
|
||||
{{- range $profileTypes }}
|
||||
|
||||
discovery.relabel "kubernetes_pods_{{.}}_default_name" {
|
||||
targets = concat(discovery.relabel.kubernetes_pods.output)
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scrape"]
|
||||
action = "keep"
|
||||
regex = "true"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"]
|
||||
action = "keep"
|
||||
regex = ""
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_container_port_number"]
|
||||
target_label = "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"
|
||||
action = "keepequal"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scheme"]
|
||||
action = "replace"
|
||||
regex = "(https?)"
|
||||
target_label = "__scheme__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_path"]
|
||||
action = "replace"
|
||||
regex = "(.+)"
|
||||
target_label = "__profile_path__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__address__", "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"]
|
||||
action = "replace"
|
||||
regex = "(.+?)(?::\\d+)?;(\\d+)"
|
||||
target_label = "__address__"
|
||||
replacement = "$1:$2"
|
||||
}
|
||||
}
|
||||
|
||||
discovery.relabel "kubernetes_pods_{{.}}_custom_name" {
|
||||
targets = concat(discovery.relabel.kubernetes_pods.output)
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scrape"]
|
||||
action = "keep"
|
||||
regex = "true"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"]
|
||||
action = "drop"
|
||||
regex = ""
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_container_port_name"]
|
||||
target_label = "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port_name"
|
||||
action = "keepequal"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_scheme"]
|
||||
action = "replace"
|
||||
regex = "(https?)"
|
||||
target_label = "__scheme__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_path"]
|
||||
action = "replace"
|
||||
regex = "(.+)"
|
||||
target_label = "__profile_path__"
|
||||
replacement = "$1"
|
||||
}
|
||||
|
||||
rule {
|
||||
source_labels = ["__address__", "__meta_kubernetes_pod_annotation_profiles_grafana_com_{{.}}_port"]
|
||||
action = "replace"
|
||||
regex = "(.+?)(?::\\d+)?;(\\d+)"
|
||||
target_label = "__address__"
|
||||
replacement = "$1:$2"
|
||||
}
|
||||
}
|
||||
|
||||
pyroscope.scrape "pyroscope_scrape_{{.}}" {
|
||||
clustering {
|
||||
enabled = true
|
||||
}
|
||||
|
||||
targets = concat(discovery.relabel.kubernetes_pods_{{.}}_default_name.output, discovery.relabel.kubernetes_pods_{{.}}_custom_name.output)
|
||||
forward_to = [pyroscope.write.pyroscope_write.receiver]
|
||||
|
||||
profiling_config {
|
||||
{{- $currentType := . -}}
|
||||
{{- range $profileTypes }}
|
||||
profile.{{if eq . "cpu"}}process_cpu{{else}}{{.}}{{end}} {
|
||||
enabled = {{if eq . $currentType}}true{{else}}false{{end}}
|
||||
}
|
||||
{{- if ne . (last $profileTypes) }}{{ printf "\n" }}{{ end }}
|
||||
{{- end }}
|
||||
}
|
||||
}
|
||||
{{- end }}
|
||||
|
||||
pyroscope.write "pyroscope_write" {
|
||||
endpoint {
|
||||
url = "{{ include "pyroscope.write_url" . }}"
|
||||
}
|
||||
}
|
||||
|
||||
{{- end }}
|
||||
@@ -0,0 +1,11 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "pyroscope.fullname" . }}-overrides-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
data:
|
||||
overrides.yaml: |
|
||||
overrides:
|
||||
{{- toYaml .Values.pyroscope.tenantOverrides | nindent 6 }}
|
||||
@@ -0,0 +1,10 @@
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "pyroscope.fullname" . }}-config
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
data:
|
||||
config.yaml: |
|
||||
{{- tpl (mergeOverwrite (tpl .Values.pyroscope.config . | fromYaml) .Values.pyroscope.structuredConfig | toYaml) . | nindent 4 }}
|
||||
@@ -0,0 +1,325 @@
|
||||
{{- $global := . }}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) }}
|
||||
{{- $hasV1 := $global.Values.architecture.storage.v1 }}
|
||||
{{- $hasV2 := $global.Values.architecture.storage.v2 }}
|
||||
{{- $hasMetastore := hasKey $components "metastore" }}
|
||||
{{- $hasQueryBackend := hasKey $components "query-backend" }}
|
||||
{{- range $component, $cfg := $components }}
|
||||
{{- with $global }}
|
||||
{{- $values := mustMergeOverwrite (deepCopy .Values.pyroscope ) ($cfg | default dict)}}
|
||||
{{- $extraArgs := mustMergeOverwrite (deepCopy .Values.pyroscope.extraArgs ) ($cfg.extraArgs | default dict)}}
|
||||
{{- $isMetastore := or (and (eq $component "all") ($hasV2)) (eq $component "metastore") }}
|
||||
---
|
||||
apiVersion: apps/v1
|
||||
kind: {{ $cfg.kind }}
|
||||
metadata:
|
||||
name: {{ $cfg.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
spec:
|
||||
{{- if eq $values.kind "StatefulSet" }}
|
||||
serviceName: {{ $values.name }}-headless
|
||||
podManagementPolicy: Parallel
|
||||
{{- end }}
|
||||
{{- if and (hasKey $values "replicaCount") (not ($values.autoscaling).enabled) }}
|
||||
replicas: {{ $values.replicaCount }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
{{- if not (hasKey $values.podAnnotations "checksum/config") }}
|
||||
checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if not (hasKey $values.podAnnotations "profiles.grafana.com/service_repository") }}
|
||||
profiles.grafana.com/service_repository: "https://github.com/grafana/pyroscope"
|
||||
{{- end }}
|
||||
{{- if not (hasKey $values.podAnnotations "profiles.grafana.com/service_git_ref") }}
|
||||
profiles.grafana.com/service_git_ref: "v{{ .Chart.AppVersion }}"
|
||||
{{- end }}
|
||||
{{- with $values.podAnnotations }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "pyroscope.templateLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
name: {{ if eq $component "all" }}"pyroscope"{{ else }}"{{ $component }}"{{ end }}
|
||||
spec:
|
||||
{{- with $values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "pyroscope.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml $values.podSecurityContext | nindent 8 }}
|
||||
{{- if hasKey $values "hostNetwork" }}
|
||||
hostNetwork: {{ $values.hostNetwork }}
|
||||
{{- end }}
|
||||
{{- if hasKey $values "dnsPolicy" }}
|
||||
dnsPolicy: {{ $values.dnsPolicy }}
|
||||
{{- end }}
|
||||
{{- with $values.initContainers }}
|
||||
initContainers:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: {{ if eq $component "all" }}"pyroscope"{{ else }}"{{ $component }}"{{ end }}
|
||||
securityContext:
|
||||
{{- toYaml $values.securityContext | nindent 12 }}
|
||||
{{- $registry := $global.Values.global.imageRegistry | default $values.image.registry }}
|
||||
image: "{{ if $registry }}{{ $registry }}/{{ end }}{{ $values.image.repository }}:{{ $values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ $values.image.pullPolicy }}
|
||||
args:
|
||||
- "-target={{ $component }}"
|
||||
- "-self-profiling.disable-push={{ .Values.pyroscope.disableSelfProfile }}"
|
||||
- "-server.http-listen-port={{ $values.service.port }}"
|
||||
- "-memberlist.cluster-label={{ .Release.Namespace }}-{{ include "pyroscope.fullname" .}}{{if $global.Values.architecture.microservices.enabled}}{{$global.Values.architecture.microservices.clusterLabelSuffix}}{{end}}"
|
||||
- "-memberlist.join=dns+{{ include "pyroscope.fullname" .}}-memberlist.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ .Values.pyroscope.memberlist.port }}"
|
||||
- "-config.file=/etc/pyroscope/config.yaml"
|
||||
- "-runtime-config.file=/etc/pyroscope/overrides/overrides.yaml"
|
||||
{{- range $key, $value := $extraArgs }}
|
||||
- "-{{ $key }}={{ $value }}"
|
||||
{{- end }}
|
||||
{{- /* When v2 and single binary is used we need to explicitly configure "filesystem" (TODO: This should be the default in v2) */}}
|
||||
{{- if and $hasV2 (eq $component "all") }}
|
||||
{{- if (not (hasKey $extraArgs "storage.backend")) }}
|
||||
- "-storage.backend=filesystem"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* v2 specific options for all components */}}
|
||||
{{- if $hasV2 }}
|
||||
{{- if (not (hasKey $extraArgs "query-backend.address")) }}
|
||||
- "-query-backend.address=dns:///_grpc._tcp.{{ include "pyroscope.fullname" . }}{{ if $hasQueryBackend }}-query-backend{{ end }}-headless.$(NAMESPACE_FQDN):{{ .Values.pyroscope.grpc.port }}"
|
||||
{{- end }}
|
||||
{{- if (not (hasKey $extraArgs "metastore.address")) }}
|
||||
- "-metastore.address=kubernetes:///{{ include "pyroscope.fullname" . }}{{ if $hasMetastore }}-metastore{{ end }}-headless.$(NAMESPACE_FQDN):{{ .Values.pyroscope.grpc.port }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* metastore specific v2 migration config */}}
|
||||
{{- if $isMetastore }}
|
||||
{{- if (not (hasKey $extraArgs "metastore.raft.server-id")) }}
|
||||
- "-metastore.raft.bind-address=:{{ .Values.pyroscope.metastore.port }}"
|
||||
{{- end }}
|
||||
{{- if (not (hasKey $extraArgs "metastore.raft.server-id")) }}
|
||||
- "-metastore.raft.server-id=$(POD_NAME).$(PYROSCOPE_METASTORE_SERVICE)"
|
||||
{{- end }}
|
||||
{{- if (not (hasKey $extraArgs "metastore.raft.advertise-address")) }}
|
||||
- "-metastore.raft.advertise-address=$(POD_NAME).$(PYROSCOPE_METASTORE_SERVICE)"
|
||||
{{- end }}
|
||||
{{- if (not (hasKey $extraArgs "metastore.raft.server-id")) }}
|
||||
- "-metastore.raft.bootstrap-peers=dnssrvnoa+_raft._tcp.$(PYROSCOPE_METASTORE_SERVICE)"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* distributor specific v1/v2 migration config */}}
|
||||
{{- if or (eq $component "all") (eq $component "distributor") }}
|
||||
{{- if and $hasV2 (not (hasKey $extraArgs "write-path")) }}
|
||||
{{- if $hasV1 }}
|
||||
- "-write-path=combined"
|
||||
{{- if not (hasKey $extraArgs "write-path.segment-writer-weight") }}
|
||||
- "-write-path.segment-writer-weight=1"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- "-write-path=segment-writer"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- /* query-frontend specific v1/v2 migration config */}}
|
||||
{{- if or (eq $component "all") (eq $component "query-frontend") }}
|
||||
{{- if and $hasV2 (not (hasKey $extraArgs "enable-query-backend")) }}
|
||||
{{- if and $hasV1 $global.Values.architecture.storage.migration.queryBackend }}
|
||||
- "-enable-query-backend=true"
|
||||
{{- if and (not (hasKey $extraArgs "enable-query-backend-from")) $global.Values.architecture.storage.migration.queryBackendFrom }}
|
||||
- "-enable-query-backend-from={{$global.Values.architecture.storage.migration.queryBackendFrom}}"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- "-enable-query-backend=true"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: NAMESPACE_FQDN
|
||||
value: "{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}"
|
||||
{{- if and $hasV2 (not (hasKey $values.extraEnvVars "PYROSCOPE_V2_EXPERIMENT")) }}
|
||||
- name: PYROSCOPE_V2_EXPERIMENT
|
||||
value: "1"
|
||||
{{- end }}
|
||||
{{- if and $hasV2 (not (hasKey $values.extraEnvVars "PYROSCOPE_METASTORE_SERVICE")) }}
|
||||
- name: PYROSCOPE_METASTORE_SERVICE
|
||||
value: "{{ include "pyroscope.fullname" .}}{{ if $hasMetastore }}-metastore{{ end }}-headless.{{ .Release.Namespace }}.svc{{ .Values.pyroscope.cluster_domain }}:{{ .Values.pyroscope.metastore.port }}"
|
||||
{{- end }}
|
||||
{{- with $values.extraEnvVars }}
|
||||
{{- range $key, $value := . }}
|
||||
- name: {{ $key }}
|
||||
{{- if kindIs "map" $value }}
|
||||
{{- toYaml $value | nindent 14 }}
|
||||
{{- else }}
|
||||
value: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- with $values.extraCustomEnvVars }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $values.extraEnvFrom }}
|
||||
envFrom:
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: {{ $values.service.port_name }}
|
||||
containerPort: {{ $values.service.port }}
|
||||
protocol: TCP
|
||||
- name: {{ $values.memberlist.port_name }}
|
||||
containerPort: {{ $values.memberlist.port }}
|
||||
protocol: TCP
|
||||
{{- if $hasV2 }}
|
||||
- name: {{ $values.grpc.port_name }}
|
||||
containerPort: {{ $values.grpc.port }}
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
{{- if $isMetastore }}
|
||||
- name: {{ $values.metastore.port_name }}
|
||||
containerPort: {{ $values.metastore.port }}
|
||||
protocol: TCP
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: /ready
|
||||
port: {{ $values.service.port_name }}
|
||||
scheme: {{ $values.service.scheme }}
|
||||
{{- if ($values.readinessProbe).initialDelaySeconds }}
|
||||
initialDelaySeconds: {{ $values.readinessProbe.initialDelaySeconds }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: config
|
||||
mountPath: /etc/pyroscope/config.yaml
|
||||
subPath: config.yaml
|
||||
- name: overrides-config
|
||||
mountPath: /etc/pyroscope/overrides/
|
||||
- name: data
|
||||
mountPath: /data
|
||||
{{- if eq $component "compactor" }}
|
||||
subPath: default
|
||||
- name: data
|
||||
mountPath: /data-compactor
|
||||
subPath: compactor
|
||||
{{- end }}
|
||||
{{- if (and $hasV2 $values.persistence.shared.enabled) }}
|
||||
- name: data
|
||||
mountPath: /data-shared
|
||||
subPath: {{ $values.persistence.shared.subPath }}
|
||||
{{- end }}
|
||||
{{- if $isMetastore }}
|
||||
- name: data
|
||||
mountPath: /data-metastore
|
||||
subPath: {{ $values.persistence.metastore.subPath }}
|
||||
{{- end }}
|
||||
{{- with $values.extraVolumeMounts }}
|
||||
{{- toYaml . | nindent 12 }}
|
||||
{{- end }}
|
||||
resources:
|
||||
{{- if $global.Values.architecture.overwriteResources }}
|
||||
{{- toYaml $global.Values.architecture.overwriteResources | nindent 12 }}
|
||||
{{- else }}
|
||||
{{- toYaml $values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- with $values.extraContainers }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $values.topologySpreadConstraints }}
|
||||
topologySpreadConstraints:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if hasKey $values "priorityClassName" }}
|
||||
priorityClassName: {{ $values.priorityClassName | quote }}
|
||||
{{- end }}
|
||||
{{- if $values.terminationGracePeriodSeconds }}
|
||||
terminationGracePeriodSeconds: {{ $values.terminationGracePeriodSeconds }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- with $values.extraVolumes }}
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ include "pyroscope.fullname" . }}-config
|
||||
- name: overrides-config
|
||||
configMap:
|
||||
name: {{ include "pyroscope.fullname" . }}-overrides-config
|
||||
{{- $persistence := $values.persistence }}
|
||||
{{- if not $persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- else if $persistence.existingClaim}}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $persistence.existingClaim }}
|
||||
{{- else if ne $cfg.kind "StatefulSet"}}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ $cfg.name }}-data
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
annotations:
|
||||
{{- toYaml $persistence.annotations | nindent 8 }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- toYaml $persistence.accessModes | nindent 8 }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ $persistence.size | quote }}
|
||||
storageClassName: {{ $persistence.storageClassName }}
|
||||
{{- if $persistence.selector }}
|
||||
selector:
|
||||
{{- toYaml $persistence.selector | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $persistence.extraVolumeClaimTemplates }}
|
||||
{{- toYaml . | nindent 2 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
---
|
||||
{{- $pdb := $values.podDisruptionBudget }}
|
||||
{{- if $pdb.enabled }}
|
||||
apiVersion: policy/v1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ $cfg.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
spec:
|
||||
{{- if hasKey $pdb "minAvailable" }}
|
||||
minAvailable: {{ $pdb.minAvailable }}
|
||||
{{- else }}
|
||||
maxUnavailable: {{ $pdb.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,54 @@
|
||||
{{- $global := . }}
|
||||
{{- range $component, $cfg := (fromYaml (include "pyroscope.components" .)) }}
|
||||
{{- with $global }}
|
||||
{{- $autoScalingValues := mergeOverwrite (fromYaml (include "pyroscope.defaultAutoscalingComponents" .)) ($cfg.autoscaling | default dict) }}
|
||||
|
||||
{{- if $autoScalingValues.enabled }}
|
||||
---
|
||||
apiVersion: autoscaling/v2
|
||||
kind: HorizontalPodAutoscaler
|
||||
metadata:
|
||||
name: {{ $cfg.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
spec:
|
||||
scaleTargetRef:
|
||||
apiVersion: apps/v1
|
||||
kind: {{ $cfg.kind }}
|
||||
name: {{ $cfg.name }}
|
||||
minReplicas: {{ $autoScalingValues.minReplicas }}
|
||||
maxReplicas: {{ $autoScalingValues.maxReplicas }}
|
||||
metrics:
|
||||
{{- with $autoScalingValues.targetMemoryUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: memory
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $autoScalingValues.targetCPUUtilizationPercentage }}
|
||||
- type: Resource
|
||||
resource:
|
||||
name: cpu
|
||||
target:
|
||||
type: Utilization
|
||||
averageUtilization: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $autoScalingValues.customMetrics }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $autoScalingValues.behavior.enabled }}
|
||||
behavior:
|
||||
{{- with $autoScalingValues.behavior.scaleDown }}
|
||||
scaleDown: {{ toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- with $autoScalingValues.behavior.scaleUp }}
|
||||
scaleUp: {{ toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,118 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "pyroscope.fullname" . }}-ingress
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
{{- with .Values.ingress.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with .Values.ingress.className }}
|
||||
ingressClassName: {{ . }}
|
||||
{{- end }}
|
||||
{{- with .Values.ingress.tls }}
|
||||
tls:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
{{- range $.Values.ingress.hosts }}
|
||||
- host: {{ . | quote }}
|
||||
http:
|
||||
paths:
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-query-frontend
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-query-frontend
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /querier.v1.QuerierService/
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-query-frontend
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /render
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-query-frontend
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /render-diff
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-distributor
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /push.v1.PusherService/
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-distributor
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /ingest
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-tenant-settings
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /settings.v1.SettingsService/
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
- backend:
|
||||
service:
|
||||
{{- if gt (len $.Values.pyroscope.components) 1}}
|
||||
name: {{ include "pyroscope.fullname" $ }}-ad-hoc-profiles
|
||||
{{- else }}
|
||||
name: {{ include "pyroscope.fullname" $ }}
|
||||
{{- end }}
|
||||
port:
|
||||
number: {{ $.Values.pyroscope.service.port }}
|
||||
path: /adhocprofiles.v1.AdHocProfileService/
|
||||
pathType: {{ $.Values.ingress.pathType }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,20 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "pyroscope.fullname" . }}-memberlist
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: {{ .Values.pyroscope.memberlist.port_name }}
|
||||
port: {{ .Values.pyroscope.memberlist.port }}
|
||||
protocol: TCP
|
||||
targetPort: {{ .Values.pyroscope.memberlist.port }}
|
||||
publishNotReadyAddresses: true
|
||||
selector:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 4 }}
|
||||
# TODO: Ensure only services that offer memberlist register
|
||||
# pyroscope.grafana.com/memberlist: "true"
|
||||
@@ -0,0 +1,38 @@
|
||||
{{- $hasV2 := .Values.architecture.storage.v2 }}
|
||||
{{- if $hasV2 }}
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ template "pyroscope.fullname" . }}-discovery
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
- discovery.k8s.io
|
||||
resources:
|
||||
- endpointslices
|
||||
- endpoints
|
||||
- services
|
||||
- pods
|
||||
verbs:
|
||||
- get
|
||||
- watch
|
||||
- list
|
||||
---
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "pyroscope.fullname" . }}-discovery
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: Role
|
||||
name: {{ template "pyroscope.fullname" . }}-discovery
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ include "pyroscope.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,13 @@
|
||||
{{- if .Values.pyroscope.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "pyroscope.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
{{- with .Values.pyroscope.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,69 @@
|
||||
{{- if .Values.serviceMonitor.enabled }}
|
||||
{{- $global := . }}
|
||||
{{- $serviceMonitor := .Values.serviceMonitor }}
|
||||
{{- range $component, $cfg := (fromYaml (include "pyroscope.components" .)) }}
|
||||
{{- with $global }}
|
||||
{{- $values := mustMergeOverwrite (deepCopy .Values.pyroscope ) ($cfg | default dict)}}
|
||||
---
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ $cfg.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
{{- with $serviceMonitor.labels }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- with $serviceMonitor.namespaceSelector }}
|
||||
namespaceSelector:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
matchExpressions:
|
||||
- key: prometheus.io/service-monitor
|
||||
operator: NotIn
|
||||
values:
|
||||
- "false"
|
||||
{{- with $serviceMonitor.matchExpressions }}
|
||||
{{- toYaml . | nindent 6 }}
|
||||
{{- end }}
|
||||
endpoints:
|
||||
- port: {{ $values.service.port_name }}
|
||||
{{- with $serviceMonitor.interval }}
|
||||
interval: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.relabelings }}
|
||||
relabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.metricRelabelings }}
|
||||
metricRelabelings:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.scheme }}
|
||||
scheme: {{ . }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.tlsConfig }}
|
||||
tlsConfig:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with $serviceMonitor.targetLabels }}
|
||||
targetLabels:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,94 @@
|
||||
{{- $global := . }}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) }}
|
||||
{{- $hasV2 := $global.Values.architecture.storage.v2 }}
|
||||
{{- range $component, $cfg := $components }}
|
||||
{{- with $global }}
|
||||
{{- $values := mustMergeOverwrite (deepCopy .Values.pyroscope ) ($cfg | default dict)}}
|
||||
{{- $isMetastore := or (and (eq $component "all") ($hasV2)) (eq $component "metastore") }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $cfg.name }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
{{- if $values.service.annotations }}
|
||||
annotations:
|
||||
{{- toYaml $values.service.annotations | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ $values.service.type }}
|
||||
ports:
|
||||
- port: {{ $values.service.port }}
|
||||
targetPort: {{ $values.service.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.service.port_name }}
|
||||
{{- if $hasV2 }}
|
||||
- port: {{ $values.grpc.port }}
|
||||
targetPort: {{ $values.grpc.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.grpc.port_name }}
|
||||
{{- end }}
|
||||
{{- if $isMetastore }}
|
||||
- port: {{ $values.metastore.port }}
|
||||
targetPort: {{ $values.metastore.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.metastore.port_name }}
|
||||
{{- end }}
|
||||
{{- with $values.service.extraPorts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ $cfg.name }}-headless
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
{{- if or .Values.serviceMonitor.enabled $values.service.headlessAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.serviceMonitor.enabled }}
|
||||
prometheus.io/service-monitor: "false"
|
||||
{{- end }}
|
||||
{{- with $values.service.headlessAnnotations }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- port: {{ $values.service.port }}
|
||||
targetPort: {{ $values.service.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.service.port_name }}
|
||||
{{- if $hasV2 }}
|
||||
- port: {{ $values.grpc.port }}
|
||||
targetPort: {{ $values.grpc.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.grpc.port_name }}
|
||||
{{- end }}
|
||||
{{- if $isMetastore }}
|
||||
- port: {{ $values.metastore.port }}
|
||||
targetPort: {{ $values.metastore.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ $values.metastore.port_name }}
|
||||
{{- end }}
|
||||
{{- with $values.service.extraPorts }}
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or $values.service.publishNotReadyAddresses $isMetastore }}
|
||||
publishNotReadyAddresses: true
|
||||
{{- end }}
|
||||
selector:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: {{ $component | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,47 @@
|
||||
{{- $global := . }}
|
||||
{{- $components := (fromYaml (include "pyroscope.components" .)) }}
|
||||
{{- if $global.Values.architecture.deployUnifiedServices }}
|
||||
{{- /* There services are useful wanting to switch from single binary to microservices without reconfiguring the endpoints */}}
|
||||
{{- $hasDistributor := hasKey $components "distributor" }}
|
||||
{{- $hasQueryFrontend := hasKey $components "query-frontend" }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-write
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: "ClusterIP"
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: {{ .Values.pyroscope.service.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.pyroscope.service.port_name }}
|
||||
selector:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 4 }}
|
||||
{{- if $hasDistributor }}
|
||||
app.kubernetes.io/component: distributor
|
||||
{{- end }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ .Release.Name }}-read
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "pyroscope.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: "ClusterIP"
|
||||
ports:
|
||||
- port: 80
|
||||
targetPort: {{ .Values.pyroscope.service.port_name }}
|
||||
protocol: TCP
|
||||
name: {{ .Values.pyroscope.service.port_name }}
|
||||
selector:
|
||||
{{- include "pyroscope.selectorLabels" . | nindent 4 }}
|
||||
{{- if $hasQueryFrontend }}
|
||||
app.kubernetes.io/component: query-frontend
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
@@ -0,0 +1,113 @@
|
||||
# Default values for pyroscope.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
pyroscope:
|
||||
extraArgs:
|
||||
store-gateway.sharding-ring.replication-factor: "3"
|
||||
components:
|
||||
querier:
|
||||
kind: Deployment
|
||||
replicaCount: 3
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 2
|
||||
maxReplicas: 4
|
||||
targetMemoryUtilizationPercentage: 60
|
||||
targetCPUUtilizationPercentage: null
|
||||
behavior:
|
||||
enabled: true
|
||||
scaleDown:
|
||||
stabilizationWindowSeconds: 60
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 1
|
||||
query-frontend:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 2
|
||||
maxReplicas: 4
|
||||
targetMemoryUtilizationPercentage: 60
|
||||
targetCPUUtilizationPercentage: null
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
query-scheduler:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 2
|
||||
maxReplicas: 4
|
||||
targetCPUUtilizationPercentage: 40
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
distributor:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
autoscaling:
|
||||
enabled: true
|
||||
minReplicas: 2
|
||||
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 500m
|
||||
ingester:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 600
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
compactor:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 1200
|
||||
persistence:
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
store-gateway:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
persistence:
|
||||
# The store-gateway needs not need persistent storage, but we still run it as a StatefulSet
|
||||
# This is to avoid having blocks of data being
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
readinessProbe:
|
||||
# The store gateway can be configured to wait on startup for ring stability to be reached before it becomes
|
||||
# ready. See the `store-gateway.sharding-ring.wait-stability-min-duration` server argument for more information.
|
||||
#
|
||||
# Depending on this flag and the number of tenants + blocks that need to be synced on startup, pods can take
|
||||
# some time to become ready. This value can be used to ensure Kubernetes waits long enough and reduce errors.
|
||||
initialDelaySeconds: 60
|
||||
minio:
|
||||
enabled: true
|
||||
@@ -0,0 +1,106 @@
|
||||
# Default values for pyroscope.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
pyroscope:
|
||||
extraArgs:
|
||||
store-gateway.sharding-ring.replication-factor: "3"
|
||||
components:
|
||||
querier:
|
||||
kind: Deployment
|
||||
replicaCount: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 1
|
||||
query-frontend:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
query-scheduler:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
distributor:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 500m
|
||||
ingester:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 600
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
compactor:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 1200
|
||||
persistence:
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
store-gateway:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
persistence:
|
||||
# The store-gateway needs not need persistent storage, but we still run it as a StatefulSet
|
||||
# This is to avoid having blocks of data being
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
readinessProbe:
|
||||
# The store gateway can be configured to wait on startup for ring stability to be reached before it becomes
|
||||
# ready. See the `store-gateway.sharding-ring.wait-stability-min-duration` server argument for more information.
|
||||
#
|
||||
# Depending on this flag and the number of tenants + blocks that need to be synced on startup, pods can take
|
||||
# some time to become ready. This value can be used to ensure Kubernetes waits long enough and reduce errors.
|
||||
initialDelaySeconds: 60
|
||||
tenant-settings:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
ad-hoc-profiles:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
minio:
|
||||
enabled: true
|
||||
@@ -0,0 +1,569 @@
|
||||
# Default values for pyroscope.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
global:
|
||||
# -- Overrides the Docker registry globally for all images
|
||||
imageRegistry: null
|
||||
|
||||
|
||||
pyroscope:
|
||||
replicaCount: 1
|
||||
|
||||
# -- Enable or disable Self profile push, useful to test
|
||||
disableSelfProfile: true
|
||||
|
||||
# -- Kubernetes cluster domain suffix for DNS discovery
|
||||
cluster_domain: .cluster.local.
|
||||
|
||||
image:
|
||||
registry: ''
|
||||
repository: grafana/pyroscope
|
||||
pullPolicy: IfNotPresent
|
||||
# Allows to override the image tag, which defaults to the appVersion in the chart metadata
|
||||
tag: ""
|
||||
|
||||
extraArgs:
|
||||
log.level: debug
|
||||
|
||||
extraLabels: {}
|
||||
|
||||
extraEnvVars:
|
||||
{}
|
||||
# The following environment variables are set by the Helm chart.
|
||||
# JAEGER_AGENT_HOST: jaeger-agent.jaeger.svc.cluster.local.
|
||||
|
||||
extraCustomEnvVars: {}
|
||||
# The following environment variables raw form.
|
||||
# - name: MY_NODE_NAME
|
||||
# valueFrom:
|
||||
# fieldRef:
|
||||
# fieldPath: spec.nodeName
|
||||
|
||||
# -- Environment variables from secrets or configmaps to add to the pods
|
||||
extraEnvFrom: []
|
||||
|
||||
imagePullSecrets: []
|
||||
dnsPolicy: ClusterFirst
|
||||
initContainers: []
|
||||
extraContainers: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations:
|
||||
# Scrapes itself see https://grafana.com/docs/pyroscope/latest/deploy-kubernetes/helm/#optional-scrape-your-own-workloads-profiles
|
||||
profiles.grafana.com/memory.scrape: "true"
|
||||
profiles.grafana.com/memory.port_name: http2
|
||||
profiles.grafana.com/cpu.scrape: "true"
|
||||
profiles.grafana.com/cpu.port_name: http2
|
||||
profiles.grafana.com/goroutine.scrape: "true"
|
||||
profiles.grafana.com/goroutine.port_name: http2
|
||||
# profiles.grafana.com/block.scrape: "true"
|
||||
# profiles.grafana.com/mutex.scrape: "true"
|
||||
|
||||
podSecurityContext:
|
||||
fsGroup: 10001
|
||||
runAsUser: 10001
|
||||
runAsNonRoot: true
|
||||
|
||||
podDisruptionBudget:
|
||||
enabled: true
|
||||
maxUnavailable: 1
|
||||
|
||||
securityContext:
|
||||
{}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 4040
|
||||
port_name: http2
|
||||
scheme: HTTP
|
||||
annotations: {}
|
||||
headlessAnnotations: {}
|
||||
|
||||
memberlist:
|
||||
port: 7946
|
||||
port_name: memberlist
|
||||
|
||||
grpc:
|
||||
port: 9095
|
||||
port_name: grpc
|
||||
|
||||
metastore:
|
||||
port: 9099
|
||||
port_name: raft
|
||||
|
||||
resources:
|
||||
{}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources'.
|
||||
#
|
||||
# Note that if memory consumption is higher than you would like, you can decrease the interval
|
||||
# that profiles are written into blocks by setting `pyroscopedb.max-block-duration` in the `extraArgs`
|
||||
# stanza. By default, it is set to 3h - override it, for example, as below:
|
||||
# ```
|
||||
# extraArgs:
|
||||
# pyroscopedb.max-block-duration: 30m
|
||||
# ```
|
||||
#
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
# -- Topology Spread Constraints
|
||||
topologySpreadConstraints: []
|
||||
|
||||
## ref: https://kubernetes.io/docs/concepts/storage/persistent-volumes/
|
||||
## If you set enabled as "True", you need :
|
||||
## - create a pv which above 10Gi and has same namespace with pyroscope
|
||||
## - keep storageClassName same with below setting
|
||||
persistence:
|
||||
enabled: false
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 10Gi
|
||||
annotations: {}
|
||||
# selector:
|
||||
# matchLabels:
|
||||
# app.kubernetes.io/name: pyroscope
|
||||
# subPath: ""
|
||||
# existingClaim:
|
||||
|
||||
metastore:
|
||||
# subPath to use of the data volume for the metastore persistence.
|
||||
subPath: .metastore
|
||||
|
||||
shared:
|
||||
enabled: true
|
||||
# subPath to use of the data volume for the shared storage used as bucket replacement.
|
||||
subPath: .shared
|
||||
|
||||
extraVolumes:
|
||||
[]
|
||||
# - name: backup-volume
|
||||
# emptydir: {}
|
||||
|
||||
extraVolumeMounts:
|
||||
[]
|
||||
# - name: testing
|
||||
# mountPath: /var/lib/testing
|
||||
# readOnly: false
|
||||
# - name: test-volume
|
||||
# mountPath: /var/tmp/test-volume
|
||||
# existingClaim: test-volume
|
||||
# readOnly: false
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
|
||||
# Override the PodPriorityClass
|
||||
# priorityClassName: high
|
||||
|
||||
# run specific components separately
|
||||
components: {}
|
||||
|
||||
# -- Allows to override Pyroscope's configuration using structured format.
|
||||
structuredConfig: {}
|
||||
|
||||
# -- Contains Pyroscope's configuration as a string.
|
||||
# @default -- The config depends on other values been set, details can be found in [`values.yaml`](./values.yaml)
|
||||
config: |
|
||||
{{- if .Values.minio.enabled }}
|
||||
storage:
|
||||
backend: s3
|
||||
s3:
|
||||
endpoint: "{{ include "pyroscope.fullname" . }}-minio:9000"
|
||||
bucket_name: {{(index .Values.minio.buckets 0).name | quote }}
|
||||
access_key_id: {{ .Values.minio.rootUser | quote }}
|
||||
secret_access_key: {{ .Values.minio.rootPassword | quote }}
|
||||
insecure: true
|
||||
{{- end }}
|
||||
|
||||
# -- Allows to add tenant specific overrides to the default limit configuration.
|
||||
tenantOverrides:
|
||||
{}
|
||||
# "foo":
|
||||
# ingestion_rate_mb: 1
|
||||
# ingestion_burst_size_mb: 2
|
||||
# -- Grafana Agent Configuration.
|
||||
|
||||
|
||||
architecture:
|
||||
storage:
|
||||
# -- (bool) Enable v1 storage layer.
|
||||
v1: true
|
||||
# -- (bool) Enable v2 storage layer.
|
||||
v2: false
|
||||
|
||||
migration:
|
||||
# -- (float) Specifies the fraction [0:1] that should be send to the v1 write path / ingester in combined mode. 0 means no traffics is sent to ingester. 1 means 100% of requests are sent to ingester.
|
||||
ingesterWeight: 1.0
|
||||
# -- (float) Specifies the fraction [0:1] that should be send to the v2 write path / segment-writer in combined mode. 0 means no traffics is sent to segment-writer. 1 means 100% of requests are sent to segment-writer.
|
||||
segmentWriterWeight: 1.0
|
||||
|
||||
# -- (bool) Specify a time stamp from when the v2 read path should serve traffic.
|
||||
queryBackend: true
|
||||
# -- (string) Specify a time stamp from when the v2 read path should serve traffic.
|
||||
queryBackendFrom: auto
|
||||
|
||||
# -- This flag is useful for testing, it will overwrite all pods resource statements with its contents
|
||||
overwriteResources:
|
||||
{}
|
||||
# limits: {}
|
||||
# requests: {}
|
||||
|
||||
|
||||
# -- Deploy unified write/read services. These endpoints will can be used no matter if the helm chart is configured as single-binary or microservices
|
||||
deployUnifiedServices: false
|
||||
|
||||
microservices:
|
||||
# -- (bool) Enable micro-services deployment mode. This is recommend for larger scale deployment and allow right size each aspect of Pyroscope.
|
||||
enabled: false
|
||||
|
||||
# -- (string) Memberlist cluster label that will be used for all members of this cluster
|
||||
clusterLabelSuffix: -micro-services
|
||||
|
||||
# -- @ignored
|
||||
# Not useful to be indivually exposed
|
||||
v1:
|
||||
querier:
|
||||
kind: Deployment
|
||||
replicaCount: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 1
|
||||
extraArgs:
|
||||
store-gateway.sharding-ring.replication-factor: "3"
|
||||
query-frontend:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
query-scheduler:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
distributor:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 500m
|
||||
ingester:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 600
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
compactor:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 1200
|
||||
persistence:
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
store-gateway:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
persistence:
|
||||
# The store-gateway needs not need persistent storage, but we still run it as a StatefulSet
|
||||
# This is to avoid having blocks of data being
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 16Gi
|
||||
requests:
|
||||
memory: 8Gi
|
||||
cpu: 1
|
||||
readinessProbe:
|
||||
# The store gateway can be configured to wait on startup for ring stability to be reached before it becomes
|
||||
# ready. See the `store-gateway.sharding-ring.wait-stability-min-duration` server argument for more information.
|
||||
#
|
||||
# Depending on this flag and the number of tenants + blocks that need to be synced on startup, pods can take
|
||||
# some time to become ready. This value can be used to ensure Kubernetes waits long enough and reduce errors.
|
||||
initialDelaySeconds: 60
|
||||
extraArgs:
|
||||
store-gateway.sharding-ring.replication-factor: "3"
|
||||
tenant-settings:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
ad-hoc-profiles:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
# -- @ignored
|
||||
# Not useful to be indivually exposed
|
||||
v2:
|
||||
query-backend:
|
||||
kind: Deployment
|
||||
replicaCount: 3
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 1
|
||||
query-frontend:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 100m
|
||||
distributor:
|
||||
kind: Deployment
|
||||
replicaCount: 2
|
||||
resources:
|
||||
limits:
|
||||
memory: 1Gi
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 500m
|
||||
segment-writer:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 600
|
||||
resources:
|
||||
limits:
|
||||
memory: 4Gi
|
||||
requests:
|
||||
memory: 2Gi
|
||||
cpu: 1
|
||||
compaction-worker:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 1200
|
||||
persistence:
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 1
|
||||
metastore:
|
||||
kind: StatefulSet
|
||||
replicaCount: 3
|
||||
terminationGracePeriodSeconds: 1200
|
||||
persistence:
|
||||
enabled: false
|
||||
resources:
|
||||
limits:
|
||||
memory: 2Gi
|
||||
requests:
|
||||
memory: 1Gi
|
||||
cpu: 1
|
||||
extraArgs:
|
||||
# Expect 3 metastores
|
||||
metastore.raft.bootstrap-expect-peers: 3
|
||||
# TODO(kolesnikovae): Update defaults.
|
||||
adaptive-placement.max-dataset-shards: 1024
|
||||
adaptive-placement.unit-size-bytes: 131072
|
||||
# enable cleanup of blocks beyond retention
|
||||
metastore.index.cleanup-interval: 1m
|
||||
metastore.snapshot-compact-on-restore: true
|
||||
tenant-settings:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 256Mi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
ad-hoc-profiles:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 256Mi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
admin:
|
||||
kind: Deployment
|
||||
replicaCount: 1
|
||||
resources:
|
||||
limits:
|
||||
memory: 256Mi
|
||||
requests:
|
||||
memory: 16Mi
|
||||
cpu: 0.1
|
||||
|
||||
# -------------------------------------
|
||||
# Configuration for `alloy` child chart
|
||||
# -------------------------------------
|
||||
alloy:
|
||||
enabled: true
|
||||
controller:
|
||||
type: "statefulset"
|
||||
replicas: 1
|
||||
podAnnotations:
|
||||
profiles.grafana.com/memory.scrape: "true"
|
||||
profiles.grafana.com/memory.port_name: "http-metrics"
|
||||
profiles.grafana.com/cpu.scrape: "true"
|
||||
profiles.grafana.com/cpu.port_name: "http-metrics"
|
||||
profiles.grafana.com/goroutine.scrape: "true"
|
||||
profiles.grafana.com/goroutine.port_name: "http-metrics"
|
||||
profiles.grafana.com/service_repository: 'https://github.com/grafana/alloy'
|
||||
profiles.grafana.com/service_git_ref: 'v1.8.1'
|
||||
|
||||
alloy:
|
||||
stabilityLevel: "public-preview" # This needs to be set for some of our resources until verison v1.2 is released
|
||||
configMap:
|
||||
create: false
|
||||
name: alloy-config-pyroscope
|
||||
clustering:
|
||||
enabled: true
|
||||
|
||||
# -------------------------------------
|
||||
# Configuration for `grafana-agent` child chart
|
||||
# -------------------------------------
|
||||
agent:
|
||||
enabled: false
|
||||
controller:
|
||||
type: "statefulset"
|
||||
replicas: 1
|
||||
podAnnotations:
|
||||
profiles.grafana.com/memory.scrape: "true"
|
||||
profiles.grafana.com/memory.port_name: "http-metrics"
|
||||
profiles.grafana.com/cpu.scrape: "true"
|
||||
profiles.grafana.com/cpu.port_name: "http-metrics"
|
||||
profiles.grafana.com/goroutine.scrape: "true"
|
||||
profiles.grafana.com/goroutine.port_name: "http-metrics"
|
||||
agent:
|
||||
configMap:
|
||||
create: false
|
||||
name: grafana-agent-config-pyroscope
|
||||
clustering:
|
||||
enabled: true
|
||||
|
||||
# -------------------------------------
|
||||
# Configuration for `minio` child chart
|
||||
# -------------------------------------
|
||||
minio:
|
||||
enabled: false
|
||||
replicas: 1
|
||||
# Minio requires 2 to 16 drives for erasure code (drivesPerNode * replicas)
|
||||
# https://docs.min.io/docs/minio-erasure-code-quickstart-guide
|
||||
# Since we only have 1 replica, that means 2 drives must be used.
|
||||
drivesPerNode: 2
|
||||
rootUser: grafana-pyroscope
|
||||
rootPassword: supersecret
|
||||
buckets:
|
||||
- name: grafana-pyroscope-data
|
||||
policy: none
|
||||
purge: false
|
||||
persistence:
|
||||
size: 5Gi
|
||||
resources:
|
||||
requests:
|
||||
cpu: 100m
|
||||
memory: 128Mi
|
||||
podAnnotations: {}
|
||||
|
||||
ingress:
|
||||
enabled: false
|
||||
className: ""
|
||||
pathType: ImplementationSpecific
|
||||
# Additional labels to add to the ingress resource
|
||||
labels: {}
|
||||
# Additional annotations to add to the ingress resource
|
||||
annotations: {}
|
||||
# hosts:
|
||||
# - localhost
|
||||
# tls:
|
||||
# - secretName: certificate
|
||||
|
||||
# ServiceMonitor configuration
|
||||
serviceMonitor:
|
||||
# -- If enabled, ServiceMonitor resources for Prometheus Operator are created
|
||||
enabled: false
|
||||
# -- Namespace selector for ServiceMonitor resources
|
||||
namespaceSelector: {}
|
||||
# -- Optional expressions to match on
|
||||
matchExpressions: []
|
||||
# - key: prometheus.io/service-monitor
|
||||
# operator: NotIn
|
||||
# values:
|
||||
# - "false"
|
||||
# -- ServiceMonitor annotations
|
||||
annotations: {}
|
||||
# -- Additional ServiceMonitor labels
|
||||
labels: {}
|
||||
# -- ServiceMonitor scrape interval
|
||||
interval: null
|
||||
# -- ServiceMonitor scrape timeout in Go duration format (e.g. 15s)
|
||||
scrapeTimeout: null
|
||||
# -- ServiceMonitor relabel configs to apply to samples before scraping
|
||||
# https://github.com/prometheus-operator/prometheus-operator/blob/master/Documentation/api.md#relabelconfig
|
||||
relabelings: []
|
||||
# -- ServiceMonitor metric relabel configs to apply to samples before ingestion
|
||||
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#endpoint
|
||||
metricRelabelings: []
|
||||
# --ServiceMonitor will add labels from the service to the Prometheus metric
|
||||
# https://github.com/prometheus-operator/prometheus-operator/blob/main/Documentation/api.md#servicemonitorspec
|
||||
targetLabels: []
|
||||
# -- ServiceMonitor will use http by default, but you can pick https as well
|
||||
scheme: http
|
||||
# -- ServiceMonitor will use these tlsConfig settings to make the health check requests
|
||||
tlsConfig: null
|
||||
Reference in New Issue
Block a user