Skip to content

Commit

Permalink
* coroot v0.27.0
Browse files Browse the repository at this point in the history
* node-agent v1.17.0
* +coroot-cluster-agent v0.1.0
* -pyroscope
  • Loading branch information
apetruhin committed Jan 18, 2024
1 parent eb8eb1d commit ef1aaf9
Show file tree
Hide file tree
Showing 6 changed files with 175 additions and 81 deletions.
10 changes: 3 additions & 7 deletions charts/coroot/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,17 @@ apiVersion: v2
name: coroot
description: A monitoring and troubleshooting tool for microservice architectures.
type: application
version: 0.7.6
appVersion: "0.26.0"
version: 0.8.0
appVersion: "0.27.0"
dependencies:
- name: prometheus
repository: https://prometheus-community.github.io/helm-charts
version: 15.16.*
condition: prometheus.enabled
- name: node-agent
version: 0.1.53
version: 0.1.54
repository: https://coroot.github.io/helm-charts
condition: node-agent.enabled
- name: pyroscope
repository: https://pyroscope-io.github.io/helm-chart
version: 0.2.*
condition: pyroscope.enabled
- name: clickhouse
version: 3.1.*
repository: https://charts.bitnami.com/bitnami
Expand Down
31 changes: 20 additions & 11 deletions charts/coroot/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Expand the name of the chart.
{{- define "coroot.name" -}}
{{- default .Chart.Name .Values.corootCE.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- define "coroot.namespace" -}}
{{- .Release.Namespace -}}
{{- end -}}

{{/*
Create a default fully qualified app name.
Expand Down Expand Up @@ -78,6 +81,23 @@ app.kubernetes.io/version: {{ .Values.corootConnect.image.tag | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Coroot Cluster Agent
*/}}
{{- define "corootClusterAgent.name" -}}
{{- printf "%s-cluster-agent" .Release.Name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- define "corootClusterAgent.selectorLabels" -}}
app.kubernetes.io/name: {{ include "corootClusterAgent.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
{{- define "corootClusterAgent.labels" -}}
helm.sh/chart: {{ include "coroot.chart" . }}
{{ include "corootClusterAgent.selectorLabels" . }}
app.kubernetes.io/version: {{ .Values.corootClusterAgent.image.tag | quote }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Create a fully qualified Prometheus server name
in a similar way as prometheus/templates/_helpers.tpl creates "prometheus.server.fullname".
Expand All @@ -90,17 +110,6 @@ in a similar way as prometheus/templates/_helpers.tpl creates "prometheus.server
{{- end -}}
{{- end -}}

{{/*
Create a default fully qualified Pyroscope name.
*/}}
{{- define "coroot.pyroscope.fullname" -}}
{{- if .Values.pyroscope.fullnameOverride }}
{{- .Values.pyroscope.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-pyroscope" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}

{{/*
Create a default fully qualified Clickhouse name.
*/}}
Expand Down
119 changes: 119 additions & 0 deletions charts/coroot/templates/cluster-agent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
{{- if .Values.corootClusterAgent.enabled -}}
apiVersion: v1
kind: ServiceAccount
metadata:
name: {{ include "corootClusterAgent.name" . }}
labels:
{{- include "corootClusterAgent.labels" . | nindent 4 }}

---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "corootClusterAgent.name" . }}
subjects:
- kind: ServiceAccount
name: {{ include "corootClusterAgent.name" . }}
namespace: {{ include "coroot.namespace" . }}
roleRef:
kind: ClusterRole
name: view
apiGroup: rbac.authorization.k8s.io

---

apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "corootClusterAgent.name" . }}
labels:
{{- include "corootClusterAgent.labels" . | nindent 4 }}
data:
config.yaml: |
{{- toYaml .Values.corootClusterAgent.config | nindent 4 }}

---

apiVersion: v1
kind: Service
metadata:
name: {{ include "corootClusterAgent.name" . }}
labels:
{{- include "corootClusterAgent.labels" . | nindent 4 }}
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
selector:
{{- include "corootClusterAgent.selectorLabels" . | nindent 6 }}

---

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "corootClusterAgent.name" . }}
labels:
{{- include "corootClusterAgent.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "corootClusterAgent.selectorLabels" . | nindent 6 }}
template:
metadata:
annotations:
checksum/config: {{ toYaml .Values.corootClusterAgent.config | sha256sum }}
{{- with .Values.corootClusterAgent.podAnnotations }}
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "corootClusterAgent.selectorLabels" . | nindent 8 }}
spec:
{{- with .Values.corootClusterAgent.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "corootClusterAgent.name" . }}
securityContext:
{{- toYaml .Values.corootClusterAgent.podSecurityContext | nindent 8 }}
containers:
- name: cluster-agent
securityContext:
{{- toYaml .Values.corootClusterAgent.securityContext | nindent 12 }}
image: "{{ .Values.corootClusterAgent.image.repository }}:{{ .Values.corootClusterAgent.image.tag }}"
imagePullPolicy: {{ .Values.corootClusterAgent.image.pullPolicy }}
env:
- name: CLICKHOUSE_PASSWORD
valueFrom:
secretKeyRef:
name: {{ include "coroot.clickhouse.fullname" . }}
key: admin-password
{{- with .Values.corootClusterAgent.env }}
{{- . | toYaml | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.corootClusterAgent.resources | nindent 12 }}
volumeMounts:
- name: config
mountPath: /config.yaml
subPath: config.yaml
volumes:
- name: config
configMap:
name: {{ include "corootClusterAgent.name" . }}
{{- with .Values.corootClusterAgent.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.corootClusterAgent.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.corootClusterAgent.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
4 changes: 0 additions & 4 deletions charts/coroot/templates/connect.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ spec:
value: /tmp/config.yaml
- name: PROMETHEUS_URL
value: {{ printf "http://%s:%s" (include "coroot.prometheus.server.fullname" .) (.Values.prometheus.server.service.servicePort | toString ) }}
{{- if .Values.pyroscope.enabled }}
- name: PYROSCOPE_URL
value: {{ printf "http://%s:%s" (include "coroot.pyroscope.fullname" .) (.Values.pyroscope.service.port | toString ) }}
{{- end }}
{{- if and .Values.clickhouse.enabled }}
- name: CLICKHOUSE_ADDRESS
value: {{ printf "%s:%s" (include "coroot.clickhouse.fullname" .) (.Values.clickhouse.service.ports.tcp | toString ) }}
Expand Down
4 changes: 0 additions & 4 deletions charts/coroot/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ spec:
- --bootstrap-refresh-interval={{ .Values.corootCE.bootstrap.refreshInterval }}
{{- end }}
env:
{{- if and .Values.pyroscope.enabled }}
- name: BOOTSTRAP_PYROSCOPE_URL
value: {{ printf "http://%s:%s" (include "coroot.pyroscope.fullname" .) (.Values.pyroscope.service.port | toString ) }}
{{- end }}
{{- if and .Values.clickhouse.enabled }}
- name: BOOTSTRAP_CLICKHOUSE_ADDRESS
value: {{ printf "%s:%s" (include "coroot.clickhouse.fullname" .) (.Values.clickhouse.service.ports.tcp | toString ) }}
Expand Down
88 changes: 33 additions & 55 deletions charts/coroot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@ corootConnect:
prometheus:
url: ${PROMETHEUS_URL}
refresh_interval: 15s
pyroscope:
url: ${PYROSCOPE_URL}
clickhouse:
addr: ${CLICKHOUSE_ADDRESS}
auth:
Expand All @@ -102,6 +100,38 @@ corootConnect:
affinity: {}
env: []

corootClusterAgent:
enabled: true
config:
listen: :8080
clickhouse:
address: coroot-clickhouse:9000
database: default
auth:
user: default
password: ${CLICKHOUSE_PASSWORD}
profiles:
ttl_days: 7
scrape:
interval: 1m
image:
repository: ghcr.io/coroot/coroot-cluster-agent
pullPolicy: IfNotPresent
tag: "0.1.0"
imagePullSecrets: []
podAnnotations: {}
podSecurityContext: {}
securityContext: {}
resources:
requests:
cpu: 100m
memory: 1Gi
nodeSelector: {}
tolerations: []
affinity: {}
env: []


prometheus:
enabled: true
alertmanager:
Expand Down Expand Up @@ -379,59 +409,7 @@ node-agent:
tracesEndpoint: "http://coroot-opentelemetry-collector:4318/v1/traces"
logsEndpoint: "http://coroot-opentelemetry-collector:4318/v1/logs"
profiling:
pyroscopeEndpoint: "http://coroot-pyroscope:4040/ingest"

pyroscope:
enabled: true
persistence:
enabled: true
size: 30Gi
rbac:
create: true
pyroscopeConfigs:
retention: 8h
retention-levels:
0: 1h
1: 4h
2: 8h
log-level: debug
scrape-configs:
- job-name: 'kubernetes-pods'
enabled-profiles: [cpu, mem]
kubernetes-sd-configs:
- role: pod
relabel-configs:
- source-labels: [ __meta_kubernetes_pod_annotation_pyroscope_io_scrape ]
action: keep
regex: true
- source-labels:
[ __meta_kubernetes_pod_annotation_pyroscope_io_application_name ]
action: replace
target-label: __name__
- source-labels: [ __meta_kubernetes_pod_annotation_pyroscope_io_scheme ]
action: replace
regex: (https?)
target-label: __scheme__
- source-labels:
[ __address__, __meta_kubernetes_pod_annotation_pyroscope_io_port ]
action: replace
regex: ([^:]+)(?::\d+)?;(\d+)
replacement: $1:$2
target-label: __address__
- action: labelmap
regex: __meta_kubernetes_pod_label_(.+)
- source-labels: [ __meta_kubernetes_namespace ]
action: replace
target-label: namespace
- source-labels: [ __meta_kubernetes_pod_name ]
action: replace
target-label: pod
- source-labels: [ __meta_kubernetes_pod_phase ]
regex: Pending|Succeeded|Failed|Completed
action: drop
- action: labelmap
regex: __meta_kubernetes_pod_annotation_pyroscope_io_profile_(.+)
replacement: __profile_$1
profilesEndpoint: "http://coroot-cluster-agent:8080/profiles"

clickhouse:
enabled: true
Expand Down

0 comments on commit ef1aaf9

Please sign in to comment.