Skip to content

Commit

Permalink
fix(application-template): prometheus metric port 명시방식 변경 (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
atobaum authored Feb 1, 2024
1 parent d1ad389 commit 8a42bea
Show file tree
Hide file tree
Showing 12 changed files with 18 additions and 70 deletions.
2 changes: 1 addition & 1 deletion charts/application-template/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ maintainers:
- name: modusign
url: https://github.com/modusign
name: application-template
version: 1.4.1
version: 1.4.2
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.scheduler.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
5 changes: 0 additions & 5 deletions charts/application-template/templates/scheduler/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.scheduler.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
10 changes: 0 additions & 10 deletions charts/application-template/templates/scheduler/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ spec:
port: {{ .port }}
targetPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
{{- with .Values.global.observability.prometheus }}
- name: metrics
port: {{ .port }}
{{- if .targetPort }}
targetPort: {{ .targetPort }}
{{- end }}
protocol: TCP
{{- end }}
{{- end }}
selector:
{{- include "application.scheduler.selectorLabels" . | nindent 4 }}
Expand Down
5 changes: 0 additions & 5 deletions charts/application-template/templates/server/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.server.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
5 changes: 0 additions & 5 deletions charts/application-template/templates/server/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.server.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
10 changes: 0 additions & 10 deletions charts/application-template/templates/server/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ spec:
port: {{ .port }}
targetPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
{{- with .Values.global.observability.prometheus }}
- name: metrics
port: {{ .port }}
{{- if .targetPort }}
targetPort: {{ .targetPort }}
{{- end }}
protocol: TCP
{{- end }}
{{- end }}
selector:
{{- include "application.server.selectorLabels" . | nindent 4 }}
Expand Down
6 changes: 3 additions & 3 deletions charts/application-template/templates/service_monitor.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{- if and .Values.global.observability.prometheus.enabled .Values.global.observability.prometheus.serviceMonitor.enabled }}
{{- if .Values.global.observability.prometheus.serviceMonitor.enabled }}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
Expand All @@ -7,8 +7,8 @@ metadata:
{{- include "application.commonLabels" . | nindent 4 }}
spec:
endpoints:
- path: {{ .Values.global.observability.prometheus.path }}
port: metrics
- path: {{ .Values.global.observability.prometheus.serviceMonitor.path }}
port: {{ .Values.global.observability.prometheus.serviceMonitor.portName }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
Expand Down
5 changes: 0 additions & 5 deletions charts/application-template/templates/worker/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.worker.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
5 changes: 0 additions & 5 deletions charts/application-template/templates/worker/rollout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,11 +107,6 @@ spec:
containerPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
- name: metrics
containerPort: {{ default .Values.global.observability.prometheus.port .Values.global.observability.prometheus.targetPort }}
protocol: TCP
{{- end }}
{{- with .Values.worker.livenessProbe }}
livenessProbe:
httpGet:
Expand Down
10 changes: 0 additions & 10 deletions charts/application-template/templates/worker/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,6 @@ spec:
port: {{ .port }}
targetPort: {{ .targetPort }}
protocol: TCP
{{- end }}
{{- if .Values.global.observability.prometheus.enabled }}
{{- with .Values.global.observability.prometheus }}
- name: metrics
port: {{ .port }}
{{- if .targetPort }}
targetPort: {{ .targetPort }}
{{- end }}
protocol: TCP
{{- end }}
{{- end }}
selector:
{{- include "application.worker.selectorLabels" . | nindent 4 }}
Expand Down
20 changes: 14 additions & 6 deletions charts/application-template/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,12 @@ global:
enabled: false
# -- set up additional service port and setup
prometheus:
enabled: false
port: 9100
# targetPort: 9100
path: /metrics
# -- create Prometheus Operator ServiceMonitorCR
# -- create Prometheus Operator ServiceMonitor CR
serviceMonitor:
enabled: true
enabled: false
# port name of Service. e.g. server.ports[].name
portName: metrics
path: /metrics

## Server
server:
Expand Down Expand Up @@ -235,6 +234,9 @@ server:
- name: http
port: 80
targetPort: 3000
# - name: metrics
# port: 9100
# targetPort: 3001

## Readiness and liveness probes for default backend
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
Expand Down Expand Up @@ -476,6 +478,9 @@ worker:
- name: http
port: 80
targetPort: 3000
# - name: metrics
# port: 9100
# targetPort: 3001

## Readiness and liveness probes for default backend
## Ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/
Expand Down Expand Up @@ -720,6 +725,9 @@ scheduler:
- name: http
port: 80
targetPort: 3000
# - name: metrics
# port: 9100
# targetPort: 3001

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

0 comments on commit 8a42bea

Please sign in to comment.