From b710340b1ede5e25d0046dcdb4e83d9a05aab924 Mon Sep 17 00:00:00 2001 From: lemonprogis Date: Fri, 20 Mar 2026 10:51:27 -0500 Subject: [PATCH 1/3] chore: adding additional service specs for metric port Signed-off-by: lemonprogis --- deployment/chainloop/Chart.yaml | 2 +- .../templates/cas/service-metrics.yaml | 25 ++++++++++++++++++ .../controlplane/service-metrics.yaml | 26 +++++++++++++++++++ deployment/chainloop/values.yaml | 22 ++++++++++++++++ 4 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 deployment/chainloop/templates/cas/service-metrics.yaml create mode 100644 deployment/chainloop/templates/controlplane/service-metrics.yaml diff --git a/deployment/chainloop/Chart.yaml b/deployment/chainloop/Chart.yaml index bfcced42d..b011622c8 100644 --- a/deployment/chainloop/Chart.yaml +++ b/deployment/chainloop/Chart.yaml @@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a type: application # Bump the patch (not minor, not major) version on each change in the Chart Source code -version: 1.347.0 +version: 1.347.1 # Do not update appVersion, this is handled automatically by the release process appVersion: v1.83.0 diff --git a/deployment/chainloop/templates/cas/service-metrics.yaml b/deployment/chainloop/templates/cas/service-metrics.yaml new file mode 100644 index 000000000..71327e466 --- /dev/null +++ b/deployment/chainloop/templates/cas/service-metrics.yaml @@ -0,0 +1,25 @@ +{{- /* +Copyright Chainloop, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if .Values.cas.metrics.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "chainloop.cas.fullname" . }}-metrics + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{ include "chainloop.cas.labels" . | nindent 4 }} + {{- if or .Values.cas.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.cas.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + type: ClusterIP + ports: + - name: metrics + port: {{ .Values.cas.metrics.service.port }} + targetPort: metrics + protocol: TCP + selector: {{ include "chainloop.cas.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/deployment/chainloop/templates/controlplane/service-metrics.yaml b/deployment/chainloop/templates/controlplane/service-metrics.yaml new file mode 100644 index 000000000..053ef5e08 --- /dev/null +++ b/deployment/chainloop/templates/controlplane/service-metrics.yaml @@ -0,0 +1,26 @@ +{{- /* +Copyright Chainloop, Inc. All Rights Reserved. +SPDX-License-Identifier: APACHE-2.0 +*/}} + +{{- if .Values.controlplane.metrics.enabled }} +apiVersion: v1 +kind: Service +metadata: + name: {{ include "chainloop.controlplane.fullname" . }}-metrics + namespace: {{ include "common.names.namespace" . | quote }} + labels: {{- include "chainloop.controlplane.labels" . | nindent 4 }} + {{- if or .Values.controlplane.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} + {{- end }} +spec: + type: ClusterIP + ports: + - name: metrics + port: {{ .Values.controlplane.metrics.service.port }} + targetPort: metrics + protocol: TCP + {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.podLabels .Values.commonLabels) "context" .) | fromYaml }} + selector: {{ include "chainloop.controlplane.selectorLabels" . | nindent 4 }} +{{- end }} diff --git a/deployment/chainloop/values.yaml b/deployment/chainloop/values.yaml index 2ef89925b..bbaacfc9d 100644 --- a/deployment/chainloop/values.yaml +++ b/deployment/chainloop/values.yaml @@ -338,6 +338,17 @@ controlplane: ## sessionAffinityConfig: {} + ## @extra controlplane.metrics Prometheus metrics configuration + ## @param controlplane.metrics.enabled Enable metrics service + metrics: + enabled: false + ## @extra controlplane.metrics.service Metrics service configuration + service: + ## @param controlplane.metrics.service.port Metrics service port + port: 5000 + ## @param controlplane.metrics.service.annotations Additional custom annotations for metrics service + annotations: {} + serviceAPI: ## @param controlplane.serviceAPI.type Service type type: ClusterIP @@ -1092,6 +1103,17 @@ cas: ## sessionAffinityConfig: {} + ## @extra cas.metrics Prometheus metrics configuration + ## @param cas.metrics.enabled Enable metrics service + metrics: + enabled: false + ## @extra cas.metrics.service Metrics service configuration + service: + ## @param cas.metrics.service.port Metrics service port + port: 5000 + ## @param cas.metrics.service.annotations Additional custom annotations for metrics service + annotations: {} + serviceAPI: ## @param cas.serviceAPI.type Service type type: ClusterIP From 188d5e1e7e7cf2df81fecd00401fb6465a1baac0 Mon Sep 17 00:00:00 2001 From: lemonprogis Date: Fri, 20 Mar 2026 11:03:20 -0500 Subject: [PATCH 2/3] move to a top level. it's more of an all or nothing setting Signed-off-by: lemonprogis --- .../templates/cas/service-metrics.yaml | 8 ++--- .../controlplane/service-metrics.yaml | 8 ++--- deployment/chainloop/values.yaml | 34 +++++++------------ 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/deployment/chainloop/templates/cas/service-metrics.yaml b/deployment/chainloop/templates/cas/service-metrics.yaml index 71327e466..2bd78d06e 100644 --- a/deployment/chainloop/templates/cas/service-metrics.yaml +++ b/deployment/chainloop/templates/cas/service-metrics.yaml @@ -3,22 +3,22 @@ Copyright Chainloop, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.cas.metrics.enabled }} +{{- if .Values.metrics.enabled }} apiVersion: v1 kind: Service metadata: name: {{ include "chainloop.cas.fullname" . }}-metrics namespace: {{ include "common.names.namespace" . | quote }} labels: {{ include "chainloop.cas.labels" . | nindent 4 }} - {{- if or .Values.cas.metrics.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.cas.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} {{- end }} spec: type: ClusterIP ports: - name: metrics - port: {{ .Values.cas.metrics.service.port }} + port: {{ .Values.metrics.service.port }} targetPort: metrics protocol: TCP selector: {{ include "chainloop.cas.selectorLabels" . | nindent 4 }} diff --git a/deployment/chainloop/templates/controlplane/service-metrics.yaml b/deployment/chainloop/templates/controlplane/service-metrics.yaml index 053ef5e08..fec272bd0 100644 --- a/deployment/chainloop/templates/controlplane/service-metrics.yaml +++ b/deployment/chainloop/templates/controlplane/service-metrics.yaml @@ -3,22 +3,22 @@ Copyright Chainloop, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.controlplane.metrics.enabled }} +{{- if .Values.metrics.enabled }} apiVersion: v1 kind: Service metadata: name: {{ include "chainloop.controlplane.fullname" . }}-metrics namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "chainloop.controlplane.labels" . | nindent 4 }} - {{- if or .Values.controlplane.metrics.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} {{- end }} spec: type: ClusterIP ports: - name: metrics - port: {{ .Values.controlplane.metrics.service.port }} + port: {{ .Values.metrics.service.port }} targetPort: metrics protocol: TCP {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.podLabels .Values.commonLabels) "context" .) | fromYaml }} diff --git a/deployment/chainloop/values.yaml b/deployment/chainloop/values.yaml index bbaacfc9d..b80487e65 100644 --- a/deployment/chainloop/values.yaml +++ b/deployment/chainloop/values.yaml @@ -51,6 +51,18 @@ commonLabels: {} ## extraDeploy: [] +## @section Prometheus Metrics +## @extra metrics Prometheus metrics configuration for controlplane and CAS +## @param metrics.enabled Enable metrics services for both controlplane and CAS +metrics: + enabled: false + ## @extra metrics.service Metrics service configuration + service: + ## @param metrics.service.port Metrics service port + port: 5000 + ## @param metrics.service.annotations Additional custom annotations for metrics services + annotations: {} + ## @section Secrets Backend ## @@ -338,17 +350,6 @@ controlplane: ## sessionAffinityConfig: {} - ## @extra controlplane.metrics Prometheus metrics configuration - ## @param controlplane.metrics.enabled Enable metrics service - metrics: - enabled: false - ## @extra controlplane.metrics.service Metrics service configuration - service: - ## @param controlplane.metrics.service.port Metrics service port - port: 5000 - ## @param controlplane.metrics.service.annotations Additional custom annotations for metrics service - annotations: {} - serviceAPI: ## @param controlplane.serviceAPI.type Service type type: ClusterIP @@ -1103,17 +1104,6 @@ cas: ## sessionAffinityConfig: {} - ## @extra cas.metrics Prometheus metrics configuration - ## @param cas.metrics.enabled Enable metrics service - metrics: - enabled: false - ## @extra cas.metrics.service Metrics service configuration - service: - ## @param cas.metrics.service.port Metrics service port - port: 5000 - ## @param cas.metrics.service.annotations Additional custom annotations for metrics service - annotations: {} - serviceAPI: ## @param cas.serviceAPI.type Service type type: ClusterIP From 01daab9fb3b2b125dffee18b4e17c12c993aeecc Mon Sep 17 00:00:00 2001 From: lemonprogis Date: Fri, 20 Mar 2026 11:41:46 -0500 Subject: [PATCH 3/3] addressing comments around duplicate ports, per-comonent conventions, and dead variable reference Signed-off-by: lemonprogis --- .../templates/cas/service-metrics.yaml | 8 ++--- .../controlplane/service-metrics.yaml | 9 +++--- deployment/chainloop/values.yaml | 30 +++++++++++-------- 3 files changed, 26 insertions(+), 21 deletions(-) diff --git a/deployment/chainloop/templates/cas/service-metrics.yaml b/deployment/chainloop/templates/cas/service-metrics.yaml index 2bd78d06e..7ec97e90c 100644 --- a/deployment/chainloop/templates/cas/service-metrics.yaml +++ b/deployment/chainloop/templates/cas/service-metrics.yaml @@ -3,22 +3,22 @@ Copyright Chainloop, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.metrics.enabled }} +{{- if .Values.cas.metrics.enabled }} apiVersion: v1 kind: Service metadata: name: {{ include "chainloop.cas.fullname" . }}-metrics namespace: {{ include "common.names.namespace" . | quote }} labels: {{ include "chainloop.cas.labels" . | nindent 4 }} - {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + {{- if or .Values.cas.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.cas.metrics.service.annotations .Values.commonAnnotations) "context" .) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} {{- end }} spec: type: ClusterIP ports: - name: metrics - port: {{ .Values.metrics.service.port }} + port: {{ .Values.cas.containerPorts.metrics }} targetPort: metrics protocol: TCP selector: {{ include "chainloop.cas.selectorLabels" . | nindent 4 }} diff --git a/deployment/chainloop/templates/controlplane/service-metrics.yaml b/deployment/chainloop/templates/controlplane/service-metrics.yaml index fec272bd0..aa29f0f52 100644 --- a/deployment/chainloop/templates/controlplane/service-metrics.yaml +++ b/deployment/chainloop/templates/controlplane/service-metrics.yaml @@ -3,24 +3,23 @@ Copyright Chainloop, Inc. All Rights Reserved. SPDX-License-Identifier: APACHE-2.0 */}} -{{- if .Values.metrics.enabled }} +{{- if .Values.controlplane.metrics.enabled }} apiVersion: v1 kind: Service metadata: name: {{ include "chainloop.controlplane.fullname" . }}-metrics namespace: {{ include "common.names.namespace" . | quote }} labels: {{- include "chainloop.controlplane.labels" . | nindent 4 }} - {{- if or .Values.metrics.service.annotations .Values.commonAnnotations }} - {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }} + {{- if or .Values.controlplane.metrics.service.annotations .Values.commonAnnotations }} + {{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.metrics.service.annotations .Values.commonAnnotations) "context" .) }} annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }} {{- end }} spec: type: ClusterIP ports: - name: metrics - port: {{ .Values.metrics.service.port }} + port: {{ .Values.controlplane.containerPorts.metrics }} targetPort: metrics protocol: TCP - {{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.podLabels .Values.commonLabels) "context" .) | fromYaml }} selector: {{ include "chainloop.controlplane.selectorLabels" . | nindent 4 }} {{- end }} diff --git a/deployment/chainloop/values.yaml b/deployment/chainloop/values.yaml index b80487e65..5447b7e16 100644 --- a/deployment/chainloop/values.yaml +++ b/deployment/chainloop/values.yaml @@ -51,18 +51,6 @@ commonLabels: {} ## extraDeploy: [] -## @section Prometheus Metrics -## @extra metrics Prometheus metrics configuration for controlplane and CAS -## @param metrics.enabled Enable metrics services for both controlplane and CAS -metrics: - enabled: false - ## @extra metrics.service Metrics service configuration - service: - ## @param metrics.service.port Metrics service port - port: 5000 - ## @param metrics.service.annotations Additional custom annotations for metrics services - annotations: {} - ## @section Secrets Backend ## @@ -350,6 +338,15 @@ controlplane: ## sessionAffinityConfig: {} + ## @extra controlplane.metrics Prometheus metrics configuration + ## @param controlplane.metrics.enabled Enable metrics service for controlplane + metrics: + enabled: false + ## @extra controlplane.metrics.service Metrics service configuration + service: + ## @param controlplane.metrics.service.annotations Additional custom annotations for metrics service + annotations: {} + serviceAPI: ## @param controlplane.serviceAPI.type Service type type: ClusterIP @@ -1104,6 +1101,15 @@ cas: ## sessionAffinityConfig: {} + ## @extra cas.metrics Prometheus metrics configuration + ## @param cas.metrics.enabled Enable metrics service for CAS + metrics: + enabled: false + ## @extra cas.metrics.service Metrics service configuration + service: + ## @param cas.metrics.service.annotations Additional custom annotations for metrics service + annotations: {} + serviceAPI: ## @param cas.serviceAPI.type Service type type: ClusterIP