From 21290a4a130cc9ffb623a6aaea492f9cf093de2a Mon Sep 17 00:00:00 2001 From: a-thomas-22 <112640918+a-thomas-22@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:34:52 -0600 Subject: [PATCH 1/3] Add additional port support --- charts/nitro/Chart.yaml | 2 +- charts/nitro/templates/service.yaml | 8 ++++++++ charts/nitro/templates/statefulset.yaml | 5 +++++ charts/nitro/templates/validator/service.yaml | 11 ++++++++--- charts/nitro/templates/validator/statefulset.yaml | 5 +++++ charts/nitro/values.yaml | 6 ++++++ 6 files changed, 33 insertions(+), 4 deletions(-) diff --git a/charts/nitro/Chart.yaml b/charts/nitro/Chart.yaml index 4806166..74cf2c9 100644 --- a/charts/nitro/Chart.yaml +++ b/charts/nitro/Chart.yaml @@ -7,6 +7,6 @@ maintainers: type: application -version: 0.1.16 +version: 0.1.17 appVersion: "v2.2.2-8f33fea" diff --git a/charts/nitro/templates/service.yaml b/charts/nitro/templates/service.yaml index bfee732..40ea2a0 100644 --- a/charts/nitro/templates/service.yaml +++ b/charts/nitro/templates/service.yaml @@ -38,5 +38,13 @@ spec: protocol: TCP name: metrics {{- end }} + {{- range .Values.extraPorts }} + {{- if .serviceEnabled | default true }} + - name: {{ .name }} + port: {{ .servicePort | default .port }} + targetPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} + {{- end }} selector: {{- include "nitro.selectorLabels" . | nindent 4 }} diff --git a/charts/nitro/templates/statefulset.yaml b/charts/nitro/templates/statefulset.yaml index 6ba46da..396d057 100644 --- a/charts/nitro/templates/statefulset.yaml +++ b/charts/nitro/templates/statefulset.yaml @@ -97,6 +97,11 @@ spec: containerPort: {{ .Values.configmap.data.node.feed.output.port }} protocol: TCP {{- end }} + {{- range .Values.extraPorts }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} {{- if .Values.livenessProbe.enabled }} livenessProbe: {{- if and .Values.livenessProbe.exec (kindIs "string" .Values.livenessProbe.exec.command) }} diff --git a/charts/nitro/templates/validator/service.yaml b/charts/nitro/templates/validator/service.yaml index 278315f..8367fbd 100644 --- a/charts/nitro/templates/validator/service.yaml +++ b/charts/nitro/templates/validator/service.yaml @@ -24,10 +24,15 @@ spec: protocol: TCP name: metrics {{- end }} - {{- with $.Values.validator.statefulset.extraServicePorts }} - {{- toYaml . | nindent 4 }} + {{- range .Values.validator.statefulset.extraPorts }} + {{- if .serviceEnabled | default true }} + - name: {{ .name }} + port: {{ .port }} + targetPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} {{- end }} selector: {{- $selectorLabels | nindent 4 }} function: arb-validator -{{- end }} \ No newline at end of file +{{- end }} diff --git a/charts/nitro/templates/validator/statefulset.yaml b/charts/nitro/templates/validator/statefulset.yaml index 444ac70..dec3d16 100644 --- a/charts/nitro/templates/validator/statefulset.yaml +++ b/charts/nitro/templates/validator/statefulset.yaml @@ -85,6 +85,11 @@ spec: - name: auth containerPort: {{ .Values.validator.statefulset.auth.port }} {{- end }} + {{- range .Values.validator.statefulset.extraPorts }} + - name: {{ .name }} + containerPort: {{ .port }} + protocol: {{ .protocol | default "TCP" }} + {{- end }} volumeMounts: {{- if .Values.jwtSecret.enabled }} - name: jwt-secret diff --git a/charts/nitro/values.yaml b/charts/nitro/values.yaml index 0d3d993..61a34b1 100644 --- a/charts/nitro/values.yaml +++ b/charts/nitro/values.yaml @@ -121,6 +121,9 @@ affinity: {} ## @param additionalVolumeClaims Additional volume claims for the pod additionalVolumeClaims: [] +## @param extraPorts Additional ports for the pod +extraPorts: [] + configmap: ## @param configmap.enabled Enable a configmap for the nitro container enabled: true @@ -246,6 +249,9 @@ validator: ## @param validator.statefulset.extraEnv Extra environment variables for the validator container extraEnv: {} + ## @param validator.statefulset.extraPorts Additional ports for the stateless validator pod + extraPorts: [] + ## @param validator.statefulset.metrics.enabled Enable metrics for the validator statefulset metrics: enabled: false From 15538c154bd0f882cde2d30a84f35a0a30e7db81 Mon Sep 17 00:00:00 2001 From: a-thomas-22 Date: Tue, 30 Jan 2024 00:35:27 +0000 Subject: [PATCH 2/3] Update README and values.schema.json for modified charts --- charts/nitro/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/charts/nitro/README.md b/charts/nitro/README.md index d37fb94..5cd29c7 100644 --- a/charts/nitro/README.md +++ b/charts/nitro/README.md @@ -114,6 +114,7 @@ helm install xai offchainlabs/nitro -f values.yaml | `tolerations` | Tolerations for the pod | `[]` | | `affinity` | Affinity for the pod | `{}` | | `additionalVolumeClaims` | Additional volume claims for the pod | `[]` | +| `extraPorts` | Additional ports for the pod | `[]` | | `configmap.enabled` | Enable a configmap for the nitro container | `true` | | `configmap.data` | See Configuration Options for the full list of options | | | `configmap.data.http.addr` | Address to bind http service to | `0.0.0.0` | @@ -162,6 +163,7 @@ helm install xai offchainlabs/nitro -f values.yaml | `validator.statefulset.startupProbe.enabled` | Enable the startup probe for the validator statefulset | `false` | | `validator.statefulset.resources` | Resources for the validator container | `{}` | | `validator.statefulset.extraEnv` | Extra environment variables for the validator container | `{}` | +| `validator.statefulset.extraPorts` | Additional ports for the stateless validator pod | `[]` | | `validator.statefulset.metrics.enabled` | Enable metrics for the validator statefulset | `false` | | `validator.statefulset.podAnnotations` | Annotations for the stateless validator pod | `{}` | From 7450c5367c4cb7a45eaf361dbf5928c646c6c303 Mon Sep 17 00:00:00 2001 From: a-thomas-22 <112640918+a-thomas-22@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:36:42 -0600 Subject: [PATCH 3/3] Empty commit