From ec439e04c467fdc4445f825c287d6d336c9cbbf9 Mon Sep 17 00:00:00 2001 From: "Alex Chi Z." <4198311+skyzh@users.noreply.github.com> Date: Mon, 28 Oct 2024 13:20:46 -0400 Subject: [PATCH] feat(scrubber): add timeout for the cronjob (#108) Signed-off-by: Alex Chi Z --- charts/neon-storage-scrubber/Chart.yaml | 2 +- charts/neon-storage-scrubber/README.md | 3 ++- charts/neon-storage-scrubber/templates/cronjob.yaml | 1 + charts/neon-storage-scrubber/values.yaml | 2 ++ 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/charts/neon-storage-scrubber/Chart.yaml b/charts/neon-storage-scrubber/Chart.yaml index 5e408cb..40048de 100644 --- a/charts/neon-storage-scrubber/Chart.yaml +++ b/charts/neon-storage-scrubber/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: neon-storage-scrubber description: neon-storage-scrubber type: application -version: 1.1.0 +version: 1.2.0 appVersion: "v0.1.0" sources: - https://github.com/neondatabase/neon/tree/main/storage_scrubber diff --git a/charts/neon-storage-scrubber/README.md b/charts/neon-storage-scrubber/README.md index 56ea162..1a72daf 100644 --- a/charts/neon-storage-scrubber/README.md +++ b/charts/neon-storage-scrubber/README.md @@ -1,6 +1,6 @@ # neon-storage-scrubber -![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml) +![Version: 1.2.0](https://img.shields.io/badge/Version-1.2.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) [![Lint and Test Charts](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml/badge.svg)](https://github.com/neondatabase/helm-charts/actions/workflows/lint-test.yaml) neon-storage-scrubber @@ -42,6 +42,7 @@ $ helm install neon-storage-scrubber neondatabase/neon-storage-scrubber | settings.extraEnvs | list | `[{"name":"RUST_BACKTRACE","value":"1"},{"name":"PAGESERVER_DISABLE_FILE_LOGGING","value":"1"}]` | extra env variables when running the job | | settings.sentryEnvironment | string | `"development"` | "development" or "production". It will be visible in sentry in order to filter issues | | settings.sentryUrl | string | `""` | url (will be converted into `SENTRY_DSN` environment variable) used by sentry to collect error/panic events in neon-pg-sni-router | +| storageScrubber.activeDeadlineSeconds | int | `86400` | Timeout of the cronjob run | | storageScrubber.awsBucket | string | `""` | The AWS bucket for the pageserver storage | | storageScrubber.awsRegion | string | `""` | The AWS region to run the scrubber | | storageScrubber.command | list | `["pageserver-physical-gc","--min-age=1week"]` | The command to run | diff --git a/charts/neon-storage-scrubber/templates/cronjob.yaml b/charts/neon-storage-scrubber/templates/cronjob.yaml index 4442bd8..7db9c80 100644 --- a/charts/neon-storage-scrubber/templates/cronjob.yaml +++ b/charts/neon-storage-scrubber/templates/cronjob.yaml @@ -16,6 +16,7 @@ spec: {{- include "neon-storage-scrubber.labels" . | nindent 8 }} spec: backoffLimit: 0 # Do not restart if the task fails + activeDeadlineSeconds: {{ .Values.storageScrubber.activeDeadlineSeconds }} template: metadata: {{- with .Values.podAnnotations }} diff --git a/charts/neon-storage-scrubber/values.yaml b/charts/neon-storage-scrubber/values.yaml index 1ae0f27..64150bc 100644 --- a/charts/neon-storage-scrubber/values.yaml +++ b/charts/neon-storage-scrubber/values.yaml @@ -57,6 +57,8 @@ storageScrubber: storageControllerJwtToken: "" # -- URL of the storage controller storageControllerUrl: "" + # -- Timeout of the cronjob run + activeDeadlineSeconds: 86400 # -- Annotations for neon-storage-scrubber pods podAnnotations: {}