12.4. Knative Serving 的 metering 报告
您可以通过创建 Report
资源来针对 Knative Serving 运行 metering 报告。在您运行报告前,您必须修改 Report
资源中的输入参数,以指定报告周期的开始和结束日期。
yaml 文件
apiVersion: metering.openshift.io/v1 kind: Report metadata: name: knative-service-cpu-usage spec: reportingStart: '2019-06-01T00:00:00Z' 1 reportingEnd: '2019-06-30T23:59:59Z' 2 query: knative-service-cpu-usage 3 runImmediately: true
12.4.1. 运行 metering 报告
输入以下命令运行报告:
$ oc apply -f <report-name>.yml
然后您可以输入以下命令来检查报告:
$ oc get report
NAME QUERY SCHEDULE RUNNING FAILED LAST REPORT TIME AGE knative-service-cpu-usage knative-service-cpu-usage Finished 2019-06-30T23:59:59Z 10h