Skip to content

Commit

Permalink
jsonnet: Set replicas for each Memcached cluster via _config settings
Browse files Browse the repository at this point in the history
Instead of needing to modify each statefulset, create _config settings that
can be used to adjust the replica count of each Memcached cluster.
  • Loading branch information
56quarters committed Oct 18, 2024
1 parent b1f5684 commit 6856280
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
5 changes: 4 additions & 1 deletion operations/mimir/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,10 @@
store_gateway_lazy_loading_enabled: true,

// Number of memcached replicas for each memcached statefulset
memcached_replicas: 3,
memcached_frontend_replicas: 3,
memcached_index_queries_replicas: 3,
memcached_chunks_replicas: 3,
memcached_metadata_replicas: 1,

cache_frontend_enabled: true,
cache_frontend_max_item_size_mb: 5,
Expand Down
11 changes: 10 additions & 1 deletion operations/mimir/memcached.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ memcached {
overprovision_factor: 1.05,
connection_limit: std.toString($._config.cache_frontend_connection_limit),
extended_options: ['track_sizes'],

statefulSet+:
statefulSet.mixin.spec.withReplicas($._config.memcached_frontend_replicas),
} + if $._config.memcached_frontend_mtls_enabled then $.memcached_mtls else {}
else {},

Expand All @@ -66,6 +69,9 @@ memcached {
overprovision_factor: 1.05,
connection_limit: std.toString($._config.cache_index_queries_connection_limit),
extended_options: ['track_sizes'],

statefulSet+:
statefulSet.mixin.spec.withReplicas($._config.memcached_index_queries_replicas),
} + if $._config.memcached_index_queries_mtls_enabled then $.memcached_mtls else {}
else {},

Expand All @@ -81,6 +87,9 @@ memcached {
overprovision_factor: 1.05,
connection_limit: std.toString($._config.cache_chunks_connection_limit),
extended_options: ['track_sizes'],

statefulSet+:
statefulSet.mixin.spec.withReplicas($._config.memcached_chunks_replicas),
} + if $._config.memcached_chunks_mtls_enabled then $.memcached_mtls else {}
else {},

Expand All @@ -98,7 +107,7 @@ memcached {
overprovision_factor: 1.05,

statefulSet+:
statefulSet.mixin.spec.withReplicas(1),
statefulSet.mixin.spec.withReplicas($._config.memcached_metadata_replicas),
} + if $._config.memcached_metadata_mtls_enabled then $.memcached_mtls else {}
else {},
}

0 comments on commit 6856280

Please sign in to comment.