From c6ebae099602157954d830bb284ae709f814c09a Mon Sep 17 00:00:00 2001 From: Sebastian Choren Date: Tue, 27 Aug 2024 18:12:58 -0300 Subject: [PATCH] feat: allow overriding resources and replicas for all core containers (#16) --- charts/tracetest-core/templates/deployment.yaml | 4 ++-- charts/tracetest-core/values.yaml | 16 +++++++++++++++- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/charts/tracetest-core/templates/deployment.yaml b/charts/tracetest-core/templates/deployment.yaml index 3231404..1ee8e43 100644 --- a/charts/tracetest-core/templates/deployment.yaml +++ b/charts/tracetest-core/templates/deployment.yaml @@ -7,7 +7,7 @@ metadata: {{- include "tracetest-core.labels" $ | nindent 4 }} tracetest/component: {{ .name }} spec: - replicas: {{ .replicaCount }} + replicas: {{ .replicaCount | default $.Values.deploymentReplicas | default 1 }} selector: matchLabels: {{- include "tracetest-core.selectorLabels" $ | nindent 6 }} @@ -115,7 +115,7 @@ spec: path: / port: http resources: - {{- toYaml .resources | nindent 12 }} + {{- toYaml (default $.Values.deploymentResources .resources) | nindent 12 }} volumeMounts: - name: config mountPath: /app/config diff --git a/charts/tracetest-core/values.yaml b/charts/tracetest-core/values.yaml index 8796cfb..25216ea 100644 --- a/charts/tracetest-core/values.yaml +++ b/charts/tracetest-core/values.yaml @@ -2,7 +2,6 @@ global: licenseKey: "" imagePullSecret: "" tracetestImageRegistry: "" - replicasPerService: 1 tracetestCore: service: @@ -35,33 +34,48 @@ server: image: repository: kubeshop/tracetest-core +# this value applies to all deployments, unless a deployment overrides it +deploymentReplicas: 1 +deploymentResources: {} deployments: - name: api + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: true TRACETEST_SERVER_WORKFLOW_ENABLED: false - name: worker-trigger + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: false TRACETEST_SERVER_WORKFLOW_ENABLED: true TRACETEST_SERVER_WORKFLOW_STEPS: trigger_resolver trigger_result - name: worker-poller + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: false TRACETEST_SERVER_WORKFLOW_ENABLED: true TRACETEST_SERVER_WORKFLOW_STEPS: poll_start poll_evaluate - name: worker-results + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: false TRACETEST_SERVER_WORKFLOW_ENABLED: true TRACETEST_SERVER_WORKFLOW_STEPS: linter_runner assertion_runner - name: worker-monitors + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: false TRACETEST_SERVER_WORKFLOW_ENABLED: true TRACETEST_SERVER_WORKFLOW_STEPS: monitor_runner monitor_alerts - name: worker-suites + # uncomment if you want this service to override the global deploymentReplicas + # replicaCount: 1 env: TRACETEST_SERVER_API_ENABLED: false TRACETEST_SERVER_WORKFLOW_ENABLED: true