From 7ae32e50792abae557e4d540b071ecd0bd10e58b Mon Sep 17 00:00:00 2001 From: clyang82 Date: Fri, 16 Apr 2021 16:51:44 +0800 Subject: [PATCH 1/5] Update ignoreDeletionMarksDelay based on deleteDelay Signed-off-by: clyang82 --- jsonnet/obs-operator.jsonnet | 2 ++ 1 file changed, 2 insertions(+) diff --git a/jsonnet/obs-operator.jsonnet b/jsonnet/obs-operator.jsonnet index f001872b..372eec8f 100644 --- a/jsonnet/obs-operator.jsonnet +++ b/jsonnet/obs-operator.jsonnet @@ -32,7 +32,9 @@ local operatorObs = obs { } + if std.objectHas(cr.spec, 'rule') then cr.spec.rule else {}, stores+:: { + local deleteDelay = if std.objectHas(cr.spec, 'compact') && std.objectHas(cr.spec.compact, 'deleteDelay') then cr.spec.compact.deleteDelay else obs.thanos.compact.config.deleteDelay, securityContext: if std.objectHas(cr.spec, 'securityContext') then cr.spec.securityContext else obs.thanos.stores.config.securityContext, + ignoreDeletionMarksDelay: std.parseInt(std.substr(deleteDelay, 0, std.length(deleteDelay)-1))/2 + std.substr(deleteDelay, std.length(deleteDelay)-1, std.length(deleteDelay)), } + if std.objectHas(cr.spec, 'store') then cr.spec.store else {}, storeCache+:: (if std.objectHas(cr.spec, 'store') && std.objectHas(cr.spec.store, 'cache') then cr.spec.store.cache else {}) + { From 7e60117f41e087a3b4c29da20b9df5aeb27b29e4 Mon Sep 17 00:00:00 2001 From: clyang82 Date: Fri, 24 Dec 2021 22:05:16 +0800 Subject: [PATCH 2/5] expose ignoreDeletionMarksDelay and deleteDelay Signed-off-by: clyang82 --- api/v1alpha1/observatorium_types.go | 6 ++++++ jsonnet/obs-operator.jsonnet | 2 -- manifests/crds/core.observatorium.io_observatoria.yaml | 8 ++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/observatorium_types.go b/api/v1alpha1/observatorium_types.go index e057522e..50571457 100644 --- a/api/v1alpha1/observatorium_types.go +++ b/api/v1alpha1/observatorium_types.go @@ -144,6 +144,9 @@ type StoreSpec struct { // ServiceMonitor enables deploying a service monitor for the Thanos Stores. // +optional ServiceMonitor bool `json:"serviceMonitor,omitempty"` + // Duration after which the blocks marked for deletion will be filtered out while fetching blocks + // +optional + IgnoreDeletionMarksDelay string `json:"ignoreDeletionMarksDelay,omitempty"` } // StoreCacheSpec describes configuration for Store Memcached @@ -368,6 +371,9 @@ type CompactSpec struct { // ServiceMonitor enables deploying a service monitor for the Thanos Compactors. // +optional ServiceMonitor bool `json:"serviceMonitor,omitempty"` + // Time before a block marked for deletion is deleted from bucket + // +optional + DeleteDelay string `json:"deleteDelay,omitempty"` } type VolumeClaimTemplate struct { diff --git a/jsonnet/obs-operator.jsonnet b/jsonnet/obs-operator.jsonnet index 372eec8f..f001872b 100644 --- a/jsonnet/obs-operator.jsonnet +++ b/jsonnet/obs-operator.jsonnet @@ -32,9 +32,7 @@ local operatorObs = obs { } + if std.objectHas(cr.spec, 'rule') then cr.spec.rule else {}, stores+:: { - local deleteDelay = if std.objectHas(cr.spec, 'compact') && std.objectHas(cr.spec.compact, 'deleteDelay') then cr.spec.compact.deleteDelay else obs.thanos.compact.config.deleteDelay, securityContext: if std.objectHas(cr.spec, 'securityContext') then cr.spec.securityContext else obs.thanos.stores.config.securityContext, - ignoreDeletionMarksDelay: std.parseInt(std.substr(deleteDelay, 0, std.length(deleteDelay)-1))/2 + std.substr(deleteDelay, std.length(deleteDelay)-1, std.length(deleteDelay)), } + if std.objectHas(cr.spec, 'store') then cr.spec.store else {}, storeCache+:: (if std.objectHas(cr.spec, 'store') && std.objectHas(cr.spec.store, 'cache') then cr.spec.store.cache else {}) + { diff --git a/manifests/crds/core.observatorium.io_observatoria.yaml b/manifests/crds/core.observatorium.io_observatoria.yaml index 0e5c6aeb..037b9d60 100644 --- a/manifests/crds/core.observatorium.io_observatoria.yaml +++ b/manifests/crds/core.observatorium.io_observatoria.yaml @@ -1069,6 +1069,10 @@ spec: compact: description: Thanos CompactSpec properties: + deleteDelay: + description: Time before a block marked for deletion is deleted + from bucket + type: string enableDownsampling: description: EnableDownsampling enables downsampling. type: boolean @@ -2390,6 +2394,10 @@ spec: description: Version of Memcached image to be deployed. type: string type: object + ignoreDeletionMarksDelay: + description: Duration after which the blocks marked for deletion + will be filtered out while fetching blocks + type: string image: description: Thanos image type: string From 0f1d43fcc595f6f42b7a001341ef1563bf5758fe Mon Sep 17 00:00:00 2001 From: Chunlin Yang Date: Sat, 1 Jan 2022 20:24:45 +0800 Subject: [PATCH 3/5] Update api/v1alpha1/observatorium_types.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lucas Servén Marín --- api/v1alpha1/observatorium_types.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/api/v1alpha1/observatorium_types.go b/api/v1alpha1/observatorium_types.go index 50571457..427effce 100644 --- a/api/v1alpha1/observatorium_types.go +++ b/api/v1alpha1/observatorium_types.go @@ -141,10 +141,14 @@ type StoreSpec struct { // Compute Resources required by this container. // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` +<<<<<<< HEAD // ServiceMonitor enables deploying a service monitor for the Thanos Stores. // +optional ServiceMonitor bool `json:"serviceMonitor,omitempty"` // Duration after which the blocks marked for deletion will be filtered out while fetching blocks +======= + // Duration after which the blocks marked for deletion will be filtered out while fetching blocks. +>>>>>>> 045aa31 (Update api/v1alpha1/observatorium_types.go) // +optional IgnoreDeletionMarksDelay string `json:"ignoreDeletionMarksDelay,omitempty"` } From 02521cf69c1c8ebd968c130fcedd71d781182beb Mon Sep 17 00:00:00 2001 From: Chunlin Yang Date: Sat, 1 Jan 2022 20:24:57 +0800 Subject: [PATCH 4/5] Update api/v1alpha1/observatorium_types.go MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Lucas Servén Marín --- api/v1alpha1/observatorium_types.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/api/v1alpha1/observatorium_types.go b/api/v1alpha1/observatorium_types.go index 427effce..1085bda0 100644 --- a/api/v1alpha1/observatorium_types.go +++ b/api/v1alpha1/observatorium_types.go @@ -141,14 +141,10 @@ type StoreSpec struct { // Compute Resources required by this container. // +optional Resources v1.ResourceRequirements `json:"resources,omitempty"` -<<<<<<< HEAD // ServiceMonitor enables deploying a service monitor for the Thanos Stores. // +optional ServiceMonitor bool `json:"serviceMonitor,omitempty"` - // Duration after which the blocks marked for deletion will be filtered out while fetching blocks -======= // Duration after which the blocks marked for deletion will be filtered out while fetching blocks. ->>>>>>> 045aa31 (Update api/v1alpha1/observatorium_types.go) // +optional IgnoreDeletionMarksDelay string `json:"ignoreDeletionMarksDelay,omitempty"` } @@ -375,7 +371,7 @@ type CompactSpec struct { // ServiceMonitor enables deploying a service monitor for the Thanos Compactors. // +optional ServiceMonitor bool `json:"serviceMonitor,omitempty"` - // Time before a block marked for deletion is deleted from bucket + // Time before a block marked for deletion is deleted from object storage. // +optional DeleteDelay string `json:"deleteDelay,omitempty"` } From da2677980d01bdf7fe474aa0d05a1b6a9603cc33 Mon Sep 17 00:00:00 2001 From: clyang82 Date: Sat, 1 Jan 2022 20:26:50 +0800 Subject: [PATCH 5/5] Update description Signed-off-by: clyang82 --- manifests/crds/core.observatorium.io_observatoria.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manifests/crds/core.observatorium.io_observatoria.yaml b/manifests/crds/core.observatorium.io_observatoria.yaml index 037b9d60..c0721195 100644 --- a/manifests/crds/core.observatorium.io_observatoria.yaml +++ b/manifests/crds/core.observatorium.io_observatoria.yaml @@ -1071,7 +1071,7 @@ spec: properties: deleteDelay: description: Time before a block marked for deletion is deleted - from bucket + from object storage. type: string enableDownsampling: description: EnableDownsampling enables downsampling. @@ -2396,7 +2396,7 @@ spec: type: object ignoreDeletionMarksDelay: description: Duration after which the blocks marked for deletion - will be filtered out while fetching blocks + will be filtered out while fetching blocks. type: string image: description: Thanos image