Kubernetes的对象和Prometheus运算符

时间:2019-10-01 16:21:34

标签: kubernetes devops prometheus prometheus-operator

请帮助我了解有关PrometheusPrometheus operator集成到Kubernetes中的一件事。

从文档中我看到,使用了一种新的而非标准的Kubernetes对象来配置Prometheus operator。我指的是标准的PodServiceReplicaSetDeployment等。如何创建像PrometheusRulePrometheus这样的新词?这里有一个整合点吗?

将我带到这个问题的文档在这里https://github.com/coreos/prometheus-operator/blob/master/Documentation/user-guides/alerting.md

这种Kubernetes对象YAML的示例

apiVersion: monitoring.coreos.com/v1
kind: Prometheus
metadata:
  name: example
spec:
  replicas: 2
  alerting:
    alertmanagers:
    - namespace: default
      name: alertmanager-example
      port: web
  serviceMonitorSelector:
    matchLabels:
      team: frontend
  ruleSelector:
    matchLabels:
      role: alert-rules
      prometheus: example

1 个答案:

答案 0 :(得分:1)

这是Kubernetes Custom Resource