From 473e6e4e5b6fb30aa7c1b609a2dd4eee3369ffe8 Mon Sep 17 00:00:00 2001 From: a-thomas-22 <112640918+a-thomas-22@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:48:06 -0600 Subject: [PATCH 1/3] Fix stateless validator topology spread constraints --- charts/nitro/Chart.yaml | 2 +- charts/nitro/templates/pdb.yaml | 1 + charts/nitro/templates/service.yaml | 1 + charts/nitro/templates/statefulset.yaml | 2 ++ charts/nitro/templates/validator/pdb.yaml | 19 +++++++++++++++++++ charts/nitro/values.yaml | 8 ++++++++ 6 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 charts/nitro/templates/validator/pdb.yaml diff --git a/charts/nitro/Chart.yaml b/charts/nitro/Chart.yaml index b887bb5..b7a60b5 100644 --- a/charts/nitro/Chart.yaml +++ b/charts/nitro/Chart.yaml @@ -7,6 +7,6 @@ maintainers: type: application -version: 0.1.18 +version: 0.1.19 appVersion: "v2.2.3-17468a8" diff --git a/charts/nitro/templates/pdb.yaml b/charts/nitro/templates/pdb.yaml index 113ef98..3082a06 100644 --- a/charts/nitro/templates/pdb.yaml +++ b/charts/nitro/templates/pdb.yaml @@ -15,4 +15,5 @@ spec: selector: matchLabels: {{- include "nitro.selectorLabels" . | nindent 6 }} + function: nitro {{- end }} diff --git a/charts/nitro/templates/service.yaml b/charts/nitro/templates/service.yaml index 40ea2a0..9866225 100644 --- a/charts/nitro/templates/service.yaml +++ b/charts/nitro/templates/service.yaml @@ -48,3 +48,4 @@ spec: {{- end }} selector: {{- include "nitro.selectorLabels" . | nindent 4 }} + function: nitro diff --git a/charts/nitro/templates/statefulset.yaml b/charts/nitro/templates/statefulset.yaml index 396d057..a9625e4 100644 --- a/charts/nitro/templates/statefulset.yaml +++ b/charts/nitro/templates/statefulset.yaml @@ -28,6 +28,7 @@ spec: {{- end }} labels: {{- include "nitro.selectorLabels" . | nindent 8 }} + function: nitro spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: @@ -198,6 +199,7 @@ spec: labelSelector: matchLabels: {{- include "nitro.selectorLabels" $ | nindent 12 }} + function: nitro {{- end }} {{- end }} {{- end }} diff --git a/charts/nitro/templates/validator/pdb.yaml b/charts/nitro/templates/validator/pdb.yaml new file mode 100644 index 0000000..d76853d --- /dev/null +++ b/charts/nitro/templates/validator/pdb.yaml @@ -0,0 +1,19 @@ +{{- if .Values.validator.statefulset.enabled }} +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "nitro.fullname" . }} + labels: + {{- include "nitro.labels" . | nindent 4 }} +spec: + {{- if and (.Values.validator.statefulset.pdb.minAvailable) (not .Values.validator.statefulset.pdb.maxUnavailable) }} + minAvailable: {{ .Values.validator.statefulset.pdb.minAvailable }} + {{- end }} + {{- if and (.Values.validator.statefulset.pdb.maxUnavailable) (not .Values.validator.statefulset.pdb.minAvailable) }} + maxUnavailable: {{ .Values.validator.statefulset.pdb.maxUnavailable }} + {{- end }} + selector: + matchLabels: + {{- include "nitro.selectorLabels" . | nindent 6 }} + function: arb-validator +{{- end }} diff --git a/charts/nitro/values.yaml b/charts/nitro/values.yaml index ddecfb4..dd25a5b 100644 --- a/charts/nitro/values.yaml +++ b/charts/nitro/values.yaml @@ -228,6 +228,14 @@ validator: initialDelaySeconds: 30 periodSeconds: 10 + ## @param validator.statefulset.pdb.enabled Enable pod disruption budget + ## @param validator.statefulset.pdb.minAvailable Minimum number of pods available + ## @param validator.statefulset.pdb.maxUnavailable Maximum number of pods unavailable + pdb: + enabled: false + minAvailable: "75%" + maxUnavailable: "" + ## @param validator.statefulset.readinessProbe.enabled Enable the readiness probe for the validator statefulset ## @param validator.statefulset.readinessProbe.tcpSocket.port Port to probe ## @param validator.statefulset.readinessProbe.initialDelaySeconds Initial delay for the readiness probe From ce488ba1f4c19d6d620cec9615f18f418f7e4aa7 Mon Sep 17 00:00:00 2001 From: a-thomas-22 Date: Mon, 5 Feb 2024 20:49:30 +0000 Subject: [PATCH 2/3] Update README and values.schema.json for modified charts --- charts/nitro/README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/charts/nitro/README.md b/charts/nitro/README.md index 0d283b2..35aa25c 100644 --- a/charts/nitro/README.md +++ b/charts/nitro/README.md @@ -156,6 +156,9 @@ helm install xai offchainlabs/nitro -f values.yaml | `validator.statefulset.livenessProbe.tcpSocket.port` | Port to probe | `auth` | | `validator.statefulset.livenessProbe.initialDelaySeconds` | Initial delay for the liveness probe | `30` | | `validator.statefulset.livenessProbe.periodSeconds` | Period for the liveness probe | `10` | +| `validator.statefulset.pdb.enabled` | Enable pod disruption budget | `false` | +| `validator.statefulset.pdb.minAvailable` | Minimum number of pods available | `75%` | +| `validator.statefulset.pdb.maxUnavailable` | Maximum number of pods unavailable | `""` | | `validator.statefulset.readinessProbe.enabled` | Enable the readiness probe for the validator statefulset | `true` | | `validator.statefulset.readinessProbe.tcpSocket.port` | Port to probe | `auth` | | `validator.statefulset.readinessProbe.initialDelaySeconds` | Initial delay for the readiness probe | `3` | From b08bd43343b52c007d45c3c7b043a751c56685a0 Mon Sep 17 00:00:00 2001 From: a-thomas-22 <112640918+a-thomas-22@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:50:53 -0600 Subject: [PATCH 3/3] add pdb selector --- charts/nitro/templates/validator/pdb.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/nitro/templates/validator/pdb.yaml b/charts/nitro/templates/validator/pdb.yaml index d76853d..542d5eb 100644 --- a/charts/nitro/templates/validator/pdb.yaml +++ b/charts/nitro/templates/validator/pdb.yaml @@ -1,4 +1,4 @@ -{{- if .Values.validator.statefulset.enabled }} +{{- if .Values.validator.statefulset.pdb.enabled }} apiVersion: policy/v1 kind: PodDisruptionBudget metadata: