Skip to content

Commit

Permalink
feat(lighthouse): add support for QUIC
Browse files Browse the repository at this point in the history
  • Loading branch information
cjorge-graphops committed Nov 10, 2023
1 parent 63c079d commit e1ba4e9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
8 changes: 8 additions & 0 deletions charts/lighthouse/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,14 @@ Create the name of the service account to use
{{- end }}
{{- end -}}

{{- define "lighthouse.p2pQuicPort" -}}
{{- if .p2pNodePort.enabled }}
{{- print (add .p2pNodePort.port 1) }}
{{- else }}
{{- printf "30304" -}}
{{- end }}
{{- end -}}

{{- define "lighthouse.replicas" -}}
{{- if .p2pNodePort.enabled }}
{{- print 1 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/lighthouse/templates/lighthouse/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ spec:
{{- $componentLabel | nindent 4 }}
{{- if $values.p2pNodePort.enabled }}
{{- $port := $values.p2pNodePort.port }}
{{- $quicPort := add $values.p2pNodePort.port 1 }}
---
apiVersion: v1
kind: Service
Expand All @@ -75,6 +76,11 @@ spec:
protocol: UDP
targetPort: udp-p2p
nodePort: {{ $port }}
- name: udp-p2p-quic
port: {{ include "lighthouse.p2pQuicPort" $values }}
protocol: UDP
targetPort: udp-p2p-quic
nodePort: {{ $port }}
selector:
{{- include "lighthouse.selectorLabels" . | nindent 4 }}
statefulset.kubernetes.io/pod-name: "{{ include "lighthouse.fullname" $ }}-{{ $componentName }}-0"
Expand Down
3 changes: 3 additions & 0 deletions charts/lighthouse/templates/lighthouse/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,9 @@ spec:
- name: tcp-p2p
containerPort: {{ include "lighthouse.p2pPort" $values }}
protocol: TCP
- name: udp-p2p-quic
containerPort: {{ include "lighthouse.p2pQuicPort" $values }}
protocol: UDP
volumeMounts:
{{- if $values.p2pNodePort.enabled }}
- name: env-nodeport
Expand Down

0 comments on commit e1ba4e9

Please sign in to comment.