Skip to content

Commit

Permalink
Merge pull request #361 from celo-org/jcortejoso/op-node-svc-fix
Browse files Browse the repository at this point in the history
op-node: one p2p-svc for tcp/udp for ClusterIP
  • Loading branch information
jcortejoso authored Aug 1, 2024
2 parents 65f99a0 + 368d5d8 commit 612eef9
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 2 deletions.
2 changes: 1 addition & 1 deletion charts/op-node/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: op-node
apiVersion: v2
version: 0.2.9
version: 0.2.10
description: Celo implementation for op-node consensus engine (Optimism Rollup)
home: https://clabs.co
sources:
Expand Down
2 changes: 1 addition & 1 deletion charts/op-node/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# op-node

![Version: 0.2.9](https://img.shields.io/badge/Version-0.2.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.0.0](https://img.shields.io/badge/AppVersion-v1.0.0-informational?style=flat-square)
![Version: 0.2.10](https://img.shields.io/badge/Version-0.2.10-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v1.0.0](https://img.shields.io/badge/AppVersion-v1.0.0-informational?style=flat-square)

Celo implementation for op-node consensus engine (Optimism Rollup)
Initially based on [dysnix/charts/op-node](https://github.com/dysnix/charts/tree/main/dysnix/op-node).
Expand Down
51 changes: 51 additions & 0 deletions charts/op-node/templates/service-p2p.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
{{- $nodePort = index .nodePorts $index }}
{{- end }}
---
{{- /* In case of LoadBalancer, we cannot mix different protocols (tcp/udp) in the same LB, so we split in two svcs */ -}}
{{- if eq .type "LoadBalancer" }}
apiVersion: v1
kind: Service
metadata:
Expand Down Expand Up @@ -94,6 +96,55 @@ spec:
selector:
{{- include "op-node.selectorLabels" $ | nindent 4 }}
statefulset.kubernetes.io/pod-name: {{ template "op-node.fullname" $ }}-{{ $index }}
{{- /* In case of ClusterIP, we cannot set same ClusterIP to different svcs, so we use just one */ -}}
{{- else }}
apiVersion: v1
kind: Service
metadata:
name: {{ include "op-node.fullname" $ }}-p2p-{{ $index }}
{{- with .annotations }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
service-type: p2p
{{- include "op-node.labels" $ | nindent 4 }}
spec:
type: {{ .type }}
{{- with $loadBalancerIP }}
loadBalancerIP: {{ . }}
{{- end }}
{{- with $clusterIP }}
clusterIP: {{ . }}
{{- end }}
{{- with .externalTrafficPolicy }}
externalTrafficPolicy: {{ . }}
{{- end }}
{{- with .internalTrafficPolicy }}
internalTrafficPolicy: {{ . }}
{{- end }}
{{- with .publishNotReadyAddresses }}
publishNotReadyAddresses: {{ . }}
{{- end }}
ports:
- name: p2p-tcp
port: {{ .port }}
targetPort: p2p-tcp
protocol: TCP
{{- with $nodePort }}
nodePort: {{ . }}
{{- end }}
- name: p2p-udp
port: {{ .port }}
targetPort: p2p-udp
protocol: UDP
{{- with $nodePort }}
nodePort: {{ . }}
{{- end }}
selector:
{{- include "op-node.selectorLabels" $ | nindent 4 }}
statefulset.kubernetes.io/pod-name: {{ template "op-node.fullname" $ }}-{{ $index }}
{{- end }}
{{- end }}
{{- end }}
{{- end }}

0 comments on commit 612eef9

Please sign in to comment.