Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

Commit

Permalink
[stable/prometheus-operator] Resolve scraping controller-manager and …
Browse files Browse the repository at this point in the history
…scheduler outside out the cluster (#10366)

* [stable/prometheus-operator] Resolve scraping controller-manager and scheduler outside out the cluster

Signed-off-by: Sébastien Prud'homme <sebastien.prudhomme@gmail.com>

* [stable/prometheus-operator] Bump version

Signed-off-by: Sébastien Prud'homme <sebastien.prudhomme@gmail.com>
  • Loading branch information
sebastien-prudhomme authored and k8s-ci-robot committed Jan 8, 2019
1 parent 692daad commit 7be0b80
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/prometheus-operator/Chart.yaml
Expand Up @@ -9,7 +9,7 @@ name: prometheus-operator
sources:
- https://github.com/coreos/prometheus-operator
- https://coreos.com/operators/prometheus
version: 1.5.1
version: 1.5.2
appVersion: 0.26.0
home: https://github.com/coreos/prometheus-operator
keywords:
Expand Down
6 changes: 6 additions & 0 deletions stable/prometheus-operator/README.md
Expand Up @@ -238,6 +238,7 @@ The following tables lists the configurable parameters of the prometheus-operato
| `kubelet.namespace` | Namespace where the kubelet is deployed. See also `prometheusOperator.kubeletService.namespace` | `kube-system` |
| `kubelet.serviceMonitor.https` | Enable scraping of the kubelet over HTTPS. For more information, see https://github.com/coreos/prometheus-operator/issues/926 | `false` |
| `kubeControllerManager.enabled` | Deploy a `service` and `serviceMonitor` to scrape the Kubernetes controller-manager | `true` |
| `kubeControllerManager.endpoints` | Endpoints where Controller-manager runs. Provide this if running Controller-manager outside the cluster | `[]` |
| `kubeControllermanager.service.port` | Controller-manager port for the service runs on | `10252` |
| `kubeControllermanager.service.targetPort` | Controller-manager targetPort for the service runs on | `10252` |
| `kubeControllermanager.service.targetPort.selector` | Controller-manager service selector | `{"k8s-app" : "kube-controller-manager" }`
Expand All @@ -258,6 +259,11 @@ The following tables lists the configurable parameters of the prometheus-operato
| `kubeEtcd.servicemonitor.caFile` | Certificate authority file to use when connecting to etcd. See `prometheus.prometheusSpec.secrets` | `""` |
| `kubeEtcd.servicemonitor.certFile` | Client certificate file to use when connecting to etcd. See `prometheus.prometheusSpec.secrets` | `""` |
| `kubeEtcd.servicemonitor.keyFile` | Client key file to use when connecting to etcd. See `prometheus.prometheusSpec.secrets` | `""` |
| `kubeScheduler.enabled` | Deploy a `service` and `serviceMonitor` to scrape the Kubernetes scheduler | `true` |
| `kubeScheduler.endpoints` | Endpoints where scheduler runs. Provide this if running scheduler outside the cluster | `[]` |
| `kubeScheduler.service.port` | Scheduler port for the service runs on | `10251` |
| `kubeScheduler.service.targetPort` | Scheduler targetPort for the service runs on | `10251` |
| `kubeScheduler.service.targetPort.selector` | Scheduler service selector | `{"k8s-app" : "kube-scheduler" }`
| `kubeStateMetrics.enabled` | Deploy the `kube-state-metrics` chart and configure a servicemonitor to scrape | `true` |
| `kube-state-metrics.rbac.create` | Create RBAC components in kube-state-metrics. See `global.rbac.create` | `true` |
| `nodeExporter.enabled` | Deploy the `prometheus-node-exporter` and scrape it | `true` |
Expand Down
20 changes: 20 additions & 0 deletions stable/prometheus-operator/ci/test-values.yaml
Expand Up @@ -342,6 +342,16 @@ kubelet:
##
kubeControllerManager:
enabled: true

## If your kube controller manager is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24

## If using kubeControllerManager.endpoints only the port and targetPort are used
##
service:
port: 10252
targetPort: 10252
Expand Down Expand Up @@ -408,6 +418,16 @@ kubeEtcd:
##
kubeScheduler:
enabled: true

## If your kube scheduler is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24

## If using kubeScheduler.endpoints only the port and targetPort are used
##
service:
port: 10251
targetPort: 10251
Expand Down
@@ -0,0 +1,20 @@
{{- if and .Values.kubeControllerManager.enabled .Values.kubeControllerManager.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
name: {{ template "prometheus-operator.fullname" . }}-kube-controller-manager
labels:
app: {{ template "prometheus-operator.name" . }}-kube-controller-manager
k8s-app: kube-controller-manager
{{ include "prometheus-operator.labels" . | indent 4 }}
namespace: kube-system
subsets:
- addresses:
{{- range .Values.kubeControllerManager.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: http-metrics
port: {{ .Values.kubeControllerManager.service.port }}
protocol: TCP
{{- end }}
Expand Up @@ -14,7 +14,10 @@ spec:
- name: http-metrics
port: {{ .Values.kubeControllerManager.service.port }}
protocol: TCP
targetPort: {{ .Values.kubeControllerManager.service.targetPort }}
{{- if .Values.kubeControllerManager.endpoints }}{{- else }}
selector:
{{ include "prometheus-operator.rangeskipempty" .Values.kubeControllerManager.service.selector | indent 4 }}
{{- end }}
type: ClusterIP
{{- end }}
@@ -0,0 +1,20 @@
{{- if and .Values.kubeScheduler.enabled .Values.kubeScheduler.endpoints }}
apiVersion: v1
kind: Endpoints
metadata:
name: {{ template "prometheus-operator.fullname" . }}-kube-scheduler
labels:
app: {{ template "prometheus-operator.name" . }}-kube-scheduler
k8s-app: kube-scheduler
{{ include "prometheus-operator.labels" . | indent 4 }}
namespace: kube-system
subsets:
- addresses:
{{- range .Values.kubeScheduler.endpoints }}
- ip: {{ . }}
{{- end }}
ports:
- name: http-metrics
port: {{ .Values.kubeScheduler.service.port }}
protocol: TCP
{{- end }}
Expand Up @@ -15,7 +15,9 @@ spec:
port: {{ .Values.kubeScheduler.service.port}}
protocol: TCP
targetPort: {{ .Values.kubeScheduler.service.targetPort}}
{{- if .Values.kubeScheduler.endpoints }}{{- else }}
selector:
{{ include "prometheus-operator.rangeskipempty" .Values.kubeScheduler.service.selector | indent 4 }}
{{- end }}
type: ClusterIP
{{- end -}}
20 changes: 20 additions & 0 deletions stable/prometheus-operator/values.yaml
Expand Up @@ -350,6 +350,16 @@ kubelet:
##
kubeControllerManager:
enabled: true

## If your kube controller manager is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24

## If using kubeControllerManager.endpoints only the port and targetPort are used
##
service:
port: 10252
targetPort: 10252
Expand Down Expand Up @@ -416,6 +426,16 @@ kubeEtcd:
##
kubeScheduler:
enabled: true

## If your kube scheduler is not deployed as a pod, specify IPs it can be found on
##
endpoints: []
# - 10.141.4.22
# - 10.141.4.23
# - 10.141.4.24

## If using kubeScheduler.endpoints only the port and targetPort are used
##
service:
port: 10251
targetPort: 10251
Expand Down

0 comments on commit 7be0b80

Please sign in to comment.