-
Notifications
You must be signed in to change notification settings - Fork 831
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prometheus metrics: Use ServiceMonitor instead of deprecated annotati…
…on mechanism (#2290) * Prometheus metrics: Allow to use ServiceMonitor * 2262 fix review notes * 2262 rename service2 to serviceInternal * Fix review notes * Remove unnecessary header * Fix review notes Co-authored-by: Robert Bailey <robertbailey@google.com>
- Loading branch information
1 parent
deb5764
commit 80e202d
Showing
13 changed files
with
269 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# disabled all not necessary chart | ||
defaultRules: | ||
enabled: false | ||
alertmanager: | ||
enabled: false | ||
kubeApiServer: | ||
enabled: false | ||
kubelet: | ||
enabled: false | ||
kubeControllerManager: | ||
enabled: false | ||
coreDns: | ||
enabled: false | ||
kubeDns: | ||
enabled: false | ||
kubeEtcd: | ||
enabled: false | ||
kubeScheduler: | ||
enabled: false | ||
kubeProxy: | ||
enabled: false | ||
kubeStateMetrics: | ||
enabled: false | ||
nodeExporter: | ||
enabled: false | ||
|
||
prometheusOperator: | ||
enabled: true | ||
prometheus: | ||
enabled: true | ||
prometheusSpec: | ||
# allow discovery of third party service monitor | ||
serviceMonitorSelectorNilUsesHelmValues: false | ||
grafana: | ||
enabled: true | ||
adminUser: admin | ||
adminPassword: admin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{{- if and (.Values.agones.metrics.prometheusEnabled) (.Values.agones.metrics.serviceMonitor.enabled) }} | ||
# Copyright 2018 Google LLC All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
apiVersion: monitoring.coreos.com/v1 | ||
kind: ServiceMonitor | ||
metadata: | ||
name: agones-controller-monitor | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
agones.dev/role: controller | ||
app: {{ template "agones.name" . }} | ||
chart: {{ template "agones.chart" . }} | ||
release: {{ .Release.Name }} | ||
heritage: {{ .Release.Service }} | ||
spec: | ||
selector: | ||
matchLabels: | ||
agones.dev/role: controller | ||
endpoints: | ||
- port: web | ||
path: /metrics | ||
interval: {{ .Values.agones.metrics.serviceMonitor.interval }} | ||
relabelings: | ||
- sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_scrape] | ||
action: keep | ||
regex: "true" | ||
- sourceLabels: [__meta_kubernetes_pod_annotation_prometheus_io_path] | ||
action: replace | ||
targetLabel: __metrics_path__ | ||
regex: (.+) | ||
- sourceLabels: [__address__, __meta_kubernetes_pod_annotation_prometheus_io_port] | ||
action: replace | ||
regex: ([^:]+)(?::\d+)?;(\d+) | ||
replacement: $1:$2 | ||
targetLabel: __address__ | ||
- action: labelmap | ||
regex: __meta_kubernetes_pod_label_(.+) | ||
- sourceLabels: [__meta_kubernetes_namespace] | ||
action: replace | ||
targetLabel: kubernetes_namespace | ||
- sourceLabels: [__meta_kubernetes_pod_name] | ||
action: replace | ||
targetLabel: kubernetes_pod_name | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.