Skip to content

Commit

Permalink
add replicas in instance config
Browse files Browse the repository at this point in the history
Signed-off-by: Thibault Mange <[email protected]>
  • Loading branch information
thibaultmg committed Sep 25, 2023
1 parent d000c98 commit b94992a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
18 changes: 10 additions & 8 deletions services_go/instances/rhobs/rhobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ import (
func ClusterConfigs() []observatorium.InstanceConfiguration {
return []observatorium.InstanceConfiguration{
{
Cluster: "app-sre-stage-01",
Namespace: "rhobs",
Instance: "rhobs",
Tenants: []observatorium.TenantInstanceConfiguration{},
Cluster: "app-sre-stage-01",
Namespace: "rhobs",
Instance: "rhobs",
Tenants: []observatorium.TenantInstanceConfiguration{},
ThanosStoreReplicas: 2,
},
{
Cluster: "telemeter-prod-01",
Namespace: "rhobs",
Instance: "rhobs",
Tenants: []observatorium.TenantInstanceConfiguration{},
Cluster: "telemeter-prod-01",
Namespace: "rhobs",
Instance: "rhobs",
Tenants: []observatorium.TenantInstanceConfiguration{},
ThanosStoreReplicas: 3,
},
}
}
3 changes: 1 addition & 2 deletions services_go/observatorium/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,8 @@ func makeCompactor(namespace string) (*compactor.CompactorStatefulSet, []PostPro

}

func makeStore(namespace string) (*store.StoreStatefulSet, []PostProcessFunc) {
func makeStore(namespace string, replicas int32) (*store.StoreStatefulSet, []PostProcessFunc) {
// K8s config
replicas := int32(1)
storeStatefulSet := store.NewStore()
storeStatefulSet.Image = thanosImage
storeStatefulSet.ImageTag = thanosImageTag
Expand Down
12 changes: 6 additions & 6 deletions services_go/observatorium/observatorium.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ type TenantInstanceConfiguration struct {
// type ComponentsConfig struct {

type InstanceConfiguration struct {
Cluster string
Instance string
Namespace string
Tenants []TenantInstanceConfiguration
// Components
Cluster string
Instance string
Namespace string
Tenants []TenantInstanceConfiguration
ThanosStoreReplicas int32
}

type PostProcessFunc func(obj runtime.Object)
Expand All @@ -50,7 +50,7 @@ type Observatorium struct {

func NewObservatorium(cfg *InstanceConfiguration) *Observatorium {
postProcessFuncs := []PostProcessFunc{updateServiceMonitorNamespace}
storeComponent, postProcess := makeStore(cfg.Namespace)
storeComponent, postProcess := makeStore(cfg.Namespace, cfg.ThanosStoreReplicas)
postProcessFuncs = append(postProcessFuncs, postProcess...)
compactorComponent, postProcess := makeCompactor(cfg.Namespace)
postProcessFuncs = append(postProcessFuncs, postProcess...)
Expand Down

0 comments on commit b94992a

Please sign in to comment.