From a85af2d766378728e4b5a6c952818bd251f073a9 Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Wed, 31 Jul 2024 12:21:36 +0200 Subject: [PATCH 1/3] op-node: one p2p-svc for tcp/udp for ClusterIP --- charts/op-node/Chart.yaml | 2 +- charts/op-node/templates/service-p2p.yaml | 51 +++++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/charts/op-node/Chart.yaml b/charts/op-node/Chart.yaml index 4892d313..bba3109d 100644 --- a/charts/op-node/Chart.yaml +++ b/charts/op-node/Chart.yaml @@ -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: diff --git a/charts/op-node/templates/service-p2p.yaml b/charts/op-node/templates/service-p2p.yaml index 7161fe68..680b844c 100644 --- a/charts/op-node/templates/service-p2p.yaml +++ b/charts/op-node/templates/service-p2p.yaml @@ -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: @@ -94,6 +96,55 @@ spec: selector: {{- include "op-node.selectorLabels" $ | nindent 4 }} statefulset.kubernetes.io/pod-name: {{ template "op-node.fullname" $ }}-{{ $index }} +{{- else }} +{{- /* In case of ClusterIP, we cannot set same ClusterIP to different svcs, so we use just one */ -}} +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 }} From c95b4c4ff39d753d5286267edb03ce51a0a8381a Mon Sep 17 00:00:00 2001 From: Javier Cortejoso Date: Thu, 1 Aug 2024 12:37:31 +0200 Subject: [PATCH 2/3] Fix linting command --- charts/op-node/templates/service-p2p.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/op-node/templates/service-p2p.yaml b/charts/op-node/templates/service-p2p.yaml index 680b844c..8359c973 100644 --- a/charts/op-node/templates/service-p2p.yaml +++ b/charts/op-node/templates/service-p2p.yaml @@ -96,8 +96,8 @@ spec: selector: {{- include "op-node.selectorLabels" $ | nindent 4 }} statefulset.kubernetes.io/pod-name: {{ template "op-node.fullname" $ }}-{{ $index }} -{{- else }} {{- /* In case of ClusterIP, we cannot set same ClusterIP to different svcs, so we use just one */ -}} +{{- else }} apiVersion: v1 kind: Service metadata: From 368d5d8fff3e304520bde52288f6a005a6f455c2 Mon Sep 17 00:00:00 2001 From: jcortejoso Date: Thu, 1 Aug 2024 10:40:01 +0000 Subject: [PATCH 3/3] [Automatic] - Update chart README.md --- charts/op-node/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/op-node/README.md b/charts/op-node/README.md index 6b2d015d..f3409b2c 100644 --- a/charts/op-node/README.md +++ b/charts/op-node/README.md @@ -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).