Skip to content

Commit ab3a39d

Browse files
committed
Self review changes
Signed-off-by: Richard Wall <[email protected]>
1 parent 5b7d752 commit ab3a39d

File tree

6 files changed

+26
-9
lines changed

6 files changed

+26
-9
lines changed

cmd/app/options/options.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ type Options struct {
7070
// CMClient is a rest client for interacting with cert-manager resources.
7171
CMClient cmclient.Interface
7272

73-
// The host and port that the metrics endpoint should listen on.
73+
// MetricsBindAddress is the TCP address for exposing HTTP Prometheus metrics
74+
// which will be served on the HTTP path '/metrics'. The value "0" will
75+
// disable exposing metrics.
7476
MetricsBindAddress string
7577
}
7678

@@ -156,6 +158,6 @@ func (o *Options) addAppFlags(fs *pflag.FlagSet) {
156158
fs.BoolVar(&o.UseTokenRequest, "use-token-request", false,
157159
"Use the empty audience token request for creating CertificateRequests. Requires the token request to be defined on the CSIDriver manifest.")
158160
fs.StringVar(&o.MetricsBindAddress, "metrics-bind-address", "0",
159-
"The host and port that the metrics endpoint should listen on (for example ::9402). "+
160-
"If 0, the metrics server will be disabled. (default).")
161+
"TCP address for exposing HTTP Prometheus metrics which will be served on the HTTP path '/metrics'. "+
162+
`The value "0" will disable exposing metrics.`)
161163
}

deploy/charts/csi-driver/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The TCP port on which the metrics server will listen.
2727
> false
2828
> ```
2929
30-
Create a PodMonitor to add csi-driver to Prometheus.
30+
Create a PodMonitor to add csi-driver to Prometheus if you are using Prometheus Operator. See https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitor
3131
#### **metrics.podmonitor.namespace** ~ `string`
3232
3333
The namespace that the pod monitor should live in, defaults to the cert-manager-csi-driver namespace.

deploy/charts/csi-driver/values.schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@
300300
},
301301
"helm-values.metrics.podmonitor.enabled": {
302302
"default": false,
303-
"description": "Create a PodMonitor to add csi-driver to Prometheus.",
303+
"description": "Create a PodMonitor to add csi-driver to Prometheus if you are using Prometheus Operator. See https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitor",
304304
"type": "boolean"
305305
},
306306
"helm-values.metrics.podmonitor.endpointAdditionalProperties": {

deploy/charts/csi-driver/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ metrics:
55
# The TCP port on which the metrics server will listen.
66
port: 9402
77
podmonitor:
8-
# Create a PodMonitor to add csi-driver to Prometheus.
8+
# Create a PodMonitor to add csi-driver to Prometheus if you are using Prometheus Operator.
9+
# See https://prometheus-operator.dev/docs/operator/api/#monitoring.coreos.com/v1.PodMonitor
910
enabled: false
1011

1112
# The namespace that the pod monitor should live in, defaults

make/test-e2e.mk

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ e2e-setup-cert-manager: | kind-cluster $(NEEDS_HELM) $(NEEDS_KUBECTL)
3434
--set startupapicheck.image.repository=$(quay.io/jetstack/cert-manager-startupapicheck.REPO) \
3535
--set startupapicheck.image.tag=$(quay.io/jetstack/cert-manager-startupapicheck.TAG) \
3636
--set startupapicheck.image.pullPolicy=Never \
37-
--set prometheus.podmonitor.enabled=true \
3837
cert-manager cert-manager >/dev/null
3938

4039
# The "install" target can be run on its own with any currently active cluster,
@@ -47,7 +46,6 @@ endif
4746

4847
test-e2e-deps: INSTALL_OPTIONS :=
4948
test-e2e-deps: INSTALL_OPTIONS += --set image.repository=$(oci_manager_image_name_development)
50-
test-e2e-deps: INSTALL_OPTIONS += --set metrics.podmonitor.enabled=true
5149
test-e2e-deps: e2e-setup-cert-manager
5250
test-e2e-deps: install
5351

test/e2e/suite/cases/metrics.go

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,19 @@
1+
/*
2+
Copyright 2021 The cert-manager Authors.
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
*/
16+
117
package cases
218

319
import (
@@ -17,7 +33,7 @@ const (
1733
var _ = framework.CasesDescribe("Metrics", func() {
1834
f := framework.NewDefaultFramework("metrics")
1935

20-
FIt("Should serve Go and process metrics on port 9402", func() {
36+
It("Should serve Go and process metrics on port 9402", func() {
2137
By("Discovering the name of the csi-driver Pod")
2238
pods, err := f.KubeClientSet.CoreV1().Pods(certManagerNamespace).List(context.TODO(), metav1.ListOptions{
2339
LabelSelector: "app.kubernetes.io/instance=csi-driver",

0 commit comments

Comments
 (0)