Skip to content

Commit

Permalink
Update charts/opentelemetry-ebpf/Chart.yaml
Browse files Browse the repository at this point in the history
Co-authored-by: Tyler Helmuth <[email protected]>
  • Loading branch information
nicolastakashi and TylerHelmuth committed Nov 17, 2023
1 parent 83f5d98 commit cd9cd01
Show file tree
Hide file tree
Showing 10 changed files with 83 additions and 57 deletions.
5 changes: 2 additions & 3 deletions charts/opentelemetry-ebpf/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ description: OpenTelemetry eBPF Helm chart for Kubernetes
type: application
home: https://opentelemetry.io/
sources:
- https://github.com/open-telemetry/opentelemetry-collector
- https://github.com/open-telemetry/opentelemetry-collector-contrib
- https://github.com/open-telemetry/opentelemetry-ebpf
maintainers:
- name: dmitryax
- name: TylerHelmuth
icon: https://opentelemetry.io/img/logos/opentelemetry-logo-nav.png
appVersion: 0.10.0
appVersion: v0.10.0
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cloudCollector:
enabled: true

otelCollector:
endpoint:
address: example-opentelemetry-collector
21 changes: 20 additions & 1 deletion charts/opentelemetry-ebpf/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -135,4 +135,23 @@ Fully qualified app name for the reducer deployment.
{{- else -}}
{{- printf "%s-%s-reducer" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{- end -}}
{{- end -}}

{{/* Build the list of port for service */}}
{{- define "opentelemetry-collector-reducer.servicePortsConfig" -}}
{{- $ports := deepCopy .Values.reducer.service.ports }}
{{- range $key, $port := $ports }}
{{- if $port.enabled }}
- name: {{ $key }}
port: {{ $port.servicePort }}
targetPort: {{ $port.containerPort }}
protocol: {{ $port.protocol }}
{{- if $port.appProtocol }}
appProtocol: {{ $port.appProtocol }}
{{- end }}
{{- if $port.nodePort }}
nodePort: {{ $port.nodePort }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ spec:
{{- end }}
{{- end }}
containers:
- image: "{{ default .Values.images.repository .Values.cloudCollector.image.repository }}/{{ .Values.cloudCollector.image.name }}:{{ default .Values.images.tag .Values.cloudCollector.image.tag }}"
imagePullPolicy: {{ .Values.images.pullPolicy }}
- image: "{{ default .Values.image.registry .Values.cloudCollector.image.registry }}/{{ .Values.cloudCollector.image.name }}:{{ default .Values.image.tag .Values.cloudCollector.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: cloud-collector
{{- if hasKey .Values.cloudCollector "resources" }}
resources:
Expand Down Expand Up @@ -74,7 +74,7 @@ spec:
- name: "EBPF_NET_INTAKE_HOST"
value: {{ include "opentelemetry-collector-reducer.fullname" . }}
- name: "EBPF_NET_INTAKE_PORT"
value: "{{ default 7000 .Values.reducer.telemetryPort }}"
value: "{{ default 7000 .Values.reducer.service.ports.telemetry.port }}"
{{- if hasKey .Values "debug" }}
{{- if (default false .Values.debug.storeMinidump) }}
- name: "EBPF_NET_MINIDUMP_DIR"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ spec:
{{- end }}
{{- end }}
containers:
- image: "{{ default .Values.images.repository .Values.k8sCollector.watcher.image.repository }}/{{ .Values.k8sCollector.watcher.image.name }}:{{ default .Values.images.tag .Values.k8sCollector.watcher.image.tag }}"
imagePullPolicy: {{ .Values.images.pullPolicy }}
- image: "{{ default .Values.image.registry .Values.k8sCollector.watcher.image.repository }}/{{ .Values.k8sCollector.watcher.image.name }}:{{ default .Values.image.tag .Values.k8sCollector.watcher.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: k8s-watcher
{{- if hasKey .Values.k8sCollector.watcher "resources" }}
resources:
Expand All @@ -52,8 +52,8 @@ spec:
# k8s-relay, which is a service that the k8s-watcher talks to.
# Currently not configurable, has to be reachable on localhost:8172, so must
# share a pod with the k8s-watcher above.
- image: "{{ default .Values.images.repository .Values.k8sCollector.relay.image.repository }}/{{ .Values.k8sCollector.relay.image.name }}:{{ default .Values.images.tag .Values.k8sCollector.relay.image.tag }}"
imagePullPolicy: {{ .Values.images.pullPolicy }}
- image: "{{ default .Values.image.registry .Values.k8sCollector.relay.image.registry }}/{{ .Values.k8sCollector.relay.image.name }}:{{ default .Values.image.tag .Values.k8sCollector.relay.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
name: k8s-relay
{{- if hasKey .Values.k8sCollector.relay "resources" }}
resources:
Expand Down Expand Up @@ -99,7 +99,7 @@ spec:
- name: "EBPF_NET_INTAKE_HOST"
value: {{ include "opentelemetry-collector-reducer.fullname" . }}
- name: "EBPF_NET_INTAKE_PORT"
value: "{{ default 7000 .Values.reducer.telemetryPort }}"
value: "{{ default 7000 .Values.reducer.service.ports.telemetry.port }}"
{{- if hasKey .Values "debug" }}
{{- if (default false .Values.debug.storeMinidump) }}
- name: "EBPF_NET_MINIDUMP_DIR"
Expand All @@ -108,9 +108,9 @@ spec:
{{- end }}
{{- if and .Values.debug.enabled .Values.debug.sendUnplannedExitMetric }}
- name: "EBPF_NET_CRASH_METRIC_HOST"
value: {{ .Values.otelCollector.address }}
value: {{ .Values.endpoint.address }}
- name: "EBPF_NET_CRASH_METRIC_PORT"
value: {{ .Values.otelCollector.port | default 4317 }}
value: {{ .Values.endpoint.port | default 4317 }}
{{- end }}
{{- if .Values.k8sCollector.relay.env }}
{{ toYaml .Values.k8sCollector.relay.env | indent 10 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ spec:
template:
metadata:
annotations:
release_number: "3"
charts.flowmill.com/version: {{ .Chart.Version }}
labels:
app.kubernetes.io/name: {{ include "opentelemetry-collector-kernel-collector.fullname" . }}
Expand All @@ -31,8 +30,8 @@ spec:
{{- end }}
containers:
- name: kernel-collector
image: "{{ default .Values.images.repository .Values.kernelCollector.image.repository }}/{{ .Values.kernelCollector.image.name }}:{{ default .Values.images.tag .Values.kernelCollector.image.tag }}"
imagePullPolicy: {{ .Values.images.pullPolicy }}
image: "{{ default .Values.image.registry .Values.kernelCollector.image.registry }}/{{ .Values.kernelCollector.image.name }}:{{ default .Values.image.tag .Values.kernelCollector.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --config-file=/etc/network-explorer/config.yaml
{{- if .Values.kernelCollector.bpfDumpFile }}
Expand Down Expand Up @@ -93,7 +92,7 @@ spec:
- name: "EBPF_NET_INTAKE_HOST"
value: {{ include "opentelemetry-collector-reducer.fullname" . }}
- name: "EBPF_NET_INTAKE_PORT"
value: "{{ default 7000 .Values.reducer.telemetryPort }}"
value: "{{ default 7000 .Values.reducer.service.ports.telemetry.port }}"
{{- if .Values.kernelCollector.exportBpfSrcFile }}
- name: "EBPF_NET_EXPORT_BPF_SRC_FILE"
value: {{ quote .Values.kernelCollector.exportBpfSrcFile }}
Expand All @@ -108,9 +107,9 @@ spec:
{{- end }}
{{- if and .Values.debug.enabled .Values.debug.sendUnplannedExitMetric }}
- name: "EBPF_NET_CRASH_METRIC_HOST"
value: {{ .Values.otelCollector.address }}
value: {{ .Values.endpoint.address }}
- name: "EBPF_NET_CRASH_METRIC_PORT"
value: {{ .Values.otelCollector.port | default 4317 }}
value: {{ .Values.endpoint.port | default 4317 }}
{{- end }}
{{- if .Values.kernelCollector.env }}
{{ toYaml .Values.kernelCollector.env | indent 12 }}
Expand Down
20 changes: 10 additions & 10 deletions charts/opentelemetry-ebpf/templates/reducer-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ spec:
{{- end }}
containers:
- name: reducer
image: "{{ default .Values.images.repository .Values.reducer.image.repository }}/{{ .Values.reducer.image.name }}:{{ default .Values.images.tag .Values.reducer.image.tag }}"
imagePullPolicy: {{ .Values.images.pullPolicy }}
image: "{{ default .Values.image.registry .Values.reducer.image.registry }}/{{ .Values.reducer.image.name }}:{{ default .Values.image.tag .Values.reducer.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- --port={{- .Values.reducer.telemetryPort }}
- --port={{- .Values.reducer.service.ports.telemetry.containerPort }}
- --log-console
- --no-log-file
{{- if hasKey .Values.log "level" }}
Expand All @@ -38,8 +38,8 @@ spec:
- --enable-aws-enrichment
- --disable-prometheus-metrics
- --enable-otlp-grpc-metrics
- --otlp-grpc-metrics-host={{ .Values.otelCollector.address }}
- --otlp-grpc-metrics-port={{ .Values.otelCollector.port | default 4317 }}
- --otlp-grpc-metrics-host={{ .Values.endpoint.address }}
- --otlp-grpc-metrics-port={{ .Values.endpoint.port | default 4317 }}
{{- if .Values.reducer.disableMetrics }}
- --disable-metrics={{join "," .Values.reducer.disableMetrics}}
{{- end }}
Expand All @@ -66,18 +66,18 @@ spec:
{{- end }}
{{- if .Values.debug.sendUnplannedExitMetric }}
- name: "EBPF_NET_CRASH_METRIC_HOST"
value: {{ .Values.otelCollector.address }}
value: {{ .Values.endpoint.address }}
- name: "EBPF_NET_CRASH_METRIC_PORT"
value: {{ .Values.otelCollector.port | default 4317 }}
value: {{ .Values.endpoint.port | default 4317 }}
{{- end }}
{{- end }}
ports:
- name: telemetry
containerPort: {{ .Values.reducer.telemetryPort }}
containerPort: {{ .Values.reducer.service.ports.telemetry.containerPort }}
protocol: TCP
{{- if not .Values.reducer.disableInternalMetrics }}
- name: stats
containerPort: {{ .Values.reducer.statsPromPort }}
containerPort: {{ .Values.reducer.service.ports.stats.containerPort }}
protocol: TCP
{{- end }}
{{- if .Values.debug.enabled }}
Expand All @@ -93,7 +93,7 @@ spec:
periodSeconds: 20
timeoutSeconds: 5
exec:
command: ['/srv/health_check.sh', 'readiness_probe', 'localhost', {{ quote .Values.reducer.telemetryPort }}]
command: ['/srv/health_check.sh', 'readiness_probe', 'localhost', {{ quote .Values.reducer.service.ports.telemetry.containerPort }}]
{{- if .Values.resources }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
Expand Down
16 changes: 5 additions & 11 deletions charts/opentelemetry-ebpf/templates/reducer-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,12 @@ metadata:
labels:
{{- include "opentelemetry-ebpf.labels" . | nindent 4 }}
spec:
type: ClusterIP
type: {{ .Values.reducer.service.type }}
selector:
app.kubernetes.io/name: {{ include "opentelemetry-collector-reducer.fullname" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- $ports := include "opentelemetry-collector-reducer.servicePortsConfig" . }}
{{- if $ports }}
ports:
- name: telemetry
port: {{ .Values.reducer.telemetryPort }}
targetPort: telemetry
protocol: TCP
{{- if not .Values.reducer.disableInternalMetrics }}
- name: stats
port: {{ .Values.reducer.statsPromPort }}
targetPort: stats
protocol: TCP
{{- end }}
{{- $ports | nindent 4}}
{{- end }}
6 changes: 3 additions & 3 deletions charts/opentelemetry-ebpf/values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"description": "Cluster Name",
"type": "string"
},
"otelCollector": {
"endpoint": {
"type": "object",
"additionalProperties": false,
"required": [
Expand Down Expand Up @@ -70,15 +70,15 @@
}
}
},
"images": {
"image": {
"description": "images",
"type": "object",
"additionalProperties": false,
"properties": {
"tag": {
"type": "string"
},
"repository": {
"registry": {
"type": "string"
},
"pullPolicy": {
Expand Down
39 changes: 27 additions & 12 deletions charts/opentelemetry-ebpf/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,18 @@

nameOverride: ""
fullnameOverride: ""

clusterName: ""

images:
tag: "v0.10.0"
repository: otel
image:
tag: ""
registry: otel
pullPolicy: IfNotPresent

imagePullSecrets: []

resources: {}

otelCollector:
endpoint:
address: ""
port: ""

Expand All @@ -36,7 +35,7 @@ kernelCollector:
create: true
name: ""
image:
repository: ""
registry: ""
tag: ""
name: opentelemetry-ebpf-kernel-collector

Expand Down Expand Up @@ -64,7 +63,7 @@ kernelCollector:
cloudCollector:
enabled: false
image:
repository: ""
registry: ""
tag: ""
name: opentelemetry-ebpf-cloud-collector

Expand All @@ -85,12 +84,12 @@ k8sCollector:
name: ""
relay:
image:
repository: ""
registry: ""
tag: ""
name: opentelemetry-ebpf-k8s-relay
watcher:
image:
repository: ""
registry: ""
tag: ""
name: opentelemetry-ebpf-k8s-watcher

Expand All @@ -99,7 +98,7 @@ k8sCollector:

reducer:
image:
repository: ""
registry: ""
tag: ""
name: opentelemetry-ebpf-reducer
extraArgs: {}
Expand Down Expand Up @@ -251,12 +250,28 @@ reducer:
# - ebpf_net.codetiming_sum_ns
# - ebpf_net.otlp_grpc.failed_requests
# - ebpf_net.rpc_queue_buf_utilization
telemetryPort: 7000
statsPromPort: 7001

resources: {}
nodeSelector: {}
tolerations: []
affinity: {}
service:
type: ClusterIP
ports:
telemetry:
enabled: true
port: 7000
containerPort: 7000
targetPort: 7000
protocol: TCP
appProtocol: http
stats:
enabled: true
port: 7001
containerPort: 7001
targetPort: 7001
protocol: TCP
appProtocol: http

rbac:
create: true
Expand Down

0 comments on commit cd9cd01

Please sign in to comment.