Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support external prometheus stack #1528

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions deploy/cluster-configuration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ spec:
openldapVolumeSize: 2Gi # openldap PVC size.
redisVolumSize: 2Gi # Redis PVC size.
monitoring:
# type: external # Whether to specify the external prometheus stack, and need to modify the endpoint at the next line.
endpoint: http://prometheus-operated.kubesphere-monitoring-system.svc:9090 # Prometheus endpoint to get metrics data.
es: # Storage backend for logging, events and auditing.
# elasticsearchMasterReplicas: 1 # The total number of master nodes. Even numbers are not allowed.
Expand Down
45 changes: 3 additions & 42 deletions roles/ks-monitor/tasks/main.yaml
Original file line number Diff line number Diff line change
@@ -1,45 +1,6 @@
---
- import_tasks: cleanup.yaml

- import_tasks: generate_manifests.yaml

- import_tasks: prometheus-operator.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: node-exporter.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: kube-state-metrics.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

# - import_tasks: prometheus-adapter.yaml

- import_tasks: grafana.yaml
- import_tasks: prometheus-stack.yaml
when:
- monitoring.grafana is defined
- monitoring.grafana.enabled is defined
- monitoring.grafana.enabled == true

- import_tasks: prometheus.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: devops.yaml

- import_tasks: etcd.yaml

- import_tasks: prometheus-rules.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: alertmanager.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: notification-manager.yaml
- "common.monitoring.type is not defined or common.monitoring.type != 'external'"

- import_tasks: monitoring-dashboard.yaml
when:
Expand All @@ -63,4 +24,4 @@
when:
- alerting is defined
- alerting.enabled is defined
- alerting.enabled == true
- alerting.enabled == true
46 changes: 46 additions & 0 deletions roles/ks-monitor/tasks/prometheus-stack.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
- import_tasks: cleanup.yaml

- import_tasks: generate_manifests.yaml

- import_tasks: prometheus-operator.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: node-exporter.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: kube-state-metrics.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

# - import_tasks: prometheus-adapter.yaml

- import_tasks: grafana.yaml
when:
- monitoring.grafana is defined
- monitoring.grafana.enabled is defined
- monitoring.grafana.enabled == true

- import_tasks: prometheus.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: devops.yaml

- import_tasks: etcd.yaml

- import_tasks: prometheus-rules.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: alertmanager.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"

- import_tasks: notification-manager.yaml

- import_tasks: monitoring-dashboard.yaml
when:
- "status.monitoring is not defined or status.monitoring.status is not defined or status.monitoring.status != 'enabled'"