Skip to content

Commit e653dcc

Browse files
authored
feat: adding metric configuration and services for cas and controlplane (#2897)
Signed-off-by: lemonprogis <edward.briggler@gmail.com>
1 parent e93bf92 commit e653dcc

4 files changed

Lines changed: 69 additions & 1 deletion

File tree

deployment/chainloop/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ description: Chainloop is an open source software supply chain control plane, a
77

88
type: application
99
# Bump the patch (not minor, not major) version on each change in the Chart Source code
10-
version: 1.347.0
10+
version: 1.347.1
1111
# Do not update appVersion, this is handled automatically by the release process
1212
appVersion: v1.83.0
1313

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- /*
2+
Copyright Chainloop, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.cas.metrics.enabled }}
7+
apiVersion: v1
8+
kind: Service
9+
metadata:
10+
name: {{ include "chainloop.cas.fullname" . }}-metrics
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{ include "chainloop.cas.labels" . | nindent 4 }}
13+
{{- if or .Values.cas.metrics.service.annotations .Values.commonAnnotations }}
14+
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.cas.metrics.service.annotations .Values.commonAnnotations) "context" .) }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
type: ClusterIP
19+
ports:
20+
- name: metrics
21+
port: {{ .Values.cas.containerPorts.metrics }}
22+
targetPort: metrics
23+
protocol: TCP
24+
selector: {{ include "chainloop.cas.selectorLabels" . | nindent 4 }}
25+
{{- end }}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{- /*
2+
Copyright Chainloop, Inc. All Rights Reserved.
3+
SPDX-License-Identifier: APACHE-2.0
4+
*/}}
5+
6+
{{- if .Values.controlplane.metrics.enabled }}
7+
apiVersion: v1
8+
kind: Service
9+
metadata:
10+
name: {{ include "chainloop.controlplane.fullname" . }}-metrics
11+
namespace: {{ include "common.names.namespace" . | quote }}
12+
labels: {{- include "chainloop.controlplane.labels" . | nindent 4 }}
13+
{{- if or .Values.controlplane.metrics.service.annotations .Values.commonAnnotations }}
14+
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.metrics.service.annotations .Values.commonAnnotations) "context" .) }}
15+
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
16+
{{- end }}
17+
spec:
18+
type: ClusterIP
19+
ports:
20+
- name: metrics
21+
port: {{ .Values.controlplane.containerPorts.metrics }}
22+
targetPort: metrics
23+
protocol: TCP
24+
selector: {{ include "chainloop.controlplane.selectorLabels" . | nindent 4 }}
25+
{{- end }}

deployment/chainloop/values.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,6 +338,15 @@ controlplane:
338338
##
339339
sessionAffinityConfig: {}
340340

341+
## @extra controlplane.metrics Prometheus metrics configuration
342+
## @param controlplane.metrics.enabled Enable metrics service for controlplane
343+
metrics:
344+
enabled: false
345+
## @extra controlplane.metrics.service Metrics service configuration
346+
service:
347+
## @param controlplane.metrics.service.annotations Additional custom annotations for metrics service
348+
annotations: {}
349+
341350
serviceAPI:
342351
## @param controlplane.serviceAPI.type Service type
343352
type: ClusterIP
@@ -1092,6 +1101,15 @@ cas:
10921101
##
10931102
sessionAffinityConfig: {}
10941103

1104+
## @extra cas.metrics Prometheus metrics configuration
1105+
## @param cas.metrics.enabled Enable metrics service for CAS
1106+
metrics:
1107+
enabled: false
1108+
## @extra cas.metrics.service Metrics service configuration
1109+
service:
1110+
## @param cas.metrics.service.annotations Additional custom annotations for metrics service
1111+
annotations: {}
1112+
10951113
serviceAPI:
10961114
## @param cas.serviceAPI.type Service type
10971115
type: ClusterIP

0 commit comments

Comments
 (0)