Skip to content

Commit

Permalink
ksonnet: do not deploy table manager when shipper is in-use (#11020)
Browse files Browse the repository at this point in the history
**What this PR does / why we need it**:
Do not generate table manager manifests if shipper is being used.
table manager is a deprecated target and is not recommended when using
`tsdb` or `boltdb-shipper` indexes.
Compactor is already bunlded along with shipper and handles retention,
compaction for the `tsdb` and `boltb-shipper` indexes


**Which issue(s) this PR fixes**:
Fixes [#10943](#10943)

**Special notes for your reviewer**:

**Checklist**
- [x] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [x] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e)
- [ ] If the change is deprecating or removing a configuration option,
update the `deprecated-config.yaml` and `deleted-config.yaml` files
respectively in the `tools/deprecated-config-checker` directory. <!--
TODO(salvacorts): Add example PR -->
  • Loading branch information
ashwanthgoli authored Oct 27, 2023
1 parent c7eb757 commit 1781d7c
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@

#### Jsonnet

* [11020](https://github.com/grafana/loki/pull/11020) **ashwanthgoli**: Loki ksonnet: Do not generate table-manager manifests if shipper store is in-use.

* [10784](https://github.com/grafana/loki/pull/10894) **slim-bean** Update index gateway client to use a headless service.

* [10542](https://github.com/grafana/loki/pull/10542) **chaudum**: Remove legacy deployment mode for ingester (Deployment, without WAL) and instead always run them as StatefulSet.
Expand Down
3 changes: 2 additions & 1 deletion production/ksonnet/loki/loki.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
(import 'distributor.libsonnet') +
(import 'ingester.libsonnet') +
(import 'querier.libsonnet') +
(import 'table-manager.libsonnet') +
(import 'query-frontend.libsonnet') +
(import 'ruler.libsonnet') +

Expand All @@ -27,6 +26,8 @@
// BoltDB and TSDB Shipper support. Anything that modifies the compactor must be imported after this.
(import 'shipper.libsonnet') +

(import 'table-manager.libsonnet') +

// Multi-zone ingester related config
(import 'multi-zone.libsonnet') +

Expand Down
20 changes: 14 additions & 6 deletions production/ksonnet/loki/table-manager.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ local k = import 'ksonnet-util/kausal.libsonnet';
'bigtable.table-cache.enabled': true,
},

table_manager_container::
table_manager_container:: if !$._config.using_shipper_store then
container.new('table-manager', $._images.tableManager) +
container.withPorts($.util.defaultPorts) +
container.withArgsMixin(k.util.mapToFlags($.table_manager_args)) +
Expand All @@ -27,15 +27,23 @@ local k = import 'ksonnet-util/kausal.libsonnet';
container.mixin.readinessProbe.withTimeoutSeconds(1) +
container.withEnvMixin($._config.commonEnvs) +
k.util.resourcesRequests('100m', '100Mi') +
k.util.resourcesLimits('200m', '200Mi'),
k.util.resourcesLimits('200m', '200Mi')
else {},

local deployment = k.apps.v1.deployment,

table_manager_deployment:
table_manager_deployment: if !$._config.using_shipper_store then
deployment.new('table-manager', 1, [$.table_manager_container]) +
$.config_hash_mixin +
k.util.configVolumeMount('loki', '/etc/loki/config'),
k.util.configVolumeMount('loki', '/etc/loki/config')
else {},

table_manager_service:
k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels),

table_manager_service: if !$._config.using_shipper_store then
k.util.serviceFor($.table_manager_deployment, $._config.service_ignored_labels)
else {},

_config+: {
table_manager: if !$._config.using_shipper_store then super.table_manager else null,
},
}

0 comments on commit 1781d7c

Please sign in to comment.