This documentation is for a release that is no longer maintained
See documentation for the latest supported version 3 or the latest supported version 4.이 콘텐츠는 선택한 언어로 제공되지 않습니다.
Chapter 12. Using metering with OpenShift Serverless
As a cluster administrator, you can use metering to analyze what is happening in your OpenShift Serverless cluster.
For more information about metering on OpenShift Container Platform, see About metering.
12.1. Installing metering 링크 복사링크가 클립보드에 복사되었습니다!
For information about installing metering on OpenShift Container Platform, see Installing Metering.
12.2. Datasources for Knative Serving metering 링크 복사링크가 클립보드에 복사되었습니다!
The following ReportDataSources are examples of how Knative Serving can be used with OpenShift Container Platform metering.
12.2.1. Datasource for CPU usage in Knative Serving 링크 복사링크가 클립보드에 복사되었습니다!
This datasource provides the accumulated CPU seconds used per Knative service over the report time period.
Example YAML file
12.2.2. Datasource for memory usage in Knative Serving 링크 복사링크가 클립보드에 복사되었습니다!
This datasource provides the average memory consumption per Knative service over the report time period.
Example YAML file
12.2.3. Applying Datasources for Knative Serving metering 링크 복사링크가 클립보드에 복사되었습니다!
-
Apply the
ReportDataSources:
oc apply -f <datasource_name>
$ oc apply -f <datasource_name>
12.3. Queries for Knative Serving metering 링크 복사링크가 클립보드에 복사되었습니다!
The following ReportQuery resources reference the example DataSources provided.
12.3.1. Query for CPU usage in Knative Serving 링크 복사링크가 클립보드에 복사되었습니다!
YAML file
12.3.2. Query for memory usage in Knative Serving 링크 복사링크가 클립보드에 복사되었습니다!
YAML file
12.3.3. Applying Queries for Knative Serving metering 링크 복사링크가 클립보드에 복사되었습니다!
Apply the
ReportQueryby entering the following command:oc apply -f <query-name>.yaml
$ oc apply -f <query-name>.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example command
oc apply -f knative-service-memory-usage.yaml
$ oc apply -f knative-service-memory-usage.yamlCopy to Clipboard Copied! Toggle word wrap Toggle overflow
12.4. Metering reports for Knative Serving 링크 복사링크가 클립보드에 복사되었습니다!
You can run metering reports against Knative Serving by creating Report resources. Before you run a report, you must modify the input parameter within the Report resource to specify the start and end dates of the reporting period.
YAML file
12.4.1. Running a metering report 링크 복사링크가 클립보드에 복사되었습니다!
Run the report by entering the following command:
oc apply -f <report-name>.yml
$ oc apply -f <report-name>.ymlCopy to Clipboard Copied! Toggle word wrap Toggle overflow You can then check the report by entering the following command:
oc get report
$ oc get reportCopy to Clipboard Copied! Toggle word wrap Toggle overflow Example output
NAME QUERY SCHEDULE RUNNING FAILED LAST REPORT TIME AGE knative-service-cpu-usage knative-service-cpu-usage Finished 2019-06-30T23:59:59Z 10h
NAME QUERY SCHEDULE RUNNING FAILED LAST REPORT TIME AGE knative-service-cpu-usage knative-service-cpu-usage Finished 2019-06-30T23:59:59Z 10hCopy to Clipboard Copied! Toggle word wrap Toggle overflow