From d7c93437302623dc7242dda96090b07125a9c19e Mon Sep 17 00:00:00 2001 From: Matt Young Date: Fri, 2 Oct 2020 01:15:46 -0400 Subject: [PATCH] parameterize PVC storage class (ingester, querier, compactor) --- production/ksonnet/loki/boltdb_shipper.libsonnet | 3 ++- production/ksonnet/loki/config.libsonnet | 14 ++++++++++---- production/ksonnet/loki/ingester.libsonnet | 2 +- production/ksonnet/loki/querier.libsonnet | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/production/ksonnet/loki/boltdb_shipper.libsonnet b/production/ksonnet/loki/boltdb_shipper.libsonnet index dd0bf70b6e328..929bf67031eee 100644 --- a/production/ksonnet/loki/boltdb_shipper.libsonnet +++ b/production/ksonnet/loki/boltdb_shipper.libsonnet @@ -13,6 +13,7 @@ boltdb_shipper_shared_store: error 'must define boltdb_shipper_shared_store', compactor_pvc_size: '10Gi', + compactor_pvc_class: 'fast', index_period_hours: if self.using_boltdb_shipper then 24 else super.index_period_hours, loki+: if self.using_boltdb_shipper then { chunk_store_config+: { @@ -47,7 +48,7 @@ pvc.new('compactor-data') + pvc.mixin.spec.resources.withRequests({ storage: $._config.compactor_pvc_size }) + pvc.mixin.spec.withAccessModes(['ReadWriteOnce']) + - pvc.mixin.spec.withStorageClassName('fast') + pvc.mixin.spec.withStorageClassName($._config.ingester_pvc_class) else {}, compactor_args:: if $._config.using_boltdb_shipper then { diff --git a/production/ksonnet/loki/config.libsonnet b/production/ksonnet/loki/config.libsonnet index 21c8069d868e9..941ec2844758b 100644 --- a/production/ksonnet/loki/config.libsonnet +++ b/production/ksonnet/loki/config.libsonnet @@ -13,11 +13,17 @@ using_boltdb_shipper: true, // flags for running ingesters/queriers as a statefulset instead of deployment type. - stateful_ingesters: false, - ingester_pvc_size: '5Gi', + stateful_ingesters: false, + ingester_pvc_size: '5Gi', + ingester_pvc_class: 'fast', + + stateful_queriers: false, + querier_pvc_size: '10Gi', + querier_pvc_class: 'fast', + + compactor_pvc_size: '10Gi', + compactor_pvc_class: 'fast', - stateful_queriers: false, - querier_pvc_size: '10Gi', querier: { // This value should be set equal to (or less than) the CPU cores of the system the querier runs. diff --git a/production/ksonnet/loki/ingester.libsonnet b/production/ksonnet/loki/ingester.libsonnet index 40bb82ea81301..02861a3856c80 100644 --- a/production/ksonnet/loki/ingester.libsonnet +++ b/production/ksonnet/loki/ingester.libsonnet @@ -49,7 +49,7 @@ pvc.new('ingester-data') + pvc.mixin.spec.resources.withRequests({ storage: '10Gi' }) + pvc.mixin.spec.withAccessModes(['ReadWriteOnce']) + - pvc.mixin.spec.withStorageClassName('fast') + pvc.mixin.spec.withStorageClassName($._config.ingester_pvc_class) else {}, ingester_statefulset: if $._config.stateful_ingesters then diff --git a/production/ksonnet/loki/querier.libsonnet b/production/ksonnet/loki/querier.libsonnet index f7c1e3d9bf29f..ccdb3f3fe1b5e 100644 --- a/production/ksonnet/loki/querier.libsonnet +++ b/production/ksonnet/loki/querier.libsonnet @@ -38,7 +38,7 @@ pvc.new('querier-data') + pvc.mixin.spec.resources.withRequests({ storage: $._config.querier_pvc_size }) + pvc.mixin.spec.withAccessModes(['ReadWriteOnce']) + - pvc.mixin.spec.withStorageClassName('fast') + pvc.mixin.spec.withStorageClassName($._config.querier_pvc_class) else {}, querier_statefulset: if $._config.stateful_queriers then