Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VC-34401] Update Prometheus metrics documentation to include information about the cainjector #1524

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 20 additions & 4 deletions content/docs/devops-tips/prometheus-metrics.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: Prometheus Metrics
description: 'cert-manager usage: Prometheus metrics'
---

To help with operations and insights into cert-manager activities, cert-manager exposes metrics in the [Prometheus](https://prometheus.io/) format from the controller and webhook components. These are available at the standard `/metrics` endpoint on port `9402` of each component Pod.
To help with operations and insights into cert-manager activities, cert-manager exposes metrics in the [Prometheus](https://prometheus.io/) format from the controller, webhook and cainjector components. These are available at the standard `/metrics` endpoint on port `9402` of each component Pod.

## Scraping Metrics

Expand Down Expand Up @@ -41,6 +41,7 @@ spec:
- key: app.kubernetes.io/name
operator: In
values:
- cainjector
- cert-manager
- webhook
- key: app.kubernetes.io/instance
Expand All @@ -50,6 +51,7 @@ spec:
- key: app.kubernetes.io/component
operator: In
values:
- cainjector
- controller
- webhook
podMetricsEndpoints:
Expand Down Expand Up @@ -85,6 +87,12 @@ webhook:
filesystem:
certFile: "/path/to/cert.pem"
keyFile: "/path/to/key.pem"
cainjector:
config:
metricsTLSConfig:
filesystem:
certFile: "/path/to/cert.pem"
keyFile: "/path/to/key.pem"
```

#### Dynamic certificates
Expand Down Expand Up @@ -124,12 +132,20 @@ webhook:
secretName: "cert-manager-metrics-ca"
dnsNames:
- cert-manager-metrics
cainjector:
config:
metricsTLSConfig:
dynamic:
secretNamespace: "cert-manager"
secretName: "cert-manager-metrics-ca"
dnsNames:
- cert-manager-metrics
```

> ℹ️ This configuration will result in a single new Secret `cert-manager/cert-manager-metrics-ca` containing a CA.
> The first `controller` or `webook` Pod will create the CA Secret and the others will then use it.
> The first `controller`, `webook`, or `cainjector` Pod will create the CA Secret and the others will then use it.
>
> All the controller and webhook Pods will generate their own unique metrics serving certificates
> All the controller, webhook, and cainjector Pods will generate their own unique metrics serving certificates
> and sign them with the CA private key.
>
> The `PodMonitor` is configured to read the public certificate from the CA Secret
Expand All @@ -141,7 +157,7 @@ webhook:

##### Troubleshooting

Check the controller and webhook logs to see the CA certificate and serving certificates being created and updated:
Check the controller, webhook and cainjector logs to see the CA certificate and serving certificates being created and updated:

```sh
kubectl -n cert-manager logs -l app.kubernetes.io/instance=cert-manager --prefix
Expand Down
6 changes: 3 additions & 3 deletions content/docs/releases/release-notes/release-notes-1.16.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ cert-manager 1.16 includes various improvements to the metrics in the cert-manag

### Extended Metrics

The webhook component now has a metrics server, so that platform teams can
monitor its performance and gain more information about the underlying Go
runtime in the event of a problem.
The webhook and cainjector components now have metrics servers,
so that platform teams can monitor the performance of all the cert-manager components
and gain more information about the underlying Go runtime in the event of a problem.
Read the [Prometheus Metrics](../../devops-tips/prometheus-metrics.md) page to learn more.

## Community
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.