diff --git a/stable/prometheus-operator/Chart.yaml b/stable/prometheus-operator/Chart.yaml index be664f8f8b..b1ff65dc7c 100644 --- a/stable/prometheus-operator/Chart.yaml +++ b/stable/prometheus-operator/Chart.yaml @@ -9,7 +9,7 @@ name: prometheus-operator sources: - https://github.com/coreos/prometheus-operator - https://coreos.com/operators/prometheus -version: 2.2.5 +version: 2.2.6 appVersion: 0.26.0 home: https://github.com/coreos/prometheus-operator keywords: diff --git a/stable/prometheus-operator/README.md b/stable/prometheus-operator/README.md index 1f8bd0ee6f..f815825a5b 100644 --- a/stable/prometheus-operator/README.md +++ b/stable/prometheus-operator/README.md @@ -254,6 +254,7 @@ The following tables lists the configurable parameters of the prometheus-operato | Parameter | Description | Default | | ----- | ----------- | ------ | | `kubeApiServer.enabled` | Deploy `serviceMonitor` to scrape the Kubernetes API server | `true` | +| `kubeApiServer.relabelings` | Relablings for the API Server ServiceMonitor | `[]` | | `kubeApiServer.tlsConfig.serverName` | Name of the server to use when validating TLS certificate | `kubernetes` | | `kubeApiServer.tlsConfig.insecureSkipVerify` | Skip TLS certificate validation when scraping | `false` | | `kubeApiServer.serviceMonitor.jobLabel` | The name of the label on the target service to use as the job name in prometheus | `component` | diff --git a/stable/prometheus-operator/templates/exporters/kube-api-server/servicemonitor.yaml b/stable/prometheus-operator/templates/exporters/kube-api-server/servicemonitor.yaml index a0bf69657a..60d600cda8 100644 --- a/stable/prometheus-operator/templates/exporters/kube-api-server/servicemonitor.yaml +++ b/stable/prometheus-operator/templates/exporters/kube-api-server/servicemonitor.yaml @@ -12,6 +12,10 @@ spec: interval: 30s port: https scheme: https +{{- if .Values.kubeApiServer.relabelings }} + relabelings: +{{ toYaml .Values.kubeApiServer.relabelings | indent 6 }} +{{- end }} tlsConfig: caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt serverName: {{ .Values.kubeApiServer.tlsConfig.serverName }} diff --git a/stable/prometheus-operator/values.yaml b/stable/prometheus-operator/values.yaml index 0d0729bb84..f3666abbdd 100644 --- a/stable/prometheus-operator/values.yaml +++ b/stable/prometheus-operator/values.yaml @@ -364,6 +364,18 @@ kubeApiServer: serverName: kubernetes insecureSkipVerify: false + ## If your API endpoint address is not reachable (as in AKS) you can replace it with the kubernetes service + ## + relabelings: [] + # - sourceLabels: + # - __meta_kubernetes_namespace + # - __meta_kubernetes_service_name + # - __meta_kubernetes_endpoint_port_name + # action: keep + # regex: default;kubernetes;https + # - targetLabel: __address__ + # replacement: kubernetes.default.svc:443 + serviceMonitor: jobLabel: component selector: