音乐网站开发背景,网站免费建站叉手,广告公司注册需要什么条件,网站被管理员权限您可以使Prometheus配置了解您的应用程序在其中运行的Kubernetes环境。在先前的博客文章中 #xff0c;我已经描述了如何手动执行该操作。 Prometheus Operator是Kubernetes的扩展#xff0c;它以更自动化和有效的方式管理Prometheus监视实例。 Prometheus Operator允许您将… 您可以使Prometheus配置了解您的应用程序在其中运行的Kubernetes环境。在先前的博客文章中 我已经描述了如何手动执行该操作。 Prometheus Operator是Kubernetes的扩展它以更自动化和有效的方式管理Prometheus监视实例。 Prometheus Operator允许您将监视实例定义和管理为Kubernetes资源。 如果您知道如何管理Kubernetes则入门门槛很低可以有效地定义对应用程序的监视。 为了为Prometheus运营商启用Kubernetes我们设置了资源和RBAC定义您可以在此处找到它们。 这通过更多的Kubernetes资源类型例如ServiceMonitor或Prometheus增强了我们的集群。 同样您可以使用Prometheus Operator 舵图 。 我们定义了config-example应用程序的运算符类似于上一篇文章 apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: config-example labels: team: example spec: selector: matchLabels: app: config-example endpoints: - basicAuth: password: name: basic-auth key: password username: name: basic-auth key: username port: https scheme: https path: /metrics/ tlsConfig: insecureSkipVerify: true apiVersion: monitoring.coreos.com/v1 kind: Prometheus metadata: name: prometheus spec: serviceAccountName: prometheus serviceMonitorSelector: matchLabels: team: example resources: requests: memory: 400Mi apiVersion: v1 kind: Service metadata: name: prometheus spec: ports: - port: 9090 name: http selector: prometheus: prometheus apiVersion: v1 kind: Secret metadata: name: basic-auth data: password: YWRtaW5hZG1pbg username: YWRtaW4 这将设置一个prometheus实例该实例将使用提供的配置来访问通过app: config-example标签部署的app: config-example 。 它还创建了一个prometheus服务来访问监视实例。 您可以在文档中找到Prometheus Operator API的完整说明。 应用所有资源后我们可以看到集群中正在运行的监视实例 gt; kubectl get pods NAME READY STATUS RESTARTS AGE config-example-7db586bb95-jdmsx gt; kubectl get pods NAME READY STATUS RESTARTS AGE config-example-7db586bb95-jdmsx 1 / 1 Running 0 12m config-example-7db586bb95-z4ln8 1 / 1 Running 0 12m [...] prometheus-prometheus- 0 3 / 3 Running 0 14m 这使我们能够简单地监视所有应用程序实例而无需手动配置Prometheus实例。 查看GitHub上的完整示例 deployment/目录。 发现帖子有用吗 订阅我的时事通讯获取有关IT和Java的更多免费内容技巧和窍门 成功 现在检查您的电子邮件以确认您的订阅。 ©Sebastian DaschnerCC BY-NC-SA 4.0 翻译自: https://www.javacodegeeks.com/2019/02/monitor-prometheus-kubernetes.html