Skip to content

Commit 72094a4

Browse files
authored
Remove long term store gateway shards (#797)
1 parent 2a64487 commit 72094a4

File tree

2 files changed

+253
-283
lines changed
  • magefiles
  • resources/services/rhobs-thanos-operator/production

2 files changed

+253
-283
lines changed

magefiles/cr.go

+253-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ func (p Production) OperatorCR() {
2727
var objs []runtime.Object
2828

2929
objs = append(objs, queryCR(ns, ProductionMaps, true)...)
30-
objs = append(objs, storeCR(ns, ProductionMaps)...)
30+
objs = append(objs, tmpStoreProduction(ns, ProductionMaps)...)
3131
objs = append(objs, compactTempProduction()...)
3232

3333
// Sort objects by Kind then Name
@@ -476,6 +476,258 @@ func storeCR(namespace string, m TemplateMaps) []runtime.Object {
476476
return []runtime.Object{store0to2w, store2wto90d, store90dplus, storeDefault}
477477
}
478478

479+
func tmpStoreProduction(namespace string, m TemplateMaps) []runtime.Object {
480+
// store0to2w := &v1alpha1.ThanosStore{
481+
// TypeMeta: metav1.TypeMeta{
482+
// APIVersion: "monitoring.thanos.io/v1alpha1",
483+
// Kind: "ThanosStore",
484+
// },
485+
// ObjectMeta: metav1.ObjectMeta{
486+
// Name: "telemeter-0to2w",
487+
// Namespace: namespace,
488+
// },
489+
// Spec: v1alpha1.ThanosStoreSpec{
490+
// CommonFields: v1alpha1.CommonFields{
491+
// Image: ptr.To(TemplateFn("STORE02W", m.Images)),
492+
// Version: ptr.To(TemplateFn("STORE02W", m.Versions)),
493+
// ImagePullPolicy: ptr.To(corev1.PullIfNotPresent),
494+
// LogLevel: ptr.To(TemplateFn("STORE02W", m.LogLevels)),
495+
// LogFormat: ptr.To("logfmt"),
496+
// ResourceRequirements: ptr.To(TemplateFn("STORE02W", m.ResourceRequirements)),
497+
// },
498+
// Replicas: TemplateFn("STORE02W", m.Replicas),
499+
// ObjectStorageConfig: TemplateFn("TELEMETER", m.ObjectStorageBucket),
500+
// ShardingStrategy: v1alpha1.ShardingStrategy{
501+
// Type: v1alpha1.Block,
502+
// Shards: 1,
503+
// },
504+
// IndexHeaderConfig: &v1alpha1.IndexHeaderConfig{
505+
// EnableLazyReader: ptr.To(true),
506+
// LazyDownloadStrategy: ptr.To("lazy"),
507+
// LazyReaderIdleTimeout: ptr.To(v1alpha1.Duration("5m")),
508+
// },
509+
// StoreLimitsOptions: &v1alpha1.StoreLimitsOptions{
510+
// StoreLimitsRequestSamples: 627040000,
511+
// StoreLimitsRequestSeries: 1000000,
512+
// },
513+
// BlockConfig: &v1alpha1.BlockConfig{
514+
// BlockDiscoveryStrategy: v1alpha1.BlockDiscoveryStrategy("concurrent"),
515+
// BlockFilesConcurrency: ptr.To(int32(1)),
516+
// BlockMetaFetchConcurrency: ptr.To(int32(32)),
517+
// },
518+
// IgnoreDeletionMarksDelay: v1alpha1.Duration("24h"),
519+
// MaxTime: ptr.To(v1alpha1.Duration("-2w")),
520+
// StorageSize: TemplateFn("STORE02W", m.StorageSize),
521+
// Additional: v1alpha1.Additional{
522+
// Containers: []corev1.Container{
523+
// tracingSidecar(m),
524+
// },
525+
// Args: []string{
526+
// `--tracing.config="config":
527+
// "sampler_param": 2
528+
// "sampler_type": "ratelimiting"
529+
// "service_name": "thanos-store"
530+
//"type": "JAEGER"`,
531+
// },
532+
// },
533+
// FeatureGates: &v1alpha1.FeatureGates{
534+
// ServiceMonitorConfig: &v1alpha1.ServiceMonitorConfig{
535+
// Enable: ptr.To(false),
536+
// },
537+
// },
538+
// },
539+
// }
540+
//
541+
// store2wto90d := &v1alpha1.ThanosStore{
542+
// TypeMeta: metav1.TypeMeta{
543+
// APIVersion: "monitoring.thanos.io/v1alpha1",
544+
// Kind: "ThanosStore",
545+
// },
546+
// ObjectMeta: metav1.ObjectMeta{
547+
// Name: "telemeter-2wto90d",
548+
// Namespace: namespace,
549+
// },
550+
// Spec: v1alpha1.ThanosStoreSpec{
551+
// CommonFields: v1alpha1.CommonFields{
552+
// Image: ptr.To(TemplateFn("STORE2W90D", m.Images)),
553+
// Version: ptr.To(TemplateFn("STORE2W90D", m.Versions)),
554+
// ImagePullPolicy: ptr.To(corev1.PullIfNotPresent),
555+
// LogLevel: ptr.To(TemplateFn("STORE2W90D", m.LogLevels)),
556+
// LogFormat: ptr.To("logfmt"),
557+
// ResourceRequirements: ptr.To(TemplateFn("STORE2W90D", m.ResourceRequirements)),
558+
// },
559+
// Replicas: TemplateFn("STORE2W90D", m.Replicas),
560+
// ObjectStorageConfig: TemplateFn("TELEMETER", m.ObjectStorageBucket),
561+
// ShardingStrategy: v1alpha1.ShardingStrategy{
562+
// Type: v1alpha1.Block,
563+
// Shards: 1,
564+
// },
565+
// IndexHeaderConfig: &v1alpha1.IndexHeaderConfig{
566+
// EnableLazyReader: ptr.To(true),
567+
// LazyDownloadStrategy: ptr.To("lazy"),
568+
// LazyReaderIdleTimeout: ptr.To(v1alpha1.Duration("5m")),
569+
// },
570+
// StoreLimitsOptions: &v1alpha1.StoreLimitsOptions{
571+
// StoreLimitsRequestSamples: 627040000,
572+
// StoreLimitsRequestSeries: 1000000,
573+
// },
574+
// BlockConfig: &v1alpha1.BlockConfig{
575+
// BlockDiscoveryStrategy: v1alpha1.BlockDiscoveryStrategy("concurrent"),
576+
// BlockFilesConcurrency: ptr.To(int32(1)),
577+
// BlockMetaFetchConcurrency: ptr.To(int32(32)),
578+
// },
579+
// IgnoreDeletionMarksDelay: v1alpha1.Duration("24h"),
580+
// MinTime: ptr.To(v1alpha1.Duration("-90d")),
581+
// MaxTime: ptr.To(v1alpha1.Duration("-2w")),
582+
// StorageSize: TemplateFn("STORE2W90D", m.StorageSize),
583+
// Additional: v1alpha1.Additional{
584+
// Containers: []corev1.Container{
585+
// tracingSidecar(m),
586+
// },
587+
// Args: []string{
588+
// `--tracing.config="config":
589+
// "sampler_param": 2
590+
// "sampler_type": "ratelimiting"
591+
// "service_name": "thanos-store"
592+
//"type": "JAEGER"`,
593+
// },
594+
// },
595+
// FeatureGates: &v1alpha1.FeatureGates{
596+
// ServiceMonitorConfig: &v1alpha1.ServiceMonitorConfig{
597+
// Enable: ptr.To(false),
598+
// },
599+
// PodDisruptionBudgetConfig: &v1alpha1.PodDisruptionBudgetConfig{
600+
// Enable: ptr.To(false),
601+
// },
602+
// },
603+
// },
604+
// }
605+
//
606+
// store90dplus := &v1alpha1.ThanosStore{
607+
// TypeMeta: metav1.TypeMeta{
608+
// APIVersion: "monitoring.thanos.io/v1alpha1",
609+
// Kind: "ThanosStore",
610+
// },
611+
// ObjectMeta: metav1.ObjectMeta{
612+
// Name: "telemeter-90dplus",
613+
// Namespace: namespace,
614+
// },
615+
// Spec: v1alpha1.ThanosStoreSpec{
616+
// CommonFields: v1alpha1.CommonFields{
617+
// Image: ptr.To(TemplateFn("STORE90D+", m.Images)),
618+
// Version: ptr.To(TemplateFn("STORE90D+", m.Versions)),
619+
// ImagePullPolicy: ptr.To(corev1.PullIfNotPresent),
620+
// LogLevel: ptr.To(TemplateFn("STORE90D+", m.LogLevels)),
621+
// LogFormat: ptr.To("logfmt"),
622+
// ResourceRequirements: ptr.To(TemplateFn("STORE90D+", m.ResourceRequirements)),
623+
// },
624+
// Replicas: TemplateFn("STORE90D+", m.Replicas),
625+
// ObjectStorageConfig: TemplateFn("TELEMETER", m.ObjectStorageBucket),
626+
// ShardingStrategy: v1alpha1.ShardingStrategy{
627+
// Type: v1alpha1.Block,
628+
// Shards: 1,
629+
// },
630+
// IndexHeaderConfig: &v1alpha1.IndexHeaderConfig{
631+
// EnableLazyReader: ptr.To(true),
632+
// LazyDownloadStrategy: ptr.To("lazy"),
633+
// LazyReaderIdleTimeout: ptr.To(v1alpha1.Duration("5m")),
634+
// },
635+
// StoreLimitsOptions: &v1alpha1.StoreLimitsOptions{
636+
// StoreLimitsRequestSamples: 627040000,
637+
// StoreLimitsRequestSeries: 1000000,
638+
// },
639+
// BlockConfig: &v1alpha1.BlockConfig{
640+
// BlockDiscoveryStrategy: v1alpha1.BlockDiscoveryStrategy("concurrent"),
641+
// BlockFilesConcurrency: ptr.To(int32(1)),
642+
// BlockMetaFetchConcurrency: ptr.To(int32(32)),
643+
// },
644+
// IgnoreDeletionMarksDelay: v1alpha1.Duration("24h"),
645+
// MinTime: ptr.To(v1alpha1.Duration("-90d")),
646+
// StorageSize: TemplateFn("STORE90D+", m.StorageSize),
647+
// Additional: v1alpha1.Additional{
648+
// Containers: []corev1.Container{
649+
// tracingSidecar(m),
650+
// },
651+
// Args: []string{
652+
// `--tracing.config="config":
653+
// "sampler_param": 2
654+
// "sampler_type": "ratelimiting"
655+
// "service_name": "thanos-store"
656+
//"type": "JAEGER"`,
657+
// },
658+
// },
659+
// FeatureGates: &v1alpha1.FeatureGates{
660+
// ServiceMonitorConfig: &v1alpha1.ServiceMonitorConfig{
661+
// Enable: ptr.To(false),
662+
// },
663+
// },
664+
// },
665+
// }
666+
667+
storeDefault := &v1alpha1.ThanosStore{
668+
TypeMeta: metav1.TypeMeta{
669+
APIVersion: "monitoring.thanos.io/v1alpha1",
670+
Kind: "ThanosStore",
671+
},
672+
ObjectMeta: metav1.ObjectMeta{
673+
Name: "default",
674+
Namespace: namespace,
675+
},
676+
Spec: v1alpha1.ThanosStoreSpec{
677+
CommonFields: v1alpha1.CommonFields{
678+
Image: ptr.To(TemplateFn("STORE_DEFAULT", m.Images)),
679+
Version: ptr.To(TemplateFn("STORE_DEFAULT", m.Versions)),
680+
ImagePullPolicy: ptr.To(corev1.PullIfNotPresent),
681+
LogLevel: ptr.To(TemplateFn("STORE_DEFAULT", m.LogLevels)),
682+
LogFormat: ptr.To("logfmt"),
683+
ResourceRequirements: ptr.To(TemplateFn("STORE_DEFAULT", m.ResourceRequirements)),
684+
},
685+
Replicas: TemplateFn("STORE_DEFAULT", m.Replicas),
686+
ObjectStorageConfig: TemplateFn("DEFAULT", m.ObjectStorageBucket),
687+
ShardingStrategy: v1alpha1.ShardingStrategy{
688+
Type: v1alpha1.Block,
689+
Shards: 1,
690+
},
691+
IndexHeaderConfig: &v1alpha1.IndexHeaderConfig{
692+
EnableLazyReader: ptr.To(true),
693+
LazyDownloadStrategy: ptr.To("lazy"),
694+
LazyReaderIdleTimeout: ptr.To(v1alpha1.Duration("5m")),
695+
},
696+
StoreLimitsOptions: &v1alpha1.StoreLimitsOptions{
697+
StoreLimitsRequestSamples: 0,
698+
StoreLimitsRequestSeries: 0,
699+
},
700+
BlockConfig: &v1alpha1.BlockConfig{
701+
BlockDiscoveryStrategy: v1alpha1.BlockDiscoveryStrategy("concurrent"),
702+
BlockFilesConcurrency: ptr.To(int32(1)),
703+
BlockMetaFetchConcurrency: ptr.To(int32(32)),
704+
},
705+
IgnoreDeletionMarksDelay: v1alpha1.Duration("24h"),
706+
MaxTime: ptr.To(v1alpha1.Duration("-22h")),
707+
StorageSize: TemplateFn("STORE_DEFAULT", m.StorageSize),
708+
Additional: v1alpha1.Additional{
709+
Containers: []corev1.Container{
710+
tracingSidecar(m),
711+
},
712+
Args: []string{
713+
`--tracing.config="config":
714+
"sampler_param": 2
715+
"sampler_type": "ratelimiting"
716+
"service_name": "thanos-store"
717+
"type": "JAEGER"`,
718+
},
719+
},
720+
FeatureGates: &v1alpha1.FeatureGates{
721+
ServiceMonitorConfig: &v1alpha1.ServiceMonitorConfig{
722+
Enable: ptr.To(false),
723+
},
724+
},
725+
},
726+
}
727+
// return []runtime.Object{store0to2w, store2wto90d, store90dplus, storeDefault}
728+
return []runtime.Object{storeDefault}
729+
}
730+
479731
func receiveCR(namespace string, m TemplateMaps) runtime.Object {
480732
return &v1alpha1.ThanosReceive{
481733
TypeMeta: metav1.TypeMeta{

0 commit comments

Comments
 (0)