Skip to content

Commit 8a42bea

Browse files
authored
fix(application-template): prometheus metric port 명시방식 변경 (#16)
1 parent d1ad389 commit 8a42bea

File tree

12 files changed

+18
-70
lines changed

12 files changed

+18
-70
lines changed

charts/application-template/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ maintainers:
99
- name: modusign
1010
url: https://github.com/modusign
1111
name: application-template
12-
version: 1.4.1
12+
version: 1.4.2

charts/application-template/templates/scheduler/deployment.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ spec:
103103
containerPort: {{ .targetPort }}
104104
protocol: TCP
105105
{{- end }}
106-
{{- if .Values.global.observability.prometheus.enabled }}
107-
- name: metrics
108-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
109-
protocol: TCP
110-
{{- end }}
111106
{{- with .Values.scheduler.livenessProbe }}
112107
livenessProbe:
113108
httpGet:

charts/application-template/templates/scheduler/rollout.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ spec:
107107
containerPort: {{ .targetPort }}
108108
protocol: TCP
109109
{{- end }}
110-
{{- if .Values.global.observability.prometheus.enabled }}
111-
- name: metrics
112-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
113-
protocol: TCP
114-
{{- end }}
115110
{{- with .Values.scheduler.livenessProbe }}
116111
livenessProbe:
117112
httpGet:

charts/application-template/templates/scheduler/service.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ spec:
1212
port: {{ .port }}
1313
targetPort: {{ .targetPort }}
1414
protocol: TCP
15-
{{- end }}
16-
{{- if .Values.global.observability.prometheus.enabled }}
17-
{{- with .Values.global.observability.prometheus }}
18-
- name: metrics
19-
port: {{ .port }}
20-
{{- if .targetPort }}
21-
targetPort: {{ .targetPort }}
22-
{{- end }}
23-
protocol: TCP
24-
{{- end }}
2515
{{- end }}
2616
selector:
2717
{{- include "application.scheduler.selectorLabels" . | nindent 4 }}

charts/application-template/templates/server/deployment.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ spec:
103103
containerPort: {{ .targetPort }}
104104
protocol: TCP
105105
{{- end }}
106-
{{- if .Values.global.observability.prometheus.enabled }}
107-
- name: metrics
108-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
109-
protocol: TCP
110-
{{- end }}
111106
{{- with .Values.server.livenessProbe }}
112107
livenessProbe:
113108
httpGet:

charts/application-template/templates/server/rollout.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ spec:
107107
containerPort: {{ .targetPort }}
108108
protocol: TCP
109109
{{- end }}
110-
{{- if .Values.global.observability.prometheus.enabled }}
111-
- name: metrics
112-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
113-
protocol: TCP
114-
{{- end }}
115110
{{- with .Values.server.livenessProbe }}
116111
livenessProbe:
117112
httpGet:

charts/application-template/templates/server/service.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ spec:
1212
port: {{ .port }}
1313
targetPort: {{ .targetPort }}
1414
protocol: TCP
15-
{{- end }}
16-
{{- if .Values.global.observability.prometheus.enabled }}
17-
{{- with .Values.global.observability.prometheus }}
18-
- name: metrics
19-
port: {{ .port }}
20-
{{- if .targetPort }}
21-
targetPort: {{ .targetPort }}
22-
{{- end }}
23-
protocol: TCP
24-
{{- end }}
2515
{{- end }}
2616
selector:
2717
{{- include "application.server.selectorLabels" . | nindent 4 }}

charts/application-template/templates/service_monitor.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.global.observability.prometheus.enabled .Values.global.observability.prometheus.serviceMonitor.enabled }}
1+
{{- if .Values.global.observability.prometheus.serviceMonitor.enabled }}
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:
@@ -7,8 +7,8 @@ metadata:
77
{{- include "application.commonLabels" . | nindent 4 }}
88
spec:
99
endpoints:
10-
- path: {{ .Values.global.observability.prometheus.path }}
11-
port: metrics
10+
- path: {{ .Values.global.observability.prometheus.serviceMonitor.path }}
11+
port: {{ .Values.global.observability.prometheus.serviceMonitor.portName }}
1212
namespaceSelector:
1313
matchNames:
1414
- {{ .Release.Namespace }}

charts/application-template/templates/worker/deployment.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -103,11 +103,6 @@ spec:
103103
containerPort: {{ .targetPort }}
104104
protocol: TCP
105105
{{- end }}
106-
{{- if .Values.global.observability.prometheus.enabled }}
107-
- name: metrics
108-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
109-
protocol: TCP
110-
{{- end }}
111106
{{- with .Values.worker.livenessProbe }}
112107
livenessProbe:
113108
httpGet:

charts/application-template/templates/worker/rollout.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,6 @@ spec:
107107
containerPort: {{ .targetPort }}
108108
protocol: TCP
109109
{{- end }}
110-
{{- if .Values.global.observability.prometheus.enabled }}
111-
- name: metrics
112-
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
113-
protocol: TCP
114-
{{- end }}
115110
{{- with .Values.worker.livenessProbe }}
116111
livenessProbe:
117112
httpGet:

charts/application-template/templates/worker/service.yaml

-10
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,6 @@ spec:
1212
port: {{ .port }}
1313
targetPort: {{ .targetPort }}
1414
protocol: TCP
15-
{{- end }}
16-
{{- if .Values.global.observability.prometheus.enabled }}
17-
{{- with .Values.global.observability.prometheus }}
18-
- name: metrics
19-
port: {{ .port }}
20-
{{- if .targetPort }}
21-
targetPort: {{ .targetPort }}
22-
{{- end }}
23-
protocol: TCP
24-
{{- end }}
2515
{{- end }}
2616
selector:
2717
{{- include "application.worker.selectorLabels" . | nindent 4 }}

charts/application-template/values.yaml

+14-6
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,12 @@ global:
107107
enabled: false
108108
# -- set up additional service port and setup
109109
prometheus:
110-
enabled: false
111-
port: 9100
112-
# targetPort: 9100
113-
path: /metrics
114-
# -- create Prometheus Operator ServiceMonitorCR
110+
# -- create Prometheus Operator ServiceMonitor CR
115111
serviceMonitor:
116-
enabled: true
112+
enabled: false
113+
# port name of Service. e.g. server.ports[].name
114+
portName: metrics
115+
path: /metrics
117116

118117
## Server
119118
server:
@@ -235,6 +234,9 @@ server:
235234
- name: http
236235
port: 80
237236
targetPort: 3000
237+
# - name: metrics
238+
# port: 9100
239+
# targetPort: 3001
238240

239241
## Readiness and liveness probes for default backend
240242
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
@@ -476,6 +478,9 @@ worker:
476478
- name: http
477479
port: 80
478480
targetPort: 3000
481+
# - name: metrics
482+
# port: 9100
483+
# targetPort: 3001
479484

480485
## Readiness and liveness probes for default backend
481486
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
@@ -720,6 +725,9 @@ scheduler:
720725
- name: http
721726
port: 80
722727
targetPort: 3000
728+
# - name: metrics
729+
# port: 9100
730+
# targetPort: 3001
723731

724732
## Readiness and liveness probes for default backend
725733
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/

0 commit comments

Comments
 (0)