Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move resource requests and limits into $._config #793

Merged
merged 2 commits into from
Jun 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* [ENHANCEMENT] Add `azure_request_duration_seconds` metric. [#767](https://github.com/grafana/tempo/pull/767) (@JosephWoodward)
* [ENHANCEMENT] Add `s3_request_duration_seconds` metric. [#776](https://github.com/grafana/tempo/pull/776) (@JosephWoodward)
* [ENHANCEMENT] Add `tempo_ingester_flush_size_bytes` metric. [#777](https://github.com/grafana/tempo/pull/777) (@bboreham)
* [ENHANCEMENT] Microservices jsonnet: resource requests and limits can be set in `$._config`. [#793](https://github.com/grafana/tempo/pull/793) (@kvrhdn)

## v1.0.1

Expand Down
4 changes: 4 additions & 0 deletions operations/jsonnet/microservices/common.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
local k = import 'ksonnet-util/kausal.libsonnet',
local container = k.core.v1.container,

withResources(resources)::
k.util.resourcesRequests(resources.requests.cpu, resources.requests.memory) +
k.util.resourcesLimits(resources.limits.cpu, resources.limits.memory),

readinessProbe::
container.mixin.readinessProbe.httpGet.withPath('/ready') +
container.mixin.readinessProbe.httpGet.withPort($._config.port) +
Expand Down
1 change: 1 addition & 0 deletions operations/jsonnet/microservices/compactor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
container.withVolumeMounts([
volumeMount.new(tempo_config_volume, '/conf'),
]) +
$.util.withResources($._config.compactor.resources) +
$.util.readinessProbe,

tempo_compactor_deployment:
Expand Down
72 changes: 50 additions & 22 deletions operations/jsonnet/microservices/config.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,71 @@
gossip_member_label: 'tempo-gossip-member',
compactor: {
replicas: 1,
resources: {
requests: {
cpu: '500m',
memory: '3Gi',
},
limits: {
cpu: '1',
memory: '5Gi',
},
yvrhdn marked this conversation as resolved.
Show resolved Hide resolved
},
},
query_frontend: {
replicas: 1,
resources: {
requests: {
cpu: '500m',
memory: '1Gi',
},
limits: {
cpu: '1',
memory: '2Gi',
},
},
},
querier: {
replicas: 2,
resources: {
requests: {
cpu: '500m',
memory: '1Gi',
},
limits: {
cpu: '1',
memory: '2Gi',
},
},
},
ingester: {
pvc_size: error 'Must specify an ingester pvc size',
pvc_storage_class: error 'Must specify an ingester pvc storage class',
replicas: 3,
resources: {
requests: {
cpu: '3',
memory: '3Gi',
},
limits: {
cpu: '5',
memory: '5Gi',
},
},
},
distributor: {
receivers: error 'Must specify receivers',
replicas: 1,
resources: {
requests: {
cpu: '3',
memory: '3Gi',
},
limits: {
cpu: '5',
memory: '5Gi',
},
},
},
memcached: {
replicas: 3,
Expand Down Expand Up @@ -56,26 +106,4 @@
},
},
},

// TODO: Move this out of config.libsonnet into their respective libsonnet files
local k = import 'ksonnet-util/kausal.libsonnet',
tempo_compactor_container+::
k.util.resourcesRequests('500m', '3Gi') +
k.util.resourcesLimits('1', '5Gi'),

tempo_distributor_container+::
k.util.resourcesRequests('3', '3Gi') +
k.util.resourcesLimits('5', '5Gi'),

tempo_ingester_container+::
k.util.resourcesRequests('3', '3Gi') +
k.util.resourcesLimits('5', '5Gi'),

tempo_query_frontend_container+::
k.util.resourcesRequests('500m', '1Gi') +
k.util.resourcesLimits('1', '2Gi'),

tempo_querier_container+::
k.util.resourcesRequests('500m', '1Gi') +
k.util.resourcesLimits('1', '2Gi'),
}
1 change: 1 addition & 0 deletions operations/jsonnet/microservices/distributor.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
container.withVolumeMounts([
volumeMount.new(tempo_config_volume, '/conf'),
]) +
$.util.withResources($._config.distributor.resources) +
$.util.readinessProbe,

tempo_distributor_deployment:
Expand Down
1 change: 1 addition & 0 deletions operations/jsonnet/microservices/frontend.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
container.withVolumeMounts([
volumeMount.new(tempo_config_volume, '/conf'),
]) +
$.util.withResources($._config.query_frontend.resources) +
$.util.readinessProbe,

tempo_query_container::
Expand Down
1 change: 1 addition & 0 deletions operations/jsonnet/microservices/ingester.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
volumeMount.new(tempo_config_volume, '/conf'),
volumeMount.new(tempo_data_volume, '/var/tempo'),
]) +
$.util.withResources($._config.ingester.resources) +
$.util.readinessProbe,

tempo_ingester_statefulset:
Expand Down
2 changes: 1 addition & 1 deletion operations/jsonnet/microservices/querier.libsonnet
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
container.withVolumeMounts([
volumeMount.new(tempo_config_volume, '/conf'),
]) +
// This depends on common.libsonnet
$.util.withResources($._config.querier.resources) +
$.util.readinessProbe,

tempo_querier_deployment:
Expand Down