Skip to content

Commit

Permalink
LoadBalancer cannot simultaneously support TCP and UDP protocols
Browse files Browse the repository at this point in the history
Signed-off-by: Costis <ccostis@gmail.com>
  • Loading branch information
CostisC committed Sep 17, 2024
1 parent 614fe89 commit d48e722
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 53 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.10.3
version: 1.10.4
appVersion: 2.5.0
engine: gotpl
home: https://grafana.net
Expand Down
7 changes: 5 additions & 2 deletions charts/tempo/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tempo

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

Grafana Tempo Single Binary Mode

Expand Down Expand Up @@ -41,6 +41,9 @@ Grafana Tempo Single Binary Mode
| service.labels | object | `{}` | |
| service.targetPort | string | `""` | |
| service.type | string | `"ClusterIP"` | |
| service.clusterIP | string | `""` | |
| service.loadBalancerIP | string | `""` | |
| service.protocol | string | `"TCP"` | If service type is LoadBalancer, the exposed protocol can be "UDP", "TCP" or "UDP,TCP" |
| serviceAccount.annotations | object | `{}` | Annotations for the service account |
| serviceAccount.automountServiceAccountToken | bool | `true` | |
| serviceAccount.create | bool | `true` | Specifies whether a ServiceAccount should be created |
Expand Down Expand Up @@ -148,4 +151,4 @@ and [1.5 -> 2.0 upgrade guide](https://grafana.com/docs/tempo/latest/setup/upgra

Upgrading from pre 0.7.0 will, by default, move your trace storage from `/tmp/tempo/traces` to `/var/tempo/traces`.
This will cause Tempo to lose trace history. If you would like to retain history just copy the contents from the
old folder to the new.
old folder to the new.
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 @@ -257,6 +257,12 @@ serviceAccount:

service:
type: ClusterIP
# type: LoadBalancer
# clusterIP: ""
# loadBalancerIP: ""
# -- If service type is LoadBalancer, the exposed protocol can either be UDP or TCP
# protocol: "TCP"

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

0 comments on commit d48e722

Please # to comment.