Kubernetes1.16下部署Prometheus+node-exporter+Grafana+AlertManager
Prometheus 持久化安装 我们prometheus采用nfs挂载方式来存储数据,同时使用configMap管理配置文件。并且我们将所有的prometheus存储在 kube-system #建议将所有的prometheus yaml文件存在一块 mkdir /opt/prometheus -p && cd /opt/prometheus #生成配置文件 cat >> prometheus.configmap.yaml <<EOF apiVersion: v1 kind: ConfigMap metadata: name: prometheus-config namespace: kube-system data: prometheus.yml: | global: scrape_interval: 15s scrape_timeout: 15s scrape_configs: - job_name: 'prometheus' static_configs: - targets: ['localhost:9090'] EOF # 配置文件解释(这里的configmap实际上就是prometheus的配置) 上面包含了3个模块global、rule_files和scrape_configs 其中global模块控制Prometheus Server的全局配置 scrape