diff --git a/inputs/mongodb/dashboard.json b/inputs/mongodb/dashboard.json index d1cc0702..4c889966 100644 --- a/inputs/mongodb/dashboard.json +++ b/inputs/mongodb/dashboard.json @@ -8,6 +8,7 @@ "definition": "label_values(mongodb_up,instance)" } ], + "version": "2.0.0", "panels": [ { "id": "dd7882d6-9502-4a76-845a-efdbcdb25466", @@ -933,4 +934,4 @@ } ] } -} \ No newline at end of file +} diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 3a018fce..61bc0b38 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -51,59 +51,6 @@ subjects: name: categraf-serviceaccount namespace: ${CATEGRAF_NAMESPACE} --- -apiVersion: v1 -kind: Service -metadata: - namespace: kube-system - name: kube-controller-manager - labels: - k8s-app: kube-controller-manager -spec: - selector: - component: kube-controller-manager - type: ClusterIP - clusterIP: None - ports: - - name: https - port: 10257 - targetPort: 10257 ---- -apiVersion: v1 -kind: Service -metadata: - namespace: kube-system - name: kube-scheduler - labels: - k8s-app: kube-scheduler -spec: - selector: - component: kube-scheduler - type: ClusterIP - clusterIP: None - ports: - - name: https - port: 10259 - targetPort: 10259 - protocol: TCP ---- -apiVersion: v1 -kind: Service -metadata: - namespace: kube-system - name: etcd - labels: - k8s-app: etcd -spec: - selector: - component: etcd - type: ClusterIP - clusterIP: None - ports: - - name: https - port: 2379 - targetPort: 2379 - protocol: TCP ---- kind: ConfigMap metadata: name: etcd-pki @@ -169,13 +116,17 @@ data: prometheus.toml: | [prometheus] enable = true - scrape_config_file="/opt/categraf/conf/in_cluster_scrape.yaml" + scrape_config_file="/opt/categraf/scrape/in_cluster_scrape.yaml" ## log level, debug warn info error log_level="info" - ## wal file storage path ,default ./data-agent - wal_storage_path="/" ## wal reserve time duration, default value is 2 hour # wal_min_duration=2 +--- +kind: ConfigMap +metadata: + name: scrape-config +apiVersion: v1 +data: in_cluster_scrape.yaml: | global: scrape_interval: 15s @@ -201,7 +152,7 @@ data: ] action: keep regex: default;kubernetes;https - + - job_name: "controller-manager" metrics_path: "/metrics" kubernetes_sd_configs: @@ -217,10 +168,10 @@ data: __meta_kubernetes_namespace, __meta_kubernetes_service_name, __meta_kubernetes_endpoint_port_name, - ] - action: keep - regex: kube-system;kube-controller-manager;https - + ] + action: keep + regex: kube-system;kube-controller-manager;https + - job_name: "scheduler" metrics_path: "/metrics" kubernetes_sd_configs: @@ -239,7 +190,7 @@ data: ] action: keep regex: kube-system;kube-scheduler;https - + - job_name: "etcd" metrics_path: "/metrics" kubernetes_sd_configs: @@ -258,23 +209,23 @@ data: __meta_kubernetes_endpoint_port_name, ] action: keep - regex: kebe-system;etcd;https - - - job_name: "coredns" - metrics_path: "/metrics" - kubernetes_sd_configs: - - role: endpoints - scheme: http - relabel_configs: - - source_labels: - [ - __meta_kubernetes_namespace, - __meta_kubernetes_service_name, - __meta_kubernetes_endpoint_port_name, - ] - action: keep - regex: kube-system;kube-dns;metrics - + regex: kube-system;etcd;https + + - job_name: "coredns" + metrics_path: "/metrics" + kubernetes_sd_configs: + - role: endpoints + scheme: http + relabel_configs: + - source_labels: + [ + __meta_kubernetes_namespace, + __meta_kubernetes_service_name, + __meta_kubernetes_endpoint_port_name, + ] + action: keep + regex: kube-system;kube-dns;metrics + remote_write: - url: 'http://${NSERVER_SERVICE_WITH_PORT}/prometheus/v1/write' --- @@ -322,6 +273,8 @@ spec: volumeMounts: - mountPath: /opt/categraf/conf name: categraf-config + - mountPath: /opt/categraf/scrape + name: scrape-config - mountPath: /opt/categraf/pki/etcd name: etcd-pki dnsPolicy: ClusterFirst @@ -339,6 +292,10 @@ spec: defaultMode: 420 name: categraf-config name: categraf-config + - configMap: + defaultMode: 420 + name: scrape-config + name: scrape-config - configMap: name: etcd-pki name: etcd-pki