did not find podmetrics resource # oc api-resources | grep podmetrics no result # oc api-resources | grep monitoring.coreos.com alertmanagers monitoring.coreos.com true Alertmanager podmonitors monitoring.coreos.com true PodMonitor probes monitoring.coreos.com true Probe prometheuses monitoring.coreos.com true Prometheus prometheusrules monitoring.coreos.com true PrometheusRule servicemonitors monitoring.coreos.com true ServiceMonitor thanosrulers monitoring.coreos.com true ThanosRuler
tested with 4.7.0-0.nightly-2020-11-16-070925, still reproduced # oc get clusterversion NAME VERSION AVAILABLE PROGRESSING SINCE STATUS version 4.7.0-0.nightly-2020-11-16-070925 True False 18h Cluster version is 4.7.0-0.nightly-2020-11-16-070925 # oc api-resources --api-group=metrics.k8s.io NAME SHORTNAMES APIGROUP NAMESPACED KIND nodes metrics.k8s.io false NodeMetrics pods metrics.k8s.io true PodMetrics # oc explain pods --api-version=metrics.k8s.io error: couldn't find resource for "/metrics.k8s.io, Kind=Pod" # oc explain PodMetrics error: couldn't find resource for "metrics.k8s.io/v1beta1, Kind=PodMetrics"
We recently fixed OpenAPI for custom and external metrics, but it's indeed still missing for resource metrics. That being said, we have higher high priority bugzillas to tackle this sprint and won't be able to allocate much time to this ticket. For now I opened this upstream issue: https://github.com/kubernetes-sigs/prometheus-adapter/issues/369
All the necessary upstream PRs are merged and it will be rolled out as part of next prometheus-adapter. Hence closing this bug.
checked with 4.9.0-0.nightly-2021-08-22-070405, prometheus-operator version is 0.9.0, but no explanation for metadata and window see the description for other resources, example # oc explain configmaps ... metadata <Object> Standard object's metadata. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#metadata ... # oc api-resources --api-group=metrics.k8s.io NAME SHORTNAMES APIVERSION NAMESPACED KIND nodes metrics.k8s.io/v1beta1 false NodeMetrics pods metrics.k8s.io/v1beta1 true PodMetrics # oc explain PodMetrics KIND: PodMetrics VERSION: metrics.k8s.io/v1beta1 DESCRIPTION: PodMetrics sets resource usage metrics of a pod. FIELDS: apiVersion <string> APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources containers <[]Object> -required- Metrics for all containers are collected within the same time window. kind <string> Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds metadata <Object> timestamp <string> -required- The following fields define time interval from which metrics were collected from the interval [Timestamp-Window, Timestamp]. window <string> -required-
(In reply to Junqi Zhao from comment #19) > checked with 4.9.0-0.nightly-2021-08-22-070405, prometheus-operator version > is 0.9.0 typo, should be prometheus-adapter version is 0.9.0
(In reply to Junqi Zhao from comment #19) > > metadata <Object> > Agreed, it should be fixed in k8s upstream[1]., but I don't think we should hold this bug until we fix it in k8s upstream. [1] https://github.com/kubernetes/kubernetes/blob/master/staging/src/k8s.io/metrics/pkg/apis/metrics/v1beta1/types.go#L33 > timestamp <string> -required- > The following fields define time interval from which metrics were > collected > from the interval [Timestamp-Window, Timestamp]. > > window <string> -required- Description for "timestamp" field describes about "window" as well. So the description should be collectively interpreted.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Moderate: OpenShift Container Platform 4.9.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2021:3759