You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@yunikorn.apache.org by "0yukali0 (via GitHub)" <gi...@apache.org> on 2023/05/23 08:57:45 UTC

[GitHub] [yunikorn-site] 0yukali0 commented on a diff in pull request #301: [YUNIKORN-1753] Adding a document of integrate prometheus and grafana

0yukali0 commented on code in PR #301:
URL: https://github.com/apache/yunikorn-site/pull/301#discussion_r1201848538


##########
docs/user_guide/prometheus.md:
##########
@@ -79,4 +83,87 @@ You should be able to browse to a status page at [localhost:9090](http://localh
 
 ![prometheus-web-ui](../assets/prometheus-web-ui.png)
 
-You can also verify that Prometheus is serving metrics by navigating to its metrics endpoint:[localhost:9090/metrics](http://localhost:9090/metrics)
\ No newline at end of file
+You can also verify that Prometheus is serving metrics by navigating to its metrics endpoint:[localhost:9090/metrics](http://localhost:9090/metrics)
+
+## Deploy Prometheus and Grafana in a cluster.
+
+### 1. Add Prometheus repository to helm
+    
+```yaml
+# add helm repo
+helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
+helm repo update
+```
+    
+### 2. Configuring yunikorn for prometheus
+
+Get the config from repository.
+```yaml
+helm show values prometheus-community/kube-prometheus-stack > /tmp/values.yaml
+```
+
+Add a new job in Prometheus to collect metrics by scraping the metrics HTTP endpoints of the targets.
+
+```yaml
+vim /tmp/values.yaml
+```
+```yaml
+...
+additionalScrapeConfigs:
+  - job_name: "yunikorn"
+    scrape_interval: 1s
+    metrics_path: '/ws/v1/metrics'
+    static_configs:
+      - targets: ["yunikorn-service.yunikorn.svc.cluster.local:9080"]
+...
+```
+    
+### 3. Use helm to create Prometheus
+
+```yaml
+# create k8s namespace
+kubectl create namespace prometheus
+
+# deploy chart
+helm install prometheus prometheus-community/kube-prometheus-stack -n prometheus -f /tmp/values.yaml

Review Comment:
   Adding --create-namespace can create namespace automatically replaces the `kubectl create namespace prometheus`.
   ```
   helm install prometheus prometheus-community/kube-prometheus-stack -n prometheus --create-namespace  -f /tmp/values.yaml
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: reviews-unsubscribe@yunikorn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org