Skip to content

Commit b8ea822

Browse files
committed
Only produce metric if feature gate is enabled
1 parent 16c59e6 commit b8ea822

File tree

1 file changed

+6
-3
lines changed
  • keps/sig-auth/4872-harden-kubelet-cert-validation

1 file changed

+6
-3
lines changed

keps/sig-auth/4872-harden-kubelet-cert-validation/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,15 @@ This flag will allow cluster administrators to opt-out of this validation if the
154154
#### Metrics
155155

156156
In order to help cluster administrators determine if it's safe to enable the feature, we propose to add a new metric `kube_apiserver_validation_kubelet_cert_cn_errors` that will track the number of errors due to the new CN validation.
157-
If the feature gate is disabled, we will still add the validation code to the HTTP transport, however, if the validation fails we won't return an error, we will just increment the metric counter.
158157
In addition, we will log the error including the node name, so cluster administrators can identify which nodes are affected and need to reissue their certificates.
159158

160-
We purposefully don't add the node name to the metric to avoid a high cardinality.
159+
If the feature gate is disabled, we won't publish the metric or run any validation code at all.
160+
161+
If the feature gate is enabled but the feature is disabled (with `--disable-kubelet-cert-cn-validation`), we will still add the validation code to the HTTP transport, however, if the validation fails we won't return an error, we will just increment the metric counter.
162+
163+
We intentionally don't add the node name to the metric to avoid a high cardinality.
161164
The purpose of the metric is to easily/cheaply tell administrators if they can flip the feature on or not. If the answer is no (counter is greater than 0), the rest of the necessary information to detect the offending nodes will come from logs.
162165

163-
Given that running the validation to feed the metric still has a cost, we won't run it if the validation is explicitly disabled with `--disable-kubelet-cert-cn-validation`.
164166

165167
We will remove the metric once the feature is GA.
166168

@@ -384,3 +386,4 @@ None.
384386
## Infrastructure Needed
385387

386388
None.
389+
****

0 commit comments

Comments
 (0)