Prometheus Operator for Istio¶
The Prometheus Operator provides a mechanism to manage Prometheus instances natively within Kubernetes using custom resources.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] In the context of Istio, it serves as an alternative to the standard Prometheus deployment, offering a structured way to handle service monitoring through Kubernetes objects.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md]
Deployment¶
To utilize the Prometheus Operator with Istio, the operator itself must first be deployed to the cluster.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] Once the operator is running, Istio provides a sample configuration that defines the necessary custom resources.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] This can be applied using the following command:
[kubectl](<./kubectl.md>) apply -f samples/addons/extras/prometheus-operator.yaml
^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md]
Configuration and Monitoring Targets¶
The Istio sample for the Prometheus Operator utilizes two primary custom resources to define monitoring targets:^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md]
- ServiceMonitor: Used to monitor the Istio control plane.
- PodMonitor: Used to monitor Envoy proxies (the data plane).
For the PodMonitor to function correctly with Istio, metrics merging must be enabled.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] This feature, which allows the aggregation of Metrics from different sources, is enabled by default in Istio.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md]
Scope and Limitations¶
The configurations provided in the Istio samples are specifically scoped to Istio deployments.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] Consequently, they do not automatically scrape Metrics from other Kubernetes components.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md] To enable comprehensive cluster monitoring, users must refer to the specific Cluster Monitoring documentation for the Prometheus Operator to configure scraping for standard Kubernetes components.^[400-devops-07-monitoring-and-observability-k8s-istio-samples-addons-readme.md]
Related Concepts¶
- Istio
- Prometheus
- [[Observability]]