Skip to content

Commit 01daab9

Browse files
committed
addressing comments around duplicate ports, per-comonent conventions, and dead variable reference
Signed-off-by: lemonprogis <edward.briggler@gmail.com>
1 parent 188d5e1 commit 01daab9

3 files changed

Lines changed: 26 additions & 21 deletions

File tree

deployment/chainloop/templates/cas/service-metrics.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,22 +3,22 @@ Copyright Chainloop, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- if .Values.metrics.enabled }}
6+
{{- if .Values.cas.metrics.enabled }}
77
apiVersion: v1
88
kind: Service
99
metadata:
1010
name: {{ include "chainloop.cas.fullname" . }}-metrics
1111
namespace: {{ include "common.names.namespace" . | quote }}
1212
labels: {{ include "chainloop.cas.labels" . | nindent 4 }}
13-
{{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
14-
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }}
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" .) }}
1515
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
1616
{{- end }}
1717
spec:
1818
type: ClusterIP
1919
ports:
2020
- name: metrics
21-
port: {{ .Values.metrics.service.port }}
21+
port: {{ .Values.cas.containerPorts.metrics }}
2222
targetPort: metrics
2323
protocol: TCP
2424
selector: {{ include "chainloop.cas.selectorLabels" . | nindent 4 }}

deployment/chainloop/templates/controlplane/service-metrics.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,23 @@ Copyright Chainloop, Inc. All Rights Reserved.
33
SPDX-License-Identifier: APACHE-2.0
44
*/}}
55

6-
{{- if .Values.metrics.enabled }}
6+
{{- if .Values.controlplane.metrics.enabled }}
77
apiVersion: v1
88
kind: Service
99
metadata:
1010
name: {{ include "chainloop.controlplane.fullname" . }}-metrics
1111
namespace: {{ include "common.names.namespace" . | quote }}
1212
labels: {{- include "chainloop.controlplane.labels" . | nindent 4 }}
13-
{{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
14-
{{- $annotations := include "common.tplvalues.merge" (dict "values" (list .Values.metrics.service.annotations .Values.commonAnnotations) "context" .) }}
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" .) }}
1515
annotations: {{- include "common.tplvalues.render" ( dict "value" $annotations "context" $ ) | nindent 4 }}
1616
{{- end }}
1717
spec:
1818
type: ClusterIP
1919
ports:
2020
- name: metrics
21-
port: {{ .Values.metrics.service.port }}
21+
port: {{ .Values.controlplane.containerPorts.metrics }}
2222
targetPort: metrics
2323
protocol: TCP
24-
{{- $podLabels := include "common.tplvalues.merge" (dict "values" (list .Values.controlplane.podLabels .Values.commonLabels) "context" .) | fromYaml }}
2524
selector: {{ include "chainloop.controlplane.selectorLabels" . | nindent 4 }}
2625
{{- end }}

deployment/chainloop/values.yaml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,6 @@ commonLabels: {}
5151
##
5252
extraDeploy: []
5353

54-
## @section Prometheus Metrics
55-
## @extra metrics Prometheus metrics configuration for controlplane and CAS
56-
## @param metrics.enabled Enable metrics services for both controlplane and CAS
57-
metrics:
58-
enabled: false
59-
## @extra metrics.service Metrics service configuration
60-
service:
61-
## @param metrics.service.port Metrics service port
62-
port: 5000
63-
## @param metrics.service.annotations Additional custom annotations for metrics services
64-
annotations: {}
65-
6654
## @section Secrets Backend
6755
##
6856

@@ -350,6 +338,15 @@ controlplane:
350338
##
351339
sessionAffinityConfig: {}
352340

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+
353350
serviceAPI:
354351
## @param controlplane.serviceAPI.type Service type
355352
type: ClusterIP
@@ -1104,6 +1101,15 @@ cas:
11041101
##
11051102
sessionAffinityConfig: {}
11061103

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+
11071113
serviceAPI:
11081114
## @param cas.serviceAPI.type Service type
11091115
type: ClusterIP

0 commit comments

Comments
 (0)