Skip to content

Commit

Permalink
Merge branch 'main' of github.com:flashcatcloud/categraf
Browse files Browse the repository at this point in the history
  • Loading branch information
UlricQin committed Jul 26, 2022
2 parents 1cd3658 + 0639acd commit d962b14
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 80 deletions.
3 changes: 2 additions & 1 deletion inputs/mongodb/dashboard.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"definition": "label_values(mongodb_up,instance)"
}
],
"version": "2.0.0",
"panels": [
{
"id": "dd7882d6-9502-4a76-845a-efdbcdb25466",
Expand Down Expand Up @@ -933,4 +934,4 @@
}
]
}
}
}
115 changes: 36 additions & 79 deletions k8s/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -201,7 +152,7 @@ data:
]
action: keep
regex: default;kubernetes;https
- job_name: "controller-manager"
metrics_path: "/metrics"
kubernetes_sd_configs:
Expand All @@ -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:
Expand All @@ -239,7 +190,7 @@ data:
]
action: keep
regex: kube-system;kube-scheduler;https
- job_name: "etcd"
metrics_path: "/metrics"
kubernetes_sd_configs:
Expand All @@ -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'
---
Expand Down Expand Up @@ -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
Expand All @@ -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

0 comments on commit d962b14

Please sign in to comment.