Skip to content

Commit

Permalink
Add additional port support to nitro pods (#15)
Browse files Browse the repository at this point in the history
* Add additional port support

* Update README and values.schema.json for modified charts

* Empty commit

---------

Co-authored-by: a-thomas-22 <[email protected]>
  • Loading branch information
a-thomas-22 and a-thomas-22 authored Jan 30, 2024
1 parent 66a1685 commit f27ed74
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/nitro/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ maintainers:

type: application

version: 0.1.16
version: 0.1.17

appVersion: "v2.2.2-8f33fea"
2 changes: 2 additions & 0 deletions charts/nitro/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down Expand Up @@ -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 | `{}` |

Expand Down
8 changes: 8 additions & 0 deletions charts/nitro/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
5 changes: 5 additions & 0 deletions charts/nitro/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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) }}
Expand Down
11 changes: 8 additions & 3 deletions charts/nitro/templates/validator/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
{{- end }}
5 changes: 5 additions & 0 deletions charts/nitro/templates/validator/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions charts/nitro/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit f27ed74

Please sign in to comment.