Skip to content

Commit

Permalink
Add udp protocol (#3)
Browse files Browse the repository at this point in the history
* enable udp protocol

* fix requested changes

* fix rename missing
  • Loading branch information
aWN4Y25pa2EK authored Jul 5, 2024
1 parent ac54d08 commit 2489e02
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
21 changes: 19 additions & 2 deletions charts/celestia-node/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ spec:
{{- end }}
ports:
{{- if .Values.service.external.ports.p2p }}
- name: p2p
- name: p2p-tcp
port: {{ .Values.service.external.ports.p2p }}
{{- if not (eq .Values.service.external.ports.p2p .Values.node.containerPorts.p2p) }}
targetPort: {{ .Values.node.containerPorts.p2p }}
Expand All @@ -44,6 +44,19 @@ spec:
nodePort: null
{{- end }}
{{- end }}
{{- if .Values.service.external.ports.p2p }}
- name: p2p-udp
port: {{ .Values.service.external.ports.p2p }}
{{- if not (eq .Values.service.external.ports.p2p .Values.node.containerPorts.p2p) }}
targetPort: {{ .Values.node.containerPorts.p2p }}
{{- end }}
protocol: UDP
{{- if and (or (eq .Values.service.external.type "NodePort") (eq .Values.service.external.type "LoadBalancer")) (not (empty .Values.service.external.nodePorts.p2p)) }}
nodePort: {{ .Values.service.external.nodePorts.p2p }}
{{- else if eq .Values.service.external.type "ClusterIP" }}
nodePort: null
{{- end }}
{{- end }}
{{- if .Values.service.external.ports.rest }}
- name: rest
port: {{ .Values.service.external.ports.rest }}
Expand Down Expand Up @@ -128,12 +141,16 @@ spec:
sessionAffinityConfig: {{- include "common.tplvalues.render" (dict "value" .Values.service.internal.sessionAffinityConfig "context" $) | nindent 4 }}
{{- end }}
ports:
- name: p2p
- name: p2p-tcp
port: {{ .Values.service.internal.ports.p2p }}
{{- if not (eq .Values.service.internal.ports.p2p .Values.node.containerPorts.p2p) }}
targetPort: {{ .Values.node.containerPorts.p2p }}
{{- end }}
protocol: TCP
- name: p2p-udp
port: {{ .Values.service.internal.ports.p2p }}
targetPort: {{ .Values.node.containerPorts.p2p }}
protocol: UDP
- name: rest
port: {{ .Values.service.internal.ports.rest }}
{{- if not (eq .Values.service.internal.ports.rest .Values.node.containerPorts.rest) }}
Expand Down
6 changes: 5 additions & 1 deletion charts/celestia-node/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -186,8 +186,12 @@ spec:
resources: {{- include "common.resources.preset" (dict "type" .Values.node.resourcesPreset) | nindent 12 }}
{{- end }}
ports:
- name: p2p
- name: p2p-tcp
containerPort: {{ .Values.node.containerPorts.p2p }}
protocol: TCP
- name: p2p-udp
containerPort: {{ .Values.node.containerPorts.p2p }}
protocol: UDP
- name: rest
containerPort: {{ .Values.node.containerPorts.rest }}
- name: rpc
Expand Down

0 comments on commit 2489e02

Please sign in to comment.