diff --git a/deploy/k8s/charts/scope-api/Chart.yaml b/deploy/k8s/charts/scope-api/Chart.yaml index 715a312..0c8a186 100644 --- a/deploy/k8s/charts/scope-api/Chart.yaml +++ b/deploy/k8s/charts/scope-api/Chart.yaml @@ -17,7 +17,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.0.0 +version: 1.0.1 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deploy/k8s/charts/scope-api/templates/_helpers.tpl b/deploy/k8s/charts/scope-api/templates/_helpers.tpl index 040f968..0d17a9d 100644 --- a/deploy/k8s/charts/scope-api/templates/_helpers.tpl +++ b/deploy/k8s/charts/scope-api/templates/_helpers.tpl @@ -176,11 +176,14 @@ Precedence: {{/* Resolve the internal OTLP endpoint used by the API. +Uses global.otelCollectorName when set (must match the collector Service name, +i.e. otelCollector.fullnameOverride in the umbrella chart), else -otel-collector. */}} {{- define "scope-api.otelEndpoint" -}} {{- $global := get .Values "global" | default dict -}} {{- $baseName := get $global "baseName" | default "scope" -}} -{{- printf "http://%s-otel-collector:4318" $baseName -}} +{{- $collectorName := get $global "otelCollectorName" | default (printf "%s-otel-collector" $baseName) -}} +{{- printf "http://%s:4318" $collectorName -}} {{- end -}} {{/* diff --git a/deploy/k8s/charts/scope-ui/Chart.yaml b/deploy/k8s/charts/scope-ui/Chart.yaml index d494c07..284a75a 100644 --- a/deploy/k8s/charts/scope-ui/Chart.yaml +++ b/deploy/k8s/charts/scope-ui/Chart.yaml @@ -18,7 +18,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: "1.0.0" +version: "1.0.1" # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/deploy/k8s/charts/scope/Chart.yaml b/deploy/k8s/charts/scope/Chart.yaml index 2026d4c..2984c84 100644 --- a/deploy/k8s/charts/scope/Chart.yaml +++ b/deploy/k8s/charts/scope/Chart.yaml @@ -5,17 +5,17 @@ maintainers: - name: Outshift Open email: oss-github@cisco.com type: application -version: 1.0.0 +version: 1.0.1 appVersion: "1.0.0" dependencies: - name: ioc-scope-api alias: api - version: 1.0.0 + version: 1.0.1 repository: oci://ghcr.io/ioc-project/charts condition: api.enabled - name: ioc-scope-ui alias: ui - version: 1.0.0 + version: 1.0.1 repository: oci://ghcr.io/ioc-project/charts condition: ui.enabled - name: opentelemetry-collector diff --git a/deploy/k8s/charts/scope/templates/_helpers.tpl b/deploy/k8s/charts/scope/templates/_helpers.tpl index 559431e..1e83a53 100644 --- a/deploy/k8s/charts/scope/templates/_helpers.tpl +++ b/deploy/k8s/charts/scope/templates/_helpers.tpl @@ -108,8 +108,18 @@ branch workers (cognitive-failure, cognition-protocols) that are deployed, so th {{- join "," (uniq $queues) -}} {{- end }} +{{- /* +Name of the OpenTelemetry collector Service/Deployment. Follows +otelCollector.fullnameOverride (the name the subchart really uses) so the +endpoint and ConfigMap names stay consistent with it. +*/ -}} {{- define "scope.otelCollectorName" -}} -{{- printf "%s-otel-collector" (include "scope.fullname" .) -}} +{{- default (printf "%s-otel-collector" (include "scope.fullname" .)) .Values.otelCollector.fullnameOverride -}} +{{- end }} + +{{- define "scope.otelCollectorConfigMapName" -}} +{{- $cm := .Values.otelCollector.configMap | default dict -}} +{{- default (printf "%s-config" (include "scope.otelCollectorName" .)) $cm.existingName -}} {{- end }} {{- define "scope.apiBaseUrl" -}} diff --git a/deploy/k8s/charts/scope/templates/otel-collector-configmap.yaml b/deploy/k8s/charts/scope/templates/otel-collector-configmap.yaml index 53fbd4f..cbe334f 100644 --- a/deploy/k8s/charts/scope/templates/otel-collector-configmap.yaml +++ b/deploy/k8s/charts/scope/templates/otel-collector-configmap.yaml @@ -2,7 +2,7 @@ apiVersion: v1 kind: ConfigMap metadata: - name: {{ include "scope.otelCollectorName" . }}-config + name: {{ include "scope.otelCollectorConfigMapName" . }} labels: {{- include "scope.labels" . | nindent 4 }} data: diff --git a/deploy/k8s/charts/scope/templates/worker-mce.yaml b/deploy/k8s/charts/scope/templates/worker-mce.yaml index 8c254a1..d23f6b0 100644 --- a/deploy/k8s/charts/scope/templates/worker-mce.yaml +++ b/deploy/k8s/charts/scope/templates/worker-mce.yaml @@ -105,6 +105,6 @@ spec: {{- end }} {{- with $worker.volumes }} volumes: - {{- toYaml . | nindent 8 }} + {{- tpl (toYaml .) $ | nindent 8 }} {{- end }} {{- end }} diff --git a/deploy/k8s/charts/scope/values.yaml b/deploy/k8s/charts/scope/values.yaml index 4d687e4..db60bf8 100644 --- a/deploy/k8s/charts/scope/values.yaml +++ b/deploy/k8s/charts/scope/values.yaml @@ -12,6 +12,9 @@ global: # Base resource name used for shared internal services such as scope-api, # scope-clickhouse, scope-rabbitmq, scope-neo4j, and scope-otel-collector. baseName: "scope" + # Name of the OpenTelemetry collector Service, used by scope-api to build the + # OTLP endpoint. Must equal otelCollector.fullnameOverride below. + otelCollectorName: scope-otel-collector # Optional shared external dependency endpoints. # Set these once to avoid duplicating host/port across component sections. # Component-level values still override when explicitly set. @@ -253,6 +256,9 @@ neo4j: otelCollector: enabled: true + # NOTE: fullnameOverride and configMap.existingName are read by the umbrella + # templates (OTLP endpoint, ConfigMap name). When renaming (e.g. a custom + # global.baseName), change both together. fullnameOverride: scope-otel-collector # When disabled, this chart does not inject OTEL_EXPORTER_OTLP_ENDPOINT. # Use an external mechanism if telemetry export is still required. @@ -591,7 +597,9 @@ workers: volumes: - name: mce-config configMap: - name: scope-mce-config + # Templated (tpl): must match the ConfigMap created by this chart, + # which follows global.baseName. + name: '{{ include "scope.mceConfigMapName" . }}' resources: requests: memory: 384Mi