关于prometheus:prometheusoperator使用一-整体架构

prometheus-operator部署模式为deployment,其应用operator框架开发,operator实质上是CRD+controller:

  • CRD: prometheus/prometheusurle/alertmanager/serviceMonitor/podMonitor等;
  • controller: 监听CRD的变动,批改相应的资源配置;

prometheus-operator蕴含的CRD:

  • prometheus: 对prometheus-server的形象;
  • serviceMonitor: 对service监控对象的形象;
  • podMonitor: 对pod监控对象的形象;
  • prometheusrule: 对prometheus报警规定的形象;

prometheus-operator的应用,根本是如何操作上述的CRD对象。

查看CRD类型:

# kubectl get crd |grep coreos
alertmanagers.monitoring.coreos.com                   2021-05-28T08:02:20Z
podmonitors.monitoring.coreos.com                     2021-05-28T08:02:21Z
prometheuses.monitoring.coreos.com                    2021-05-28T08:02:22Z
prometheusrules.monitoring.coreos.com                 2021-05-28T08:02:23Z
servicemonitors.monitoring.coreos.com                 2021-05-28T08:02:24Z
thanosrulers.monitoring.coreos.com                    2021-05-28T08:02:25Z

查看特定CRD类型下的实例:

# kubectl get prometheuses -n monitoring
NAME   VERSION   REPLICAS   AGE
k8s    v2.20.0   2          46h
# kubectl get servicemonitors -n monitoring
NAME                      AGE
alertmanager              46h
coredns                   46h
etcd-k8s                  19h
kube-apiserver            46h
kube-controller-manager   46h
kube-scheduler            46h
kube-state-metrics        46h
kubelet                   46h
node-exporter             46h
prometheus                46h
prometheus-adapter        46h
prometheus-operator       46h

参考:
1.operator开发/部署:https://www.qikqiak.com/post/k8s-operator-101/

评论

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

这个站点使用 Akismet 来减少垃圾评论。了解你的评论数据如何被处理