@@ -301,7 +301,7 @@ Starting in Kubernetes v1.19, making an API request to a deprecated REST API end
301
301
302
302
1 . Returns a ` Warning ` header (as defined in [ RFC7234, Section 5.5] ( https://tools.ietf.org/html/rfc7234#section-5.5 ) ) in the API response.
303
303
2 . Adds a ` "k8s.io/deprecated":"true" ` annotation to the [ audit event] ( /docs/tasks/debug-application-cluster/audit/ ) recorded for the request.
304
- 3 . Sets an ` apiserver_requested_deprecated_apis ` gauge metric to ` 1 ` in the ` kube-apiserver `
304
+ 3 . Sets an ` apiserver_requested_deprecated_apis ` gauge metric to ` 1 ` in the ` kube-apiserver `
305
305
process. The metric has labels for ` group ` , ` version ` , ` resource ` , ` subresource ` that can be joined
306
306
to the ` apiserver_request_total ` metric, and a ` removed_release ` label that indicates the
307
307
Kubernetes release in which the API will no longer be served. The following Prometheus query
@@ -428,6 +428,46 @@ transitions a lifecycle stage as follows. Feature gates must function for no les
428
428
is deprecated it must be documented in both in the release notes and the corresponding CLI help.
429
429
Both warnings and documentation must indicate whether a feature gate is non-operational.**
430
430
431
+ ## Deprecating a metric
432
+
433
+ Each component of the Kubernetes control-plane exposes metrics (usually the
434
+ ` /metrics ` endpoint), which are typically ingested by cluster administrators.
435
+ Not all metrics are the same: some metrics are commonly used as SLIs or used
436
+ to determine SLOs, these tend to have greater import. Other metrics are more
437
+ experimental in nature or are used primarily in the Kubernetes development
438
+ process.
439
+
440
+ Accordingly, metrics fall under two stability classes (` ALPHA ` and ` STABLE ` );
441
+ this impacts removal of a metric during a Kubernetes release. These classes
442
+ are determined by the perceived importance of the metric. The rules for
443
+ deprecating and removing a metric are as follows:
444
+
445
+ ** Rule #9a: Metrics, for the corresponding stability class, must function for no less than:**
446
+
447
+ * ** STABLE: 4 releases or 12 months (whichever is longer)**
448
+ * ** ALPHA: 0 releases**
449
+
450
+ ** Rule #9b: Metrics, after their _ announced deprecation_ , must function for no less than:**
451
+
452
+ * ** STABLE: 3 releases or 9 months (whichever is longer)**
453
+ * ** ALPHA: 0 releases**
454
+
455
+ Deprecated metrics will have their description text prefixed with a deprecation notice
456
+ string '(Deprecated from x.y)' and a warning log will be emitted during metric
457
+ registration. Like their stable undeprecated counterparts, deprecated metrics will
458
+ be automatically registered to the metrics endpoint and therefore visible.
459
+
460
+ On a subsequent release (when the metric's deprecatedVersion is equal to
461
+ _ current_kubernetes_version - 3_ )), a deprecated metric will become a _ hidden_ metric.
462
+ ** _ Unlike_ ** their deprecated counterparts, hidden metrics will _ no longer_ be
463
+ automatically registered to the metrics endpoint (hence hidden). However, they
464
+ can be explicitly enabled through a command line flag on the binary
465
+ (i.e. ` --show-hidden-metrics-for-version= ` ). This provides cluster admins an
466
+ escape hatch to properly migrate off of a deprecated metric, if they were not
467
+ able to react to the earlier deprecation warnings. Hidden metrics should be
468
+ deleted after one release.
469
+
470
+
431
471
## Exceptions
432
472
433
473
No policy can cover every possible situation. This policy is a living
@@ -438,4 +478,3 @@ leaders to find the best solutions for those specific cases, always bearing in
438
478
mind that Kubernetes is committed to being a stable system that, as much as
439
479
possible, never breaks users. Exceptions will always be announced in all
440
480
relevant release notes.
441
-
0 commit comments