Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace OpenSearch Backup Job with SM Policy #2344

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/flavors/air-gapped/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ opensearch:
min: 300 # 12 / day * 30 days = 360, subtract some to account for failures
max: 500
ageSeconds: 2592000 # 30 days
retentionAge: 30d # 30 days
backupSchedule: 30 */2 * * * # 30 min past every 2nd hour to avoid collision with retention

harbor:
Expand Down
1 change: 0 additions & 1 deletion config/flavors/dev/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ opensearch:
snapshot:
enabled: false
backupSchedule: 0 */12 * * * # run twice/day
retentionSchedule: 0 1 * * * # 1am

prometheus:
alertmanagerSpec:
Expand Down
1 change: 1 addition & 0 deletions config/flavors/prod/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ opensearch:
min: 300 # 12 / day * 30 days = 360, subtract some to account for failures
max: 500
ageSeconds: 2592000 # 30 days
retentionAge: 30d # 30 days
backupSchedule: 30 */2 * * * # 30 min past every 2nd hour to avoid collision with retention

harbor:
Expand Down
9 changes: 5 additions & 4 deletions config/sc-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -973,12 +973,13 @@ opensearch:
repository: opensearch-snapshots # Uses the bucket set in `objectStorage.buckets.opensearch`
min: 7
max: 14
retentionAge: 10d
backupSchedule: 0 */2 * * *
retentionSchedule: 0 0 * * *

# Needed while migration to Snapshot Management Policy
ageSeconds: 864000
maxRequestSeconds: 1200
backupSchedule: 0 */2 * * *
backupStartingDeadlineSeconds: 600
backupActiveDeadlineSeconds: 600
retentionSchedule: '@daily'
retentionStartingDeadlineSeconds: 600
retentionActiveDeadlineSeconds: 2700
retentionResources:
Expand Down
20 changes: 8 additions & 12 deletions config/schemas/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5606,7 +5606,7 @@ properties:
snapshot:
title: OpenSearch Snapshot
description: |-
Configures the CronJob and repository to take snapshots in OpenSearch.
Configure OpenSearch snapshot creation and retention.

This requires that `objectStorage` is configured, and will use the bucket or container set in `objectStorage.buckets.opensearch`.
type: object
Expand Down Expand Up @@ -5635,26 +5635,18 @@ properties:
type: number
default: 1200
backupSchedule:
title: OpenSearch Backup CronJob Schedule
title: OpenSearch Snapshot Backup Schedule
description: |-
Schedule to trigger Opensearch backups.
Uses the Cron format, see https://en.wikipedia.org/wiki/Cron.
default: 0 */2 * * *
$ref: '#/$defs/cronSchedule'
backupStartingDeadlineSeconds:
title: OpenSearch Backup Job Starting Deadline
type: number
default: 600
backupActiveDeadlineSeconds:
title: OpenSearch Backup Job Active Deadline
type: number
default: 600
retentionSchedule:
title: OpenSearch Retention CronJob Schedule
title: OpenSearch Snapshot Retention Schedule
description: |-
Schedule to check for and remove old snapshots.
Uses the Cron format, see https://en.wikipedia.org/wiki/Cron.
default: '@daily'
default: '0 0 * * *'
$ref: '#/$defs/cronSchedule'
retentionStartingDeadlineSeconds:
title: OpenSearch Retention Job Starting Deadline
Expand All @@ -5666,6 +5658,10 @@ properties:
default: 2700
retentionResources:
$ref: '#/$defs/kubernetesResourceRequirements'
retentionAge:
title: OpenSearch Maximum Snapshot Age
type: string
default: '10d'
securityadmin:
title: OpenSearch Security Admin
description: Configures the Job that initialises OpenSearch Security.
Expand Down
5 changes: 0 additions & 5 deletions docs/sbom.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -466,10 +466,6 @@
name: node-local-dns
app_version: ''
chart_version: 0.1.1
- domain: Custom Helm Charts
name: opensearch-backup
app_version: 0.1.0
chart_version: 0.1.0
- domain: Custom Helm Charts
name: opensearch-configurer
app_version: 0.1.0
Expand Down Expand Up @@ -780,7 +776,6 @@
- opensearch
- init-harbor
- opensearch-configurer
- opensearch-backup
- domain: Container images
name: "docker.io/opensearchproject/opensearch-dashboards"
tag: "2.12.0"
Expand Down
4 changes: 2 additions & 2 deletions helmfile.d/charts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ As part of our effort to make our Helm charts available for public and internal

```terminal
cd helmfile.d/charts
helm pull --verify oci://ghcr.io/elastisys/opensearch-slm --version 0.1.0 --keyring public.gpg
helm pull --verify oci://ghcr.io/elastisys/opensearch-configurer --version 0.1.0 --keyring public.gpg
```
1. Pull and install charts e.g:
```terminal
helm install opensearch-slm oci://ghcr.io/elastisys/opensearch-slm --version 0.1.0 --namespace <NAMESPACE>
helm install opensearch-configurer oci://ghcr.io/elastisys/opensearch-configurer --version 0.1.0 --namespace <NAMESPACE>
```
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
"pluginVersion": "8.2.7",
"targets": [
{
"expr": "min((time()-kube_job_status_completion_time{job_name=~\"opensearch-backup-.*\", cluster=~\"$cluster\"})/3600)",
"expr": "min((time()-elasticsearch_snapshot_stats_latest_snapshot_timestamp_seconds{cluster=~\"$cluster\"})/3600)",
"instant": false,
"interval": "",
"legendFormat": "{{job_name}}",
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ spec:
- podSelector:
matchLabels:
app.kubernetes.io/instance: opensearch-curator
- podSelector:
matchLabels:
app.kubernetes.io/instance: opensearch-backup
- podSelector:
matchLabels:
app.kubernetes.io/instance: opensearch-slm
Expand Down
23 changes: 0 additions & 23 deletions helmfile.d/charts/opensearch/backup/.helmignore

This file was deleted.

6 changes: 0 additions & 6 deletions helmfile.d/charts/opensearch/backup/Chart.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions helmfile.d/charts/opensearch/backup/scripts/backup.sh

This file was deleted.

52 changes: 0 additions & 52 deletions helmfile.d/charts/opensearch/backup/templates/_helpers.tpl

This file was deleted.

This file was deleted.

58 changes: 0 additions & 58 deletions helmfile.d/charts/opensearch/backup/templates/cronjob.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions helmfile.d/charts/opensearch/backup/values.yaml

This file was deleted.

Loading