You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -619,6 +620,8 @@ Additional work may be required to evaluate other kubelet components (e.g. evict
619
620
Ideally all components will rely on summary API thereby alleviating need for cAdvisor for container and pod level stats.
620
621
This is also a requirement to be able to disable cAdvisor container metrics collection.
621
622
623
+
To make clear to cluster admins when metrics are coming from CRI, rather than cadvisor, a new metric `kubelet_metrics_provider` will be used, with `provider` label either `cri` or `cadvisor`.
624
+
622
625
#### cAdvisor
623
626
624
627
Once CRI and Kubelet stats provider level changes are in place, we can evaluate disabling cAdvisor from collecting container and pod level stats.
@@ -793,7 +796,7 @@ We expect no non-infra related flakes in the last month as a GA graduation crite
793
796
- A test using the CRI stats feature gate with enabled CRI implementations should be used with cri_stats_provider to ensure the stats reported are conformant.
794
797
795
798
### Graduation Criteria
796
-
#### Alpha implementation
799
+
#### Alpha
797
800
798
801
- CRI should be extended to provide required stats for `/stats/summary`
799
802
- Kubelet should be extended to provide the required stats from CRI implementation for `/stats/summary`.
@@ -803,20 +806,19 @@ We expect no non-infra related flakes in the last month as a GA graduation crite
803
806
- This will allow the CRI to broadcast `/metrics/cadvisor` through the Kubelet's HTTP server.
804
807
- Conduct research to find the set of metrics from `/metrics/cadvisor` that compliant CRI implementations must expose.
805
808
806
-
#### Alpha -> Beta Graduation
809
+
#### Beta
807
810
808
-
-Conformance tests for the fields in `/metrics/cadvisor` should be created.
811
+
-e2e_node tests for the fields in `/metrics/cadvisor` should be created.
809
812
- Validate performance impact of this feature is within allowable margin (or non-existent, ideally).
810
813
- The CRI stats implementation should perform better than they did with CRI+cAdvisor.
811
814
- cAdvisor stats provider will be marked as deprecated, as well as the cAdvisor providing the metrics endpoint `/metrics/cadvisor`.
812
-
- Write migration documentation for entities relying on metrics from `/metrics/cadvisor`.
813
-
- Windows stats and metrics will be added.
814
815
815
-
#### Beta -> GA Graduation
816
+
#### GA
816
817
817
818
- The CRI stats provider in the Kubelet should be fully formed, and able to satisfy all the needs of downstream consumers
818
-
- cAdvisor stats provider will likely be marked as deprecated (depending on dockershim deprecation).
819
+
- cAdvisor stats provider support will be dropped
819
820
- Feature gate removed and the CRI stats provider will no longer rely on cAdvisor for container/pod level metrics.
821
+
- Conformance tests for stats and metrics being present as expected from the new sources.
820
822
821
823
### Upgrade / Downgrade Strategy
822
824
@@ -860,26 +862,26 @@ you need any help or guidance.
860
862
861
863
_This section must be completed when targeting alpha to a release._
862
864
863
-
***How can this feature be enabled / disabled in a live cluster?**
865
+
###### How can this feature be enabled / disabled in a live cluster?
866
+
864
867
-[x] Feature gate (also fill in values in `kep.yaml`)
865
868
- Feature gate name: PodAndContainerStatsFromCRI
866
869
- Components depending on the feature gate: Kubelet
867
870
868
-
***Does enabling the feature change any default behavior?**
869
-
Any change of default behavior may be surprising to users or break existing
870
-
automations, so be extremely careful here.
871
-
Enabling this behavior means some stats endpoints will not be filled:
871
+
###### Does enabling the feature change any default behavior?
872
+
:
873
+
Enabling this behavior means some stats endpoints will not be filled:
872
874
- some entries in `/metrics/cadvisor`
873
875
- Accelerator and UserDefinedMetrics in `/stats/summary`
874
876
875
-
***Can the feature be disabled once it has been enabled (i.e. can we roll back
876
-
the enablement)?**
877
+
###### Can the feature be disabled once it has been enabled (i.e. can we roll back the enablement)?
878
+
877
879
Yes, assuming the Kubelet is restarted.
878
880
879
-
***What happens if we reenable the feature if it was previously rolled back?**
881
+
###### What happens if we reenable the feature if it was previously rolled back?
880
882
There should be no problem with this.
881
883
882
-
***Are there any tests for feature enablement/disablement?**
884
+
###### Are there any tests for feature enablement/disablement?
883
885
It will need to be (at least manually) tested against enabling/disabling on a live Kubelet.
884
886
885
887
Note: enabling/disabling feature gate will require cAdvisor is restarted. The most graceful way to make this happen is require the Kubelet restarts to apply these changes.
@@ -888,22 +890,17 @@ Note: enabling/disabling feature gate will require cAdvisor is restarted. The mo
888
890
889
891
_This section must be completed when targeting beta graduation to a release._
890
892
891
-
***How can a rollout fail? Can it impact already running workloads?**
892
-
Try to be as paranoid as possible - e.g., what if some components will restart
893
-
mid-rollout?
893
+
###### How can a rollout or rollback fail? Can it impact already running workloads?
894
894
895
895
If the CRI implementation doesn't support the required metrics, and cAdvisor has container metrics collection turned off,
896
896
it is possible the node comes up with no metrics about pods and containers. This should be mitigated by making sure that
897
897
the kubelet probes the CRI implementation and enables cAdvisor metrics collection even if the feature gate is on.
898
898
899
-
***What specific metrics should inform a rollback?**
899
+
###### What specific metrics should inform a rollback?
900
900
901
901
The lack of any metrics reported for pods and containers is the worst case scenerio here, and would require either a rollback or for the feature gate to be disabled.
902
902
903
-
***Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?**
904
-
Describe manual testing that was done and the outcomes.
905
-
Longer term, we may want to require automated upgrade/rollback tests, but we
906
-
are missing a bunch of machinery and tooling and can't do that now.
903
+
###### Were upgrade and rollback tested? Was the upgrade->downgrade->upgrade path tested?
907
904
908
905
The source of the metrics is a private matter between the kubelet, CRI implementation and cAdvisor. Since cAdvisor
909
906
in embedded in the kubelet, the two pieces that could move disjointly are kubelet and CRI implementation. The
@@ -912,9 +909,7 @@ words, rolling back and upgrading should have no affect--if the upgrade broke me
912
909
(and measures weren't taken to cause kubelet to fallback to cAdvisor), then a rollback (or toggling of the feature gate)
913
910
would return the metrics from cAdvisor.
914
911
915
-
***Is the rollout accompanied by any deprecations and/or removals of features, APIs,
916
-
fields of API types, flags, etc.?**
917
-
Even if applying deprecation policies, they may still surprise some users.
912
+
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
918
913
919
914
A piece of work for Beta is moving the source of the contents of `/metrics/cadvisor`. If users toggle the feature gate,
920
915
prometheus collectors will have to move the URL. However, it's an expressed intention of the implementation to have the CRI
@@ -925,97 +920,61 @@ report metrics previously reported by cAdvisor, so the contents should not chang
925
920
926
921
_This section must be completed when targeting beta graduation to a release._
927
922
928
-
***How can an operator determine if the feature is in use by workloads?**
929
-
Ideally, this should be a metric. Operations against the Kubernetes API (e.g.,
930
-
checking if there are objects with field X set) may be a last resort. Avoid
931
-
logs or events for this purpose.
923
+
###### How can an operator determine if the feature is in use by workloads?
932
924
933
925
The source of the pod and container metrics previously reported to Prometheus by `/metrics/cadvisor` is the CRI implementation, not cAdvisor.
934
926
Further, if the CRI implementation was using the old CRI stats provider, then the memory usage of the cgroup the kubelet and runtime
935
927
were in should go down--as some duplicated work should be unduplicated.
936
928
937
-
***What are the SLIs (Service Level Indicators) an operator can use to determine
938
-
the health of the service?**
929
+
Finally, the metric `kubelet_metrics_provider` will be emitted by the kubelet, with `provider` value being `cri`.
930
+
931
+
###### How can someone using this feature know that it is working for their instance?
939
932
-[x] Metrics
940
933
- Metric name:
941
-
- all pod and container level stats coming from cAdvisor `container_*`
934
+
- `kubelet_metrics_provider`
942
935
- Components exposing the metric:
943
-
-Previously cAdvisor, now CRI implementation.
936
+
-kubelet
944
937
-[ ] Other (treat as last resort)
945
938
- Details:
946
939
947
-
***What are the reasonable SLOs (Service Level Objectives) for the above SLIs?**
948
-
At a high level, this usually will be in the form of "high percentile of SLI
949
-
per day <= X". It's impossible to provide comprehensive guidance, but at the very
950
-
high level (needs more precise definitions) those may be things like:
951
-
- per-day percentage of API calls finishing with 5XX errors <= 1%
952
-
- 99% percentile over day of absolute value from (job creation time minus expected
953
-
job creation time) for cron job <= 10%
954
-
- 99,9% of /health requests per day finish with 200 code
940
+
###### What are the SLIs (Service Level Indicators) an operator can use to determine the health of the service?
955
941
956
942
- Reduction of CPU and memory usage between kubelet and CRI (if previously using CRI stats provider).
957
943
- Minimal (< 2%) of performance hit between CPU and memory between CRI and kubelet (if previously using cAdvisor stats provider).
958
944
959
-
***Are there any missing metrics that would be useful to have to improve observability
960
-
of this feature?**
961
-
Describe the metrics themselves and the reasons why they weren't added (e.g., cost,
962
-
implementation difficulties, etc.).
963
-
964
-
### Dependencies
965
-
966
-
_This section must be completed when targeting beta graduation to a release._
945
+
###### Are there any missing metrics that would be useful to have to improve observability of this feature?
967
946
968
-
***Does this feature depend on any specific services running in the cluster?**
969
-
Think about both cluster-level services (e.g. metrics-server) as well
970
-
as node-level agents (e.g. specific version of CRI). Focus on external or
971
-
optional services that are needed. For example, if this feature depends on
972
-
a cloud provider API, or upon an external software-defined storage or network
973
-
control plane.
947
+
To make clear to cluster admins when metrics are coming from CRI, rather than cadvisor, a new metric `kubelet_metrics_provider` will be used, with `provider` label either `cri` or `cadvisor`.
974
948
975
-
For each of these, fill in the following—thinking about running existing user workloads
976
-
and creating new ones, as well as about cluster-level services (e.g. DNS):
977
-
-[Dependency name]
978
-
- Usage description:
979
-
- Impact of its outage on the feature:
980
-
- Impact of its degraded performance or high-error rates on the feature:
949
+
### Dependencies
981
950
951
+
###### Does this feature depend on any specific services running in the cluster?
982
952
983
953
- CRI implementation
984
954
- Usage description:
985
955
- Impact of its outage on the feature: The feature, as well as many other pieces of Kubernetes, would not work, as the CRI implementation is vital to the creation and running of Pods.
986
956
- Impact of its degraded performance or high-error rates on the feature: All Kuberetes operations will slow down if the CRI spends too much energy in getting the stats.
957
+
- All supported CRI-O versions have this feature, but containerd must be version 2.2 or later.
987
958
988
959
989
960
### Scalability
990
961
991
-
_For alpha, this section is encouraged: reviewers should consider these questions
992
-
and attempt to answer them._
993
-
994
-
_For beta, this section is required: reviewers must answer these questions._
995
-
996
-
_For GA, this section is required: approvers should be able to confirm the
997
-
previous answers based on experience in the field._
998
-
999
-
***Will enabling / using this feature result in any new API calls?**
962
+
###### Will enabling / using this feature result in any new API calls?
1000
963
It should not.
1001
964
1002
-
***Will enabling / using this feature result in introducing new API types?**
1003
-
Describe them, providing:
1004
-
- There will be new CRI API types, described above. These are to be agreed upon by Kubelet and the CRI implementation.
965
+
###### Will enabling / using this feature result in introducing new API types?
1005
966
1006
-
***Will enabling / using this feature result in any new calls to the cloud
1007
-
provider?**
967
+
- There will be new CRI API types, described above. These are to be agreed upon by Kubelet and the CRI implementation.
968
+
969
+
###### Will enabling / using this feature result in any new calls to the cloud provider?
1008
970
- No.
1009
-
***Will enabling / using this feature result in increasing size or count of
1010
-
the existing API objects?**
1011
-
Describe them, providing:
1012
-
- There are no changes that affect objects stored in the database.
1013
-
- There are changes to the CRI API, which will have to be coordinated between CRI implementation and Kubelet.
971
+
###### Will enabling / using this feature result in increasing size or count of the existing API objects?
972
+
973
+
- There are no changes that affect objects stored in the database.
974
+
- There are changes to the CRI API, which will have to be coordinated between CRI implementation and Kubelet.
1014
975
1015
-
***Will enabling / using this feature result in increasing time taken by any
1016
-
operations covered by [existing SLIs/SLOs]?**
1017
-
Think about adding additional work or introducing new steps in between
1018
-
(e.g. need to do X to start a container), etc. Please describe the details.
976
+
###### Will enabling / using this feature result in increasing time taken by any operations covered by existing SLIs/SLOs?
977
+
1019
978
- The process of collecting and reporting the metrics should not differ too much between cAdvisor and the CRI implementation:
1020
979
- At a high level, both need to watch the changes to the stats (from cgroups, disk and network stats)
1021
980
- Once collected, the CRI implementation will need to report them (both through the CRI and eventually through the prometheus endpoint).
@@ -1024,8 +983,8 @@ operations covered by [existing SLIs/SLOs]?**
1024
983
- This may come because cAdvisor's performance has been fine-tuned, and changing the location of work may loose some optimizations.
1025
984
- However, it is explicitly stated that a requirement for transition from Alpha->Beta is little to no performance degradation.
1026
985
- The existence of the feature gate will allow users to mitigate this potential blip in performance (by not opting-in).
1027
-
***Will enabling / using this feature result in non-negligible increase of
1028
-
resource usage (CPU, RAM, disk, IO, ...) in any components?**
986
+
987
+
###### Will enabling / using this feature result in non-negligible increase of resource usage (CPU, RAM, disk, IO, ...) in any components?
1029
988
- It most likely will reduce resource utilization. Right now, there is duplicate work being done between CRI and cAdvisor.
1030
989
This will not happen anymore.
1031
990
- The CRI implementation may scrape the metrics less efficiently than cAdvisor currently does. This should be measured and evaluated as a requirement of Beta.
@@ -1049,12 +1008,14 @@ details). For now, we leave it here.
1049
1008
1050
1009
_This section must be completed when targeting beta graduation to a release._
1051
1010
1052
-
***How does this feature react if the API server and/or etcd is unavailable?**
1011
+
###### How does this feature react if the API server and/or etcd is unavailable?
1053
1012
- Should not change.
1054
-
***What are other known failure modes?**
1013
+
###### What are other known failure modes?
1055
1014
- Kubelet should fall back to using cAdvisor if errors are detected with version skew. Nothing else should be affected.
1056
1015
1057
-
***What steps should be taken if SLOs are not being met to determine the problem?**
1016
+
###### What steps should be taken if SLOs are not being met to determine the problem?
1017
+
1018
+
A cluster admin can investigate the CRI implementation, or revert the feature gate to fallback to cAdvisor.
@@ -1071,6 +1032,7 @@ _This section must be completed when targeting beta graduation to a release._
1071
1032
2022-12-09: Retarget KEP to alpha in 1.26
1072
1033
2023-05-19: KEP targeted at Beta in 1.28
1073
1034
2023-05-19: KEP retargeted to Alpha in 1.29
1035
+
2025-10-07: KEP retargeted to Beta in 1.35
1074
1036
1075
1037
## Drawbacks
1076
1038
@@ -1087,3 +1049,5 @@ Greater complexity as opposed to adding these unstructured metrics directly into
1087
1049
- However, this doesn't address the anti-pattern of having multiple parties confusingly responsible for a wide array of metrics and other issues described.
1088
1050
- Have cAdvisor implement the summary API. A cAdvisor daemonset could be a drop-in replacement for the summary API.
1089
1051
- Don't keep supporting the summary API. Replace it with a "better" format, like prometheus. Or help users migrate to equivalent APIs that container runtimes already expose for monitoring.
0 commit comments