prometheus入门实践之基于k8s部署prometheus集群

在了解了prometheus原来架构后,我们知道里整个prometheus的相关组件的用途,其中最核心的部门为prometheus server端,是整个prometheus的数据处理中心。俗称prometheus server。

prometheus部署

以kubernetes容器云平台为例,部署prometheus server端,这里已经定义好里prometheus相关资源对象创建,部署文件如下:kubernetes平台部署prometheus 服务

  1. 部署前准备:
    1.1、创建pormetheus所部署的命名空间(namespace),以monitring为例,如下所示:
    kubectl apply -f ./cloudnative/prometheus/namesapce.yaml

    创建后结果如下:

    kubectl get ns | grep monitoring
    monitoring             Active   23h

    1.2、创建prometheus 服务端所需要的配置文件,即configmap文件

    kubectl apply -f ./cloudnative/prometheus/prometheus/prometheus-configmap.yaml

    创建后结果如下:

    kubectl get cm -n monitoring
    NAME         DATA   AGE
    prometheus   2      7s

猜你喜欢

转载自blog.51cto.com/blief/2633177