You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by ke...@apache.org on 2021/04/09 22:34:31 UTC

[skywalking] branch master updated: Doc: Polish k8s monitoring otel-collector configuration example. (#6722)

This is an automated email from the ASF dual-hosted git repository.

kezhenxu94 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new 5ba8f00  Doc: Polish k8s monitoring otel-collector configuration example. (#6722)
5ba8f00 is described below

commit 5ba8f00205671ebeec9900467de4915db1de27c7
Author: wankai123 <wa...@foxmail.com>
AuthorDate: Sat Apr 10 06:34:11 2021 +0800

    Doc: Polish k8s monitoring otel-collector configuration example. (#6722)
---
 CHANGES.md                                       |  1 +
 docs/en/setup/backend/otel-collector-config.yaml | 51 +++++-------------------
 2 files changed, 11 insertions(+), 41 deletions(-)

diff --git a/CHANGES.md b/CHANGES.md
index cd628ba..2fa2e84 100644
--- a/CHANGES.md
+++ b/CHANGES.md
@@ -17,6 +17,7 @@ Release Notes.
 
 
 #### Documentation
+* Polish k8s monitoring otel-collector configuration example.
 
 All issues and pull requests are [here](https://github.com/apache/skywalking/milestone/84?closed=1)
 
diff --git a/docs/en/setup/backend/otel-collector-config.yaml b/docs/en/setup/backend/otel-collector-config.yaml
index b27281f..26dcd38 100644
--- a/docs/en/setup/backend/otel-collector-config.yaml
+++ b/docs/en/setup/backend/otel-collector-config.yaml
@@ -30,9 +30,8 @@ data:
             scrape_interval: 15s
             evaluation_interval: 15s
           scrape_configs:
-            - job_name: 'kubernetes-cadvisor' 
+            - job_name: 'kubernetes-cadvisor'
               scheme: https
-              metrics_path: /metrics/cadvisor
               tls_config:
                 ca_file: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
               bearer_token_file: /var/run/secrets/kubernetes.io/serviceaccount/token
@@ -41,9 +40,15 @@ data:
               relabel_configs:
               - action: labelmap
                 regex: __meta_kubernetes_node_label_(.+)
-              - source_labels: []
-                target_label: cluster   # relabel the cluster name 
+              - source_labels: []       # relabel the cluster name 
+                target_label: cluster
                 replacement: gke-cluster-1
+              - target_label: __address__
+                replacement: kubernetes.default.svc:443
+              - source_labels: [__meta_kubernetes_node_name]
+                regex: (.+)
+                target_label: __metrics_path__
+                replacement: /api/v1/nodes/$${1}/proxy/metrics/cadvisor
               - source_labels: [instance]   # relabel the node name 
                 separator: ;
                 regex: (.+)
@@ -160,40 +165,4 @@ spec:
             items:
               - key: otel-collector-config
                 path: otel-collector-config.yaml
-          name: otel-collector-config-vol
-
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRole
-metadata:
-  name: otel-collector
-rules:
-- apiGroups: [""]
-  resources:
-  - nodes
-  - nodes/proxy
-  - nodes/metrics
-  - services
-  - endpoints
-  - pods
-  verbs: ["get", "list", "watch"]
-- apiGroups:
-  - extensions
-  resources:
-  - ingresses
-  verbs: ["get", "list", "watch"]
-- nonResourceURLs: ["/metrics"]
-  verbs: ["get"]
----
-apiVersion: rbac.authorization.k8s.io/v1
-kind: ClusterRoleBinding
-metadata:
-  name: otel-collector
-roleRef:
-  apiGroup: rbac.authorization.k8s.io
-  kind: ClusterRole
-  name: otel-collector
-subjects:
-- kind: ServiceAccount
-  name: default
-  namespace: monitoring
\ No newline at end of file
+          name: otel-collector-config-vol
\ No newline at end of file