Merge pull request #6 from 8gears/master

add ServiceMonitor
This commit is contained in:
mergify[bot] 2020-03-14 09:05:02 +00:00 committed by GitHub
commit 88658acc41
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 43 additions and 16 deletions

View File

@ -1,7 +1,7 @@
apiVersion: v1
description: A chart for a Cadvisor deployment
name: cadvisor
version: 1.0.1
version: 1.1.0
appVersion: 0.36.0
home: https://github.com/google/cadvisor
sources:

View File

@ -42,7 +42,7 @@ The command removes all the Kubernetes components associated with the chart and
The following table lists the configurable parameters of the Prometheus MSTeams chart and their default values.
| Parameter | Description | Default |
| -------------------------------------- | ------------------------------------------------- | ----------------------------- |
| -------------------------- | ------------------------------------------------ | --------------------- |
| `image.repository` | container image repository | `k8s.gcr.io/cadvisor` |
| `image.tag` | container image tag | `v0.36.0` |
| `image.pullPolicy` | container image pull policy | `IfNotPresent` |
@ -56,6 +56,7 @@ The following table lists the configurable parameters of the Prometheus MSTeams
| `serviceAccount.create` | create a own serviceAccount for the pod | `true` |
| `serviceAccount.name` | name of the serviceAccount to create | `""` |
| `podSecurityPolicy.create` | create a own PodSecurityPolicy for the pod | `false` |
| `metrics.enabled` | create ServiceMonitor CR for Prometheus operator | `false` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,

View File

@ -0,0 +1,22 @@
{{- if .Values.metrics.enabled -}}
apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
name: {{ template "cadvisor.name" . }}
namespace: {{ .Release.Namespace }}
labels:
app: {{ template "cadvisor.name" . }}
chart: {{ template "cadvisor.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
selector:
matchLabels:
app: {{ template "cadvisor.name" . }}
namespaceSelector:
matchNames:
- {{ .Release.Namespace }}
endpoints:
- path: /metrics
port: http
{{- end -}}

View File

@ -52,3 +52,7 @@ nodeSelector: {}
tolerations: []
affinity: {}
# This will create a ServiceMonitor Custom Resource indicating the prometheus operator what to scrape.
metrics:
enabled: false