Skip to content

Commit bab1fa4

Browse files
feat(lighthouse): add support for LB service
1 parent 8086ca1 commit bab1fa4

File tree

4 files changed

+93
-0
lines changed

4 files changed

+93
-0
lines changed

charts/lighthouse/README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,15 @@ We do not recommend that you upgrade the application by overriding `image.tag`.
9393
| lighthouse.jwt.existingSecret.name | Name of the Secret resource in the same namespace | string | `""` |
9494
| lighthouse.jwt.fromLiteral | Use this literal value for the JWT | string | `""` |
9595
| lighthouse.nodeSelector | | object | `{}` |
96+
| lighthouse.p2p.service.advertiseIP | IP address to explicitly advertise in ENR (overrides autodetection and LB IP) | string | `""` |
97+
| lighthouse.p2p.service.annotations | Annotations to add to the P2P Service (e.g., Cilium sharing keys) | object | `{}` |
98+
| lighthouse.p2p.service.enabled | Enable a dedicated P2P Service | bool | `false` |
99+
| lighthouse.p2p.service.externalIPs | Fixed external IPs to bind the Service to (requires upstream routing) | list | `[]` |
100+
| lighthouse.p2p.service.externalTrafficPolicy | External traffic policy | string | `"Local"` |
101+
| lighthouse.p2p.service.labels | Additional labels to add to the P2P Service | object | `{}` |
102+
| lighthouse.p2p.service.loadBalancerIP | When using a LoadBalancer and your cloud supports it, set a specific LB IP | string | `""` |
103+
| lighthouse.p2p.service.loadBalancerSourceRanges | Restrict which source ranges can access the LoadBalancer (CIDRs) | list | `[]` |
104+
| lighthouse.p2p.service.type | Service type for P2P exposure | string | `"LoadBalancer"` |
96105
| lighthouse.p2pHostPort.enabled | Expose P2P ports via hostPort | bool | `false` |
97106
| lighthouse.p2pHostPort.initContainer.image.pullPolicy | Container pull policy | string | `"IfNotPresent"` |
98107
| lighthouse.p2pHostPort.initContainer.image.repository | Container image to fetch IP/port information | string | `"lachlanevenson/k8s-kubectl"` |

charts/lighthouse/templates/lighthouse/service.yaml

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,57 @@ spec:
8181
selector:
8282
{{- include "lighthouse.selectorLabels" . | nindent 4 }}
8383
{{- $componentLabel | nindent 4 }}
84+
{{/* Dedicated P2P LoadBalancer Service */}}
85+
{{- if and $values.p2p $values.p2p.service $values.p2p.service.enabled (eq (default "" $values.p2p.service.type) "LoadBalancer") }}
86+
---
87+
apiVersion: v1
88+
kind: Service
89+
metadata:
90+
name: {{ include "lighthouse.fullname" . }}-{{ $componentName }}-p2p
91+
labels:
92+
{{- include "lighthouse.labels" . | nindent 4 }}
93+
{{- $componentLabel | nindent 4 }}
94+
{{- with $values.p2p.service.labels }}
95+
{{- toYaml . | nindent 4 }}
96+
{{- end }}
97+
{{- with $values.p2p.service.annotations }}
98+
annotations:
99+
{{- toYaml . | nindent 4 }}
100+
{{- end }}
101+
spec:
102+
type: LoadBalancer
103+
externalTrafficPolicy: {{ default "Local" $values.p2p.service.externalTrafficPolicy }}
104+
{{- with $values.p2p.service.loadBalancerIP }}
105+
{{- if . }}
106+
loadBalancerIP: {{ . }}
107+
{{- end }}
108+
{{- end }}
109+
{{- with $values.p2p.service.loadBalancerSourceRanges }}
110+
{{- if . }}
111+
loadBalancerSourceRanges:
112+
{{- toYaml . | nindent 2 }}
113+
{{- end }}
114+
{{- end }}
115+
{{- with $values.p2p.service.externalIPs }}
116+
{{- if . }}
117+
externalIPs:
118+
{{- toYaml . | nindent 2 }}
119+
{{- end }}
120+
{{- end }}
121+
ports:
122+
- name: tcp-transport
123+
port: {{ include "lighthouse.port" $values }}
124+
targetPort: tcp-transport
125+
protocol: TCP
126+
- name: udp-discovery
127+
port: {{ include "lighthouse.discoveryPort" $values }}
128+
targetPort: udp-discovery
129+
protocol: UDP
130+
- name: udp-transport
131+
port: {{ include "lighthouse.quicPort" $values }}
132+
targetPort: udp-transport
133+
protocol: UDP
134+
selector:
135+
{{- include "lighthouse.selectorLabels" . | nindent 4 }}
136+
{{- $componentLabel | nindent 4 }}
137+
{{- end }}

charts/lighthouse/templates/lighthouse/statefulset.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,14 @@ spec:
160160
--enr-address=$EXTERNAL_IP \
161161
--enr-udp-port={{ $values.p2pHostPort.port }} \
162162
--enr-tcp-port={{ $values.p2pHostPort.port }} \
163+
{{- else if and $values.p2p $values.p2p.service $values.p2p.service.enabled (eq $values.p2p.service.type "LoadBalancer") }}
164+
{{- if $values.p2p.service.advertiseIP }}
165+
--enr-address={{ $values.p2p.service.advertiseIP }} \
166+
{{- else if $values.p2p.service.loadBalancerIP }}
167+
--enr-address={{ $values.p2p.service.loadBalancerIP }} \
168+
{{- end }}
169+
--enr-udp-port={{ include "lighthouse.discoveryPort" $values }} \
170+
--enr-tcp-port={{ include "lighthouse.port" $values }} \
163171
{{- end }}
164172
--port={{ include "lighthouse.port" $values }} \
165173
--discovery-port={{ include "lighthouse.discoveryPort" $values }} \

charts/lighthouse/values.yaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,3 +172,25 @@ lighthouse:
172172
tag: v1.25.4
173173
# -- Container pull policy
174174
pullPolicy: IfNotPresent
175+
176+
# P2P Service exposure (alternative to hostPort)
177+
p2p:
178+
service:
179+
# -- Enable a dedicated P2P Service
180+
enabled: false
181+
# -- Service type for P2P exposure
182+
type: LoadBalancer
183+
# -- Additional labels to add to the P2P Service
184+
labels: {}
185+
# -- Annotations to add to the P2P Service (e.g., Cilium sharing keys)
186+
annotations: {}
187+
# -- External traffic policy
188+
externalTrafficPolicy: Local
189+
# -- Fixed external IPs to bind the Service to (requires upstream routing)
190+
externalIPs: []
191+
# -- When using a LoadBalancer and your cloud supports it, set a specific LB IP
192+
loadBalancerIP: ""
193+
# -- Restrict which source ranges can access the LoadBalancer (CIDRs)
194+
loadBalancerSourceRanges: []
195+
# -- IP address to explicitly advertise in ENR (overrides autodetection and LB IP)
196+
advertiseIP: ""

0 commit comments

Comments
 (0)