diff --git a/charts/opentelemetry-demo/examples/default/rendered/component.yaml b/charts/opentelemetry-demo/examples/default/rendered/component.yaml index ac09cb011..e7db6b088 100644 --- a/charts/opentelemetry-demo/examples/default/rendered/component.yaml +++ b/charts/opentelemetry-demo/examples/default/rendered/component.yaml @@ -393,6 +393,9 @@ spec: value: http://example-otelcol:4317 - name: AD_SERVICE_PORT value: "8080" + resources: + limits: + memory: 300Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -459,6 +462,9 @@ spec: value: http://example-otelcol:4317 - name: CART_SERVICE_PORT value: "8080" + resources: + limits: + memory: 160Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -533,6 +539,9 @@ spec: value: http://example-otelcol:4317 - name: CHECKOUT_SERVICE_PORT value: "8080" + resources: + limits: + memory: 20Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -597,6 +606,9 @@ spec: value: http://example-otelcol:4317 - name: CURRENCY_SERVICE_PORT value: "8080" + resources: + limits: + memory: 20Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -665,6 +677,9 @@ spec: value: http://example-otelcol:4318/v1/traces - name: EMAIL_SERVICE_PORT value: "8080" + resources: + limits: + memory: 100Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -735,6 +750,9 @@ spec: value: ecto://ffs:ffs@example-ffs-postgres:5432/ffs - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://example-otelcol:4317 + resources: + limits: + memory: 160Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -801,6 +819,9 @@ spec: value: ffs - name: OTEL_EXPORTER_OTLP_ENDPOINT value: http://example-otelcol:4317 + resources: + limits: + memory: 120Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -879,6 +900,9 @@ spec: value: http://example-otelcol:4317 - name: FRONTEND_PORT value: "8080" + resources: + limits: + memory: 200Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -955,6 +979,9 @@ spec: value: http://example-otelcol:4317 - name: LOADGENERATOR_PORT value: "8089" + resources: + limits: + memory: 120Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1017,6 +1044,9 @@ spec: value: http://example-otelcol:4317 - name: PAYMENT_SERVICE_PORT value: "8080" + resources: + limits: + memory: 70Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1081,6 +1111,9 @@ spec: value: "8080" - name: FEATURE_FLAG_GRPC_SERVICE_ADDR value: 'example-featureflag-service:50053' + resources: + limits: + memory: 20Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1151,6 +1184,9 @@ spec: value: 'example-otelcol:4317' - name: QUOTE_SERVICE_PORT value: "8080" + resources: + limits: + memory: 30Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1219,6 +1255,9 @@ spec: value: "8080" - name: PRODUCT_CATALOG_SERVICE_ADDR value: 'example-product-catalog-service:8080' + resources: + limits: + memory: 500Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1277,6 +1316,9 @@ spec: fieldPath: metadata.name - name: OTEL_RESOURCE_ATTRIBUTES value: service.name=$(OTEL_SERVICE_NAME),k8s.namespace.name=$(OTEL_K8S_NAMESPACE),k8s.node.name=$(OTEL_K8S_NODE_NAME),k8s.pod.name=$(OTEL_K8S_POD_NAME) + resources: + limits: + memory: 20Mi --- # Source: opentelemetry-demo/templates/component.yaml apiVersion: apps/v1 @@ -1345,3 +1387,6 @@ spec: value: "8080" - name: QUOTE_SERVICE_ADDR value: http://example-quote-service:8080 + resources: + limits: + memory: 20Mi diff --git a/charts/opentelemetry-demo/examples/default/rendered/jaeger.yaml b/charts/opentelemetry-demo/examples/default/rendered/jaeger.yaml index a50fd0c9a..8b74b949c 100644 --- a/charts/opentelemetry-demo/examples/default/rendered/jaeger.yaml +++ b/charts/opentelemetry-demo/examples/default/rendered/jaeger.yaml @@ -53,25 +53,28 @@ spec: app.kubernetes.io/component: jaeger spec: containers: - - env: - - name: COLLECTOR_ZIPKIN_HTTP_PORT - value: "9411" - image: "jaegertracing/all-in-one:latest" - name: jaeger - ports: - - containerPort: 5775 - protocol: UDP - - containerPort: 6831 - protocol: UDP - - containerPort: 6832 - protocol: UDP - - containerPort: 5778 - protocol: TCP - - containerPort: 16686 - protocol: TCP - - containerPort: 14268 - protocol: TCP - - containerPort: 9411 - protocol: TCP - - containerPort: 14250 - protocol: TCP + - env: + - name: COLLECTOR_ZIPKIN_HTTP_PORT + value: "9411" + image: "jaegertracing/all-in-one:latest" + name: jaeger + ports: + - containerPort: 5775 + protocol: UDP + - containerPort: 6831 + protocol: UDP + - containerPort: 6832 + protocol: UDP + - containerPort: 5778 + protocol: TCP + - containerPort: 16686 + protocol: TCP + - containerPort: 14268 + protocol: TCP + - containerPort: 9411 + protocol: TCP + - containerPort: 14250 + protocol: TCP + resources: + limits: + memory: 275Mi diff --git a/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/configmap.yaml b/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/configmap.yaml index 6b39c816f..f0efef13f 100644 --- a/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/configmap.yaml +++ b/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/configmap.yaml @@ -25,8 +25,8 @@ data: batch: {} memory_limiter: check_interval: 5s - limit_mib: 409 - spike_limit_mib: 128 + limit_mib: 80 + spike_limit_mib: 25 receivers: jaeger: protocols: diff --git a/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/deployment.yaml b/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/deployment.yaml index 837b2e508..8316816f5 100644 --- a/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/deployment.yaml +++ b/charts/opentelemetry-demo/examples/default/rendered/opentelemetry-collector/deployment.yaml @@ -23,7 +23,7 @@ spec: template: metadata: annotations: - checksum/config: 59fbf04012114dd6c404237dc0e7ea8a88470269b81d65a975360203004fb1ef + checksum/config: 6e8725cdc6111ae34aa6463d7c824f607a81e5f88272e8f89864532036117c3c labels: app.kubernetes.io/name: otelcol @@ -80,7 +80,7 @@ spec: resources: limits: cpu: 256m - memory: 512Mi + memory: 100Mi volumeMounts: - mountPath: /conf name: opentelemetry-collector-configmap diff --git a/charts/opentelemetry-demo/templates/_objects.tpl b/charts/opentelemetry-demo/templates/_objects.tpl index d05c34b1e..9528345c0 100644 --- a/charts/opentelemetry-demo/templates/_objects.tpl +++ b/charts/opentelemetry-demo/templates/_objects.tpl @@ -36,6 +36,8 @@ spec: {{- end }} env: {{- include "otel-demo.pod.env" . | nindent 10 }} + resources: + {{- .resources | toYaml | nindent 12 }} {{- end }} {{- define "otel.demo.service" }} {{- if or .ports .servicePort}} diff --git a/charts/opentelemetry-demo/templates/jaeger.yaml b/charts/opentelemetry-demo/templates/jaeger.yaml index a2594a95c..a2ea6c341 100644 --- a/charts/opentelemetry-demo/templates/jaeger.yaml +++ b/charts/opentelemetry-demo/templates/jaeger.yaml @@ -18,28 +18,31 @@ spec: {{- include "otel-demo.selectorLabels" . | nindent 8 }} spec: containers: - - env: - - name: COLLECTOR_ZIPKIN_HTTP_PORT - value: "9411" - image: "{{ .Values.observability.jaeger.image.repository }}:{{ .Values.observability.jaeger.image.tag }}" - name: jaeger - ports: - - containerPort: 5775 - protocol: UDP - - containerPort: 6831 - protocol: UDP - - containerPort: 6832 - protocol: UDP - - containerPort: 5778 - protocol: TCP - - containerPort: 16686 - protocol: TCP - - containerPort: 14268 - protocol: TCP - - containerPort: 9411 - protocol: TCP - - containerPort: 14250 - protocol: TCP + - env: + - name: COLLECTOR_ZIPKIN_HTTP_PORT + value: "9411" + image: "{{ .Values.observability.jaeger.image.repository }}:{{ .Values.observability.jaeger.image.tag }}" + name: jaeger + ports: + - containerPort: 5775 + protocol: UDP + - containerPort: 6831 + protocol: UDP + - containerPort: 6832 + protocol: UDP + - containerPort: 5778 + protocol: TCP + - containerPort: 16686 + protocol: TCP + - containerPort: 14268 + protocol: TCP + - containerPort: 9411 + protocol: TCP + - containerPort: 14250 + protocol: TCP + resources: + {{- .Values.observability.jaeger.resources | toYaml | nindent 12 }} + --- apiVersion: v1 kind: Service diff --git a/charts/opentelemetry-demo/values.schema.json b/charts/opentelemetry-demo/values.schema.json index fd3483f8e..47e4d725f 100644 --- a/charts/opentelemetry-demo/values.schema.json +++ b/charts/opentelemetry-demo/values.schema.json @@ -125,6 +125,9 @@ }, "podAnnotations": { "type": "object" + }, + "resources": { + "$ref": "#/definitions/ContainerResources" } }, "required": [ @@ -300,9 +303,12 @@ }, "image": { "$ref": "#/definitions/Image" + }, + "resources": { + "$ref": "#/definitions/ContainerResources" } } - + } }, "required": [ @@ -330,6 +336,28 @@ } }, "title": "Image" + }, + "ContainerResources": { + "type": "object", + "properties": { + "limits": { + "$ref": "#/definitions/ContainerResourceDef" + }, + "requests": { + "$ref": "#/definitions/ContainerResourceDef" + } + } + }, + "ContainerResourceDef": { + "type": "object", + "properties": { + "cpu": { + "type": "string" + }, + "memory": { + "type": "string" + } + } } } } diff --git a/charts/opentelemetry-demo/values.yaml b/charts/opentelemetry-demo/values.yaml index d8f4efa42..b96b5dc2d 100644 --- a/charts/opentelemetry-demo/values.yaml +++ b/charts/opentelemetry-demo/values.yaml @@ -10,6 +10,9 @@ observability: tag: "latest" pullPolicy: IfNotPresent pullSecrets: [] + resources: + limits: + memory: 275Mi default: env: @@ -57,6 +60,9 @@ components: ports: - name: redis value: 6379 + resources: + limits: + memory: 20Mi adService: enabled: true @@ -70,8 +76,9 @@ components: - name: AD_SERVICE_PORT value: "8080" podAnnotations: {} - # sidecar.opentelemetry.io/inject: "false" - # instrumentation.opentelemetry.io/inject-java: "true" + resources: + limits: + memory: 300Mi cartService: enabled: true @@ -89,8 +96,9 @@ components: - name: CART_SERVICE_PORT value: "8080" podAnnotations: {} - # sidecar.opentelemetry.io/inject: "false" - # instrumentation.opentelemetry.io/inject-dotnet: "true" + resources: + limits: + memory: 160Mi checkoutService: enabled: true @@ -116,7 +124,9 @@ components: - name: CHECKOUT_SERVICE_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 20Mi currencyService: enabled: true @@ -132,7 +142,9 @@ components: - name: CURRENCY_SERVICE_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 20Mi emailService: enabled: true @@ -152,7 +164,9 @@ components: - name: EMAIL_SERVICE_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 100Mi featureflagService: enabled: true @@ -176,7 +190,9 @@ components: - name: http value: 8081 podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 160Mi ffsPostgres: enabled: true @@ -198,7 +214,9 @@ components: - name: postgres value: 5432 podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 120Mi frontend: enabled: true @@ -228,7 +246,9 @@ components: - name: FRONTEND_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 200Mi loadgenerator: enabled: true @@ -256,7 +276,9 @@ components: - name: LOADGENERATOR_PORT value: "8089" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-python: "true" + resources: + limits: + memory: 120Mi paymentService: enabled: true @@ -270,7 +292,9 @@ components: - name: PAYMENT_SERVICE_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-nodejs: "true" + resources: + limits: + memory: 70Mi productCatalogService: enabled: true @@ -286,7 +310,9 @@ components: - name: FEATURE_FLAG_GRPC_SERVICE_ADDR value: '{{ include "otel-demo.name" . }}-featureflag-service:50053' podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 20Mi recommendationService: enabled: true @@ -306,7 +332,9 @@ components: - name: PRODUCT_CATALOG_SERVICE_ADDR value: '{{ include "otel-demo.name" . }}-product-catalog-service:8080' podAnnotations: {} - # instrumentation.opentelemetry.io/inject-python: "true" + resources: + limits: + memory: 500Mi # This is high to enable supporting the recommendationCache feature flag use case shippingService: enabled: true @@ -326,7 +354,9 @@ components: - name: QUOTE_SERVICE_ADDR value: 'http://{{ include "otel-demo.name" . }}-quote-service:8080' podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 20Mi quoteService: enabled: true @@ -348,12 +378,17 @@ components: - name: QUOTE_SERVICE_PORT value: "8080" podAnnotations: {} - # instrumentation.opentelemetry.io/inject-sdk: "true" + resources: + limits: + memory: 30Mi opentelemetry-collector: nameOverride: otelcol mode: deployment + resources: + limits: + memory: 100Mi config: exporters: jaeger: