Skip to content

Commit

Permalink
Merge pull request grafana#3317 from CostisC/nlb-protocols
Browse files Browse the repository at this point in the history
[tempo] LoadBalancer cannot simultaneously support TCP and UDP protocols
  • Loading branch information
mapno authored Dec 10, 2024
2 parents 187dae8 + 0cf9c75 commit 897c250
Show file tree
Hide file tree
Showing 5 changed files with 114 additions and 52 deletions.
2 changes: 1 addition & 1 deletion charts/tempo/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: tempo
description: Grafana Tempo Single Binary Mode
type: application
version: 1.14.0
version: 1.15.0
appVersion: 2.6.1
engine: gotpl
home: https://grafana.net
Expand Down
5 changes: 4 additions & 1 deletion charts/tempo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tempo

![Version: 1.14.0](https://img.shields.io/badge/Version-1.14.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)
![Version: 1.15.0](https://img.shields.io/badge/Version-1.15.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.6.1](https://img.shields.io/badge/AppVersion-2.6.1-informational?style=flat-square)

Grafana Tempo Single Binary Mode

Expand Down Expand Up @@ -40,7 +40,10 @@ Grafana Tempo Single Binary Mode
| replicas | int | `1` | Define the amount of instances |
| securityContext | object | `{"fsGroup":10001,"runAsGroup":10001,"runAsNonRoot":true,"runAsUser":10001}` | securityContext for container |
| service.annotations | object | `{}` | |
| service.clusterIP | string | `""` | |
| service.labels | object | `{}` | |
| service.loadBalancerIP | string | `nil` | IP address, in case of 'type: LoadBalancer' |
| service.protocol | string | `"TCP"` | If service type is LoadBalancer, the exposed protocol can either be "UDP", "TCP" or "UDP,TCP" |
| service.targetPort | string | `""` | |
| service.type | string | `"ClusterIP"` | |
| serviceAccount.annotations | object | `{}` | Annotations for the service account |
Expand Down
88 changes: 88 additions & 0 deletions charts/tempo/templates/_ports.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
{{/* ~=~=~ Partial Templates of exposed Ports ~=~=~ */}}

{{/* UDP sockets */}}
{{- define "tempo.udp"}}
{{- $endpoint := .Values.tempo.receivers.jaeger.protocols.thrift_compact }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: tempo-jaeger-thrift-compact
port: {{ $port }}
protocol: UDP
targetPort: 6831
{{- end }}
{{- $endpoint := .Values.tempo.receivers.jaeger.protocols.thrift_binary }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: tempo-jaeger-thrift-binary
port: {{ $port }}
protocol: UDP
targetPort: 6832
{{- end }}
{{- /* end of define */}}
{{- end }}

{{/* TCP sockets */}}
{{- define "tempo.tcp"}}
- name: tempo-prom-metrics
port: 3100
protocol: TCP
targetPort: 3100
{{- if .Values.tempoQuery.enabled }}
- name: jaeger-metrics
port: 16687
protocol: TCP
targetPort: 16687
- name: tempo-query-jaeger-ui
port: {{ .Values.tempoQuery.service.port }}
targetPort: {{ .Values.tempoQuery.service.port }}
{{- end }}
{{- $endpoint := .Values.tempo.receivers.jaeger.protocols.thrift_http }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: tempo-jaeger-thrift-http
port: {{ $port }}
protocol: TCP
targetPort: 14268
{{- end }}
{{- $endpoint := .Values.tempo.receivers.jaeger.protocols.grpc }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: grpc-tempo-jaeger
port: {{ $port }}
protocol: TCP
targetPort: 14250
{{- end }}
- name: tempo-zipkin
port: 9411
protocol: TCP
targetPort: 9411
- name: tempo-otlp-legacy
port: 55680
protocol: TCP
targetPort: 55680
- name: tempo-otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 55681
{{- $endpoint := .Values.tempo.receivers.otlp.protocols.grpc }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: grpc-tempo-otlp
port: {{ $port }}
protocol: TCP
targetPort: 4317
{{- end }}
{{- $endpoint := .Values.tempo.receivers.otlp.protocols.http }}
{{- with $endpoint.endpoint }}
{{- $port := regexSplit ":" . -1 | last }}
- name: tempo-otlp-http
port: {{ $port }}
protocol: TCP
targetPort: 4318
{{- end }}
- name: tempo-opencensus
port: 55678
protocol: TCP
targetPort: 55678
{{- /* end of define */}}
{{- end }}
65 changes: 15 additions & 50 deletions charts/tempo/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -32,56 +33,20 @@ spec:
{{- end }}
{{- end }}
ports:
- name: tempo-prom-metrics
port: 3100
targetPort: 3100
{{- if .Values.tempoQuery.enabled }}
- name: jaeger-metrics
port: 16687
targetPort: 16687
- name: tempo-query-jaeger-ui
port: {{ .Values.tempoQuery.service.port }}
targetPort: {{ .Values.tempoQuery.service.port }}
{{- if (eq .Values.service.type "LoadBalancer") }}
{{- $protocol := .Values.service.protocol | default "TCP" }}
{{- if contains "UDP" $protocol }}
{{- include "tempo.udp" . | indent 2 }}
{{- end }}
{{- if contains "TCP" $protocol }}
{{- include "tempo.tcp" . | indent 2 }}
{{- end }}
{{- else }}
{{- include "tempo.udp" . | indent 2 }}
{{- include "tempo.tcp" . | indent 2 }}
{{- end }}
- name: tempo-jaeger-thrift-compact
port: 6831
protocol: UDP
targetPort: 6831
- name: tempo-jaeger-thrift-binary
port: 6832
protocol: UDP
targetPort: 6832
- name: tempo-jaeger-thrift-http
port: 14268
protocol: TCP
targetPort: 14268
- name: grpc-tempo-jaeger
port: 14250
protocol: TCP
targetPort: 14250
- name: tempo-zipkin
port: 9411
protocol: TCP
targetPort: 9411
- name: tempo-otlp-legacy
port: 55680
protocol: TCP
targetPort: 55680
- name: tempo-otlp-http-legacy
port: 55681
protocol: TCP
targetPort: 4318
- name: grpc-tempo-otlp
port: 4317
protocol: TCP
targetPort: 4317
- name: tempo-otlp-http
port: 4318
protocol: TCP
targetPort: 4318
- name: tempo-opencensus
port: 55678
protocol: TCP
targetPort: 55678
selector:
{{- include "tempo.selectorLabels" . | nindent 4 }}



6 changes: 6 additions & 0 deletions charts/tempo/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@ serviceAccount:

service:
type: ClusterIP
clusterIP: ""
# -- (string) IP address, in case of 'type: LoadBalancer'
loadBalancerIP:
# -- If service type is LoadBalancer, the exposed protocol can either be "UDP", "TCP" or "UDP,TCP"
protocol: "TCP"

annotations: {}
labels: {}
targetPort: ""
Expand Down

0 comments on commit 897c250

Please sign in to comment.