mirror of
https://github.com/kubernetes-sigs/kubespray.git
synced 2026-03-06 18:17:47 +03:00
prometheus operator, metrics for k8s cluster
install using Helm: - Prometheus Operator - metrics for k8s cluster including: grafana dashboard, alertmanager, node exporters base project: https://github.com/coreos/prometheus-operator the issue: https://github.com/kubernetes-incubator/kubespray/issues/2042 Previous PR, raw ansible without Helm: https://github.com/kubernetes-incubator/kubespray/pull/2499
This commit is contained in:
9
roles/kubernetes-apps/metrics/defaults/main.yml
Normal file
9
roles/kubernetes-apps/metrics/defaults/main.yml
Normal file
@@ -0,0 +1,9 @@
|
||||
---
|
||||
# Prometheus Operator. Needs for k8s metrics. Installed Helm is required.
|
||||
prometheus_operator_enabled: false
|
||||
|
||||
# K8s cluster metrics. Installed Helm and Prometheus Operators are required.
|
||||
k8s_metrics_enabled: false
|
||||
|
||||
# Separate namespace for monitoring/metrics
|
||||
monitoring_namespace: "monitoring"
|
||||
17
roles/kubernetes-apps/metrics/tasks/main.yml
Normal file
17
roles/kubernetes-apps/metrics/tasks/main.yml
Normal file
@@ -0,0 +1,17 @@
|
||||
---
|
||||
- name: Metrics | Make sure Helm is installed
|
||||
command: "{{ bin_dir }}/helm version"
|
||||
|
||||
- name: Metrics | Add coreos repo
|
||||
command: "{{ bin_dir }}/helm repo add coreos https://s3-eu-west-1.amazonaws.com/coreos-charts/stable/"
|
||||
run_once: true
|
||||
|
||||
- name: Metrics | Install Prometheus Operator
|
||||
command: "{{ bin_dir }}/helm upgrade --install prometheus-operator coreos/prometheus-operator --namespace {{ monitoring_namespace }}"
|
||||
when: prometheus_operator_enabled
|
||||
run_once: true
|
||||
|
||||
- name: Metrics | Install K8s cluster metrics
|
||||
command: "{{ bin_dir }}/helm upgrade --install kube-prometheus coreos/kube-prometheus --namespace {{ monitoring_namespace }}"
|
||||
when: k8s_metrics_enabled
|
||||
run_once: true
|
||||
Reference in New Issue
Block a user