Skip to content

Commit 59d307a

Browse files
authored
fix(application-template): capability api 제거, 오타 수정 (#18)
* fix: typo * fix: remove capability api * fix: update chart version
1 parent d8f9e8f commit 59d307a

File tree

5 files changed

+15
-21
lines changed

5 files changed

+15
-21
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.5.0
12+
version: 1.5.1

charts/application-template/templates/scheduler/prometheus-rule.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule" }}
21
{{- if and .Values.scheduler.enabled (or .Values.scheduler.observability.prometheus.alerting_rules.enabled .Values.scheduler.observability.prometheus.istio_alerting_rules.enabled) }}
32
apiVersion: monitoring.coreos.com/v1
43
kind: PrometheusRule
@@ -78,4 +77,3 @@ spec:
7877
description: "[{{ include "application.scheduler.name" . | title }}][istio-proxy] 서비스의 최근 메모리 사용량이 {{ .Values.scheduler.observability.prometheus.istio_alerting_rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
7978
{{- end }}
8079
{{- end }}
81-
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule" }}
2-
{{- if and .Values.server.enabled (or .Values.server.observability.prometheus.rules.enabled .Values.server.observability.prometheus.istio_rules.enabled) }}
1+
{{- if and .Values.server.enabled (or .Values.server.observability.prometheus.alerting_rules.enabled .Values.server.observability.prometheus.istio_alerting_rules.enabled) }}
32
apiVersion: monitoring.coreos.com/v1
43
kind: PrometheusRule
54
metadata:
65
name: {{ template "application.server.name" . }}
76
namespace: {{ .Release.Namespace }}
87
spec:
98
groups:
10-
{{- if .Values.server.observability.prometheus.rules.enabled }}
9+
{{- if .Values.server.observability.prometheus.alerting_rules.enabled }}
1110
- name: ServiceContainerResourceUsage
12-
rules:
11+
alerting_rules:
1312
- alert: "HighServiceContainerCPUUsage"
1413
expr: |
1514
avg(
@@ -18,13 +17,13 @@ spec:
1817
(kube_pod_container_resource_limits{ resource="cpu", container={{ .Values.server.name | quote }} })
1918
)
2019
* 100
21-
> {{ .Values.server.observability.prometheus.rules.highCpuUsageThreshold }}
20+
> {{ .Values.server.observability.prometheus.alerting_rules.highCpuUsageThreshold }}
2221
for: 5m
2322
labels:
2423
severity: critical
2524
annotations:
2625
summary: "[{{ include "application.server.name" . | title }}] High CPU usage"
27-
description: "[{{ include "application.server.name" . | title }}] 서비스의 최근 CPU 사용량이 {{ .Values.server.observability.prometheus.rules.highCpuUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
26+
description: "[{{ include "application.server.name" . | title }}] 서비스의 최근 CPU 사용량이 {{ .Values.server.observability.prometheus.alerting_rules.highCpuUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
2827

2928
- alert: HighServiceContainerMemoryUsage
3029
expr: |
@@ -33,18 +32,18 @@ spec:
3332
/ on(pod)
3433
(kube_pod_container_resource_limits{ resource="memory", container={{ .Values.server.name | quote }} })
3534
) * 100
36-
> {{ .Values.server.observability.prometheus.rules.highMemoryUsageThreshold }}
35+
> {{ .Values.server.observability.prometheus.alerting_rules.highMemoryUsageThreshold }}
3736
for: 5m
3837
labels:
3938
service: {{ include "application.server.name" . | quote }}
4039
severity: critical
4140
annotations:
4241
summary: "[{{ include "application.server.name" . | title }}] High memory usage"
43-
description: "[{{ include "application.server.name" . | title }}] 서비스의 최근 메모리 사용량이 {{ .Values.server.observability.prometheus.rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
42+
description: "[{{ include "application.server.name" . | title }}] 서비스의 최근 메모리 사용량이 {{ .Values.server.observability.prometheus.alerting_rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
4443
{{- end }}
45-
{{- if .Values.server.observability.prometheus.istio_rules.enabled }}
44+
{{- if .Values.server.observability.prometheus.istio_alerting_rules.enabled }}
4645
- name: IstioContainerResourceUsage
47-
rules:
46+
alerting_rules:
4847
- alert: "HighIstioContainerCPUUsage"
4948
expr: |
5049
avg(
@@ -53,13 +52,13 @@ spec:
5352
(kube_pod_container_resource_limits{ resource="cpu", container="istio-proxy" })
5453
)
5554
* 100
56-
> {{ .Values.server.observability.prometheus.istio_rules.highCpuUsageThreshold }}
55+
> {{ .Values.server.observability.prometheus.istio_alerting_rules.highCpuUsageThreshold }}
5756
for: 5m
5857
labels:
5958
severity: critical
6059
annotations:
6160
summary: "[{{ include "application.server.name" . | title }}][istio-proxy] High CPU usage"
62-
description: "[{{ include "application.server.name" . | title }}][istio-proxy] 서비스의 최근 CPU 사용량이 {{ .Values.server.observability.prometheus.istio_rules.highCpuUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
61+
description: "[{{ include "application.server.name" . | title }}][istio-proxy] 서비스의 최근 CPU 사용량이 {{ .Values.server.observability.prometheus.istio_alerting_rules.highCpuUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
6362

6463
- alert: HighIstioContainerMemoryUsage
6564
expr: |
@@ -68,14 +67,13 @@ spec:
6867
/ on(pod)
6968
(kube_pod_container_resource_limits{ resource="memory", container="istio-proxy" })
7069
) * 100
71-
> {{ .Values.server.observability.prometheus.istio_rules.highMemoryUsageThreshold }}
70+
> {{ .Values.server.observability.prometheus.istio_alerting_rules.highMemoryUsageThreshold }}
7271
for: 5m
7372
labels:
7473
service: {{ include "application.server.name" . | quote }}
7574
severity: critical
7675
annotations:
7776
summary: "[{{ include "application.server.name" . | title }}][istio-proxy] High memory usage"
78-
description: "[{{ include "application.server.name" . | title }}][istio-proxy] 서비스의 최근 메모리 사용량이 {{ .Values.server.observability.prometheus.istio_rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
77+
description: "[{{ include "application.server.name" . | title }}][istio-proxy] 서비스의 최근 메모리 사용량이 {{ .Values.server.observability.prometheus.istio_alerting_rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
7978
{{- end }}
8079
{{- end }}
81-
{{- end }}

charts/application-template/templates/service_monitor.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if and .Values.global.observability.prometheus.serviceMonitor.enabled (.Capabilities.APIVersions.Has "monitoring.coreos.com/v1/ServiceMonitor") }}
1+
{{- if .Values.global.observability.prometheus.serviceMonitor.enabled }}
22
apiVersion: monitoring.coreos.com/v1
33
kind: ServiceMonitor
44
metadata:

charts/application-template/templates/worker/prometheus-rule.yaml

-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
{{- if .Capabilities.APIVersions.Has "monitoring.coreos.com/v1/PrometheusRule" }}
21
{{- if and .Values.worker.enabled (or .Values.worker.observability.prometheus.alerting_rules.enabled .Values.worker.observability.prometheus.istio_alerting_rules.enabled) }}
32
apiVersion: monitoring.coreos.com/v1
43
kind: PrometheusRule
@@ -78,4 +77,3 @@ spec:
7877
description: "[{{ include "application.worker.name" . | title }}][istio-proxy] 서비스의 최근 메모리 사용량이 {{ .Values.worker.observability.prometheus.istio_alerting_rules.highMemoryUsageThreshold }}% 이상이 되었습니다. 현재값: {{`{{ .Value | humanize }}`}}%"
7978
{{- end }}
8079
{{- end }}
81-
{{- end }}

0 commit comments

Comments
 (0)