Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
starsliao committed Dec 9, 2020
1 parent 40ec343 commit 192d840
Showing 1 changed file with 2 additions and 57 deletions.
59 changes: 2 additions & 57 deletions kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ kubectl create namespace ops-monit
cd kube-state-metrics
kubectl apply -f .
```
## Kubernetes for Prometheus Dashboard 使用与配置说明
## Kubernetes for Prometheus Dashboard 使用与prometheus相关配置说明,请参考
[https://grafana.com/grafana/dashboards/13105](https://grafana.com/grafana/dashboards/13105)

### 截图
---
#### 整体资源总览
![](https://grafana.com/api/dashboards/13105/images/9490/image)
Expand All @@ -22,63 +23,7 @@ kubectl apply -f .
#### K8S网络带宽
![](https://grafana.com/api/dashboards/13105/images/9023/image)
---
#### Prometheus job配置参考(kube-state-metrics部署在ops-monit命名空间):
```
- job_name: 'k8s-cadvisor'
metrics_path: /metrics/cadvisor
kubernetes_sd_configs:
- role: node
relabel_configs:
- source_labels: [__address__]
regex: '(.*):10250'
replacement: '${1}:10255'
target_label: __address__
action: replace
- action: labelmap
regex: __meta_kubernetes_node_label_(.+)
metric_relabel_configs:
- source_labels: [instance]
separator: ;
regex: (.+)
target_label: node
replacement: $1
action: replace
- source_labels: [pod_name]
separator: ;
regex: (.+)
target_label: pod
replacement: $1
action: replace
- source_labels: [container_name]
separator: ;
regex: (.+)
target_label: container
replacement: $1
action: replace

- job_name: kube-state-metrics
kubernetes_sd_configs:
- role: endpoints
namespaces:
names:
- ops-monit
relabel_configs:
- source_labels: [__meta_kubernetes_service_label_app_kubernetes_io_name]
regex: kube-state-metrics
replacement: $1
action: keep
- action: labelmap
regex: __meta_kubernetes_service_label_(.+)
- source_labels: [__meta_kubernetes_namespace]
action: replace
target_label: k8s_namespace
- source_labels: [__meta_kubernetes_service_name]
action: replace
target_label: k8s_sname
```
---
### 关注公众号【**全栈运维开发**】加入运维群交流,获取更多...
![](https://starsl.cn/static/img/qr.png)
### 博客:[StarsL.cn](https://starsl.cn/)
Expand Down

0 comments on commit 192d840

Please sign in to comment.