From c97e428686e05510337749e0f8130f251cd73c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraci=20Paix=C3=A3o=20Kr=C3=B6hling?= Date: Thu, 12 Sep 2019 14:15:04 +0200 Subject: [PATCH] Added limits/requests and liveness/readiness probes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Juraci Paixão Kröhling --- components/jaeger-collector.libsonnet | 12 ++++++++++- .../manifests/jaeger-deployment.yaml | 20 +++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/components/jaeger-collector.libsonnet b/components/jaeger-collector.libsonnet index 09380b46d..2b81d7268 100644 --- a/components/jaeger-collector.libsonnet +++ b/components/jaeger-collector.libsonnet @@ -44,12 +44,16 @@ local service = k.core.v1.service; local mount = container.volumeMountsType; local volume = k.apps.v1.statefulSet.mixin.spec.template.spec.volumesType; + // the assumption based on past perf tests is that this collector should be able to comfortably + // ingest at least 2k spans/sec with badger and 256Mi of memory on 1 cpu. + // this depends on the span size, but these default values should provide a good base line local c = container.new($.jaeger.deployment.metadata.name, 'jaegertracing/all-in-one:1.14.0') + container.withArgs([ '--badger.directory-key=/var/jaeger/store/keys', '--badger.directory-value=/var/jaeger/store/values', '--badger.ephemeral=false', + '--collector.queue-size=4000', ],) + container.withEnv([ env.new('SPAN_STORAGE_TYPE', 'badger'), @@ -60,7 +64,13 @@ local service = k.core.v1.service; containerPort.newNamed(16686, 'query'), ], ) + - container.withVolumeMounts([mount.new('jaeger-store-data', '/var/jaeger/store')]); + container.withVolumeMounts([mount.new('jaeger-store-data', '/var/jaeger/store')]) + + container.mixin.readinessProbe.withFailureThreshold(3) + + container.mixin.readinessProbe.httpGet.withPath('/').withPort('14269').withScheme('HTTP') + + container.mixin.livenessProbe.withFailureThreshold(3) + + container.mixin.livenessProbe.httpGet.withPath('/').withPort('14269').withScheme('HTTP') + + container.mixin.resources.withRequests({ cpu: '1', memory: '256Mi' }) + + container.mixin.resources.withLimits({ cpu: '4', memory: '2Gi' }); deployment.new('jaeger-all-in-one', 1, c, $.jaeger.deployment.metadata.labels) + deployment.mixin.metadata.withNamespace('observatorium') + diff --git a/environments/kubernetes/manifests/jaeger-deployment.yaml b/environments/kubernetes/manifests/jaeger-deployment.yaml index 61f575cfc..f76d5ee63 100644 --- a/environments/kubernetes/manifests/jaeger-deployment.yaml +++ b/environments/kubernetes/manifests/jaeger-deployment.yaml @@ -20,10 +20,17 @@ spec: - --badger.directory-key=/var/jaeger/store/keys - --badger.directory-value=/var/jaeger/store/values - --badger.ephemeral=false + - --collector.queue-size=4000 env: - name: SPAN_STORAGE_TYPE value: badger image: jaegertracing/all-in-one:1.14.0 + livenessProbe: + failureThreshold: 3 + httpGet: + path: / + port: "14269" + scheme: HTTP name: jaeger-all-in-one ports: - containerPort: 14250 @@ -32,6 +39,19 @@ spec: name: admin-http - containerPort: 16686 name: query + readinessProbe: + failureThreshold: 3 + httpGet: + path: / + port: "14269" + scheme: HTTP + resources: + limits: + cpu: "4" + memory: 2Gi + requests: + cpu: "1" + memory: 256Mi volumeMounts: - mountPath: /var/jaeger/store name: jaeger-store-data