|
6 | 6 | local statefulSet = k.apps.v1.statefulSet,
|
7 | 7 | local service = k.core.v1.service,
|
8 | 8 | local containerPort = k.core.v1.containerPort,
|
| 9 | + local deployment = k.apps.v1.deployment, |
9 | 10 |
|
10 | 11 | _config+:: {
|
11 | 12 | // flag for tuning things when boltdb-shipper is current or upcoming index type.
|
|
14 | 15 | using_shipper_store: $._config.using_boltdb_shipper || $._config.using_tsdb_shipper,
|
15 | 16 |
|
16 | 17 | stateful_queriers: if self.using_shipper_store && !self.use_index_gateway then true else super.stateful_queriers,
|
| 18 | + enable_horizontally_scalable_compactor: false, |
17 | 19 |
|
18 | 20 | compactor_pvc_size: '10Gi',
|
19 | 21 | compactor_pvc_class: 'fast',
|
|
47 | 49 | pvc.mixin.spec.withStorageClassName($._config.compactor_pvc_class)
|
48 | 50 | else {},
|
49 | 51 |
|
50 |
| - compactor_args:: if $._config.using_shipper_store then $._config.commonArgs { |
| 52 | + compactor_args:: if !$._config.using_shipper_store then {} else $._config.commonArgs { |
51 | 53 | target: 'compactor',
|
| 54 | + } + if $._config.enable_horizontally_scalable_compactor then { |
| 55 | + 'compactor.horizontal-scaling-mode': 'main', |
52 | 56 | } else {},
|
53 | 57 |
|
54 | 58 | compactor_ports:: $.util.defaultPorts,
|
|
79 | 83 | compactor_service: if $._config.using_shipper_store then
|
80 | 84 | k.util.serviceFor($.compactor_statefulset, $._config.service_ignored_labels)
|
81 | 85 | else {},
|
| 86 | + |
| 87 | + local compactor_worker_enabled = $._config.using_shipper_store && $._config.enable_horizontally_scalable_compactor, |
| 88 | + |
| 89 | + compactor_worker_args:: if compactor_worker_enabled then $._config.commonArgs { |
| 90 | + target: 'compactor', |
| 91 | + 'compactor.horizontal-scaling-mode': 'worker', |
| 92 | + }, |
| 93 | + |
| 94 | + compactor_worker_container:: if !compactor_worker_enabled then {} else |
| 95 | + container.new('compactor-worker', $._images.compactor_worker) + |
| 96 | + container.withPorts($.util.defaultPorts) + |
| 97 | + container.withArgsMixin(k.util.mapToFlags($.compactor_worker_args)) + |
| 98 | + container.mixin.readinessProbe.httpGet.withPath('/ready') + |
| 99 | + container.mixin.readinessProbe.httpGet.withPort($._config.http_listen_port) + |
| 100 | + container.mixin.readinessProbe.withTimeoutSeconds(1) + |
| 101 | + container.withEnvMixin($._config.commonEnvs) + |
| 102 | + $.jaeger_mixin + |
| 103 | + k.util.resourcesRequests('1', '500Mi') + |
| 104 | + k.util.resourcesLimits('2', '1Gi') + |
| 105 | + container.withEnvMixin($._config.commonEnvs), |
| 106 | + |
| 107 | + compactor_worker_deployment: if !compactor_worker_enabled then {} else |
| 108 | + deployment.new('compactor-worker', 1, [$.compactor_worker_container]) + |
| 109 | + $.config_hash_mixin + |
| 110 | + k.util.configVolumeMount('loki', '/etc/loki/config') + |
| 111 | + k.util.configVolumeMount( |
| 112 | + $._config.overrides_configmap_mount_name, |
| 113 | + $._config.overrides_configmap_mount_path, |
| 114 | + ) + |
| 115 | + deployment.mixin.spec.strategy.rollingUpdate.withMaxSurge('15%') + |
| 116 | + deployment.mixin.spec.strategy.rollingUpdate.withMaxUnavailable('15%'), |
82 | 117 | }
|
0 commit comments