Viewing Usage Data
Page last updated:
Warning: VMware Enterprise PKS v1.6 is no longer supported because it has reached the End of General Support (EOGS) phase as defined by the Support Lifecycle Policy. To stay up to date with the latest software and security updates, upgrade to a supported version.
This topic describes how operators can view pod usage information from their VMware Enterprise PKS deployment. Operators can use this data to calculate billed usage, perform customer chargebacks, and generate usage reports.
The Enterprise PKS database stores the following pod usage data:
- Watermark: the number of pods that run at a single time.
- Consumption: the memory and CPU usage of pods.
About Usage Data
This section describes the usage data records you can view in the Enterprise PKS billing database. The agent pod collects usage data for the deployment and sends the data to the Enterprise PKS aggregator agent. The aggregator agent then stores the data in the Enterprise PKS database. You can access the Enterprise PKS database from the PKS VM.
The following is an example of a pod usage data table:
+--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ | id | first_seen | last_seen | namespace | name | service_instance_id | +--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ | 12a345b6-7890-13c4-de5f-67890a123b4c | 2019-01-07 13:57:03 | 2019-01-08 11:34:33 | my-namespace | my-pod | service-instance_a12b3456-78cd-90e1-fa2b-3456c789def0 | | ac203f27-104b-11e9-b520-42010a000b0a | 2019-01-04 18:09:04 | 2019-01-07 14:09:03 | my-namespace | my-other-pod | service-instance_a12b3456-78cd-90e1-fa2b-3456c789def0 | +--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ 2 rows in set (0.00 sec)
The following table describes the fields that appear in the pod usage data table:
Field Name | Description |
---|---|
id | Unique record identifier |
first_seen | The date when the pod was first recorded to the database |
last_seen | The date when the pod was most recently recorded to the database |
namespace | The namespace where the pod is deployed |
name | The name of the pod |
service_instance_id | The cluster where the pod is deployed |
View Usage Data
To view the pod usage data table, follow the steps below:
- In a browser, navigate to Ops Manager.
- Click the Enterprise PKS tile.
- Select the Status tab. Record the IP address that appears in the IPS column.
- Select the Credentials tab.
- Click the credential link next to Cf Mysql Billing Db Password. Record the billing database password that appears.
- Open a terminal window from any system inside your PKS network. If your system is outside the network, you can SSH into the PKS API VM. For more information, see SSH into the PKS API VM in Using BOSH Diagnostic Commands in Enterprise PKS.
On the command line, log in to the billing database in one of the following ways:
Run the following command to connect by IP address from inside the PKS API VM:
mysql -h 127.0.0.1 --port 13306 -u billing -p billing
Run the following command to connect using the MySQL socket file from inside the PKS API VM:
mysql --socket=/var/vcap/sys/run/pxc-mysql/mysqld.sock -u billing -p billing
Run the following command to connect by IP address from outside the PKS API VM:
mysql -h IP-ADDRESS --port 13306 -u billing -p billing
Where
IP-ADDRESS
is the IP address that you located in a previous step.
When prompted by the command line, enter the billing database password you recorded in a previous step.
View the tables in the billing database by running
show tables;
.
For example:MariaDB [billing]> show tables; +-------------------+ | Tables_in_billing | +-------------------+ | pods | | schema_migrations | +-------------------+ 2 rows in set (0.00 sec)
View the raw pod usage data in the
pods
table by runningselect * from pods;
.
For example:MariaDB [billing]> select * from pods; +--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ | id | first_seen | last_seen | namespace | name | service_instance_id | +--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ | 12a345b6-7890-13c4-de5f-67890a123b4c | 2019-01-07 13:57:03 | 2019-01-08 11:34:33 | my-namespace | my-pod | service-instance_a12b3456-78cd-90e1-fa2b-3456c789def0 | | ac203f27-104b-11e9-b520-42010a000b0a | 2019-01-04 18:09:04 | 2019-01-07 14:09:03 | my-namespace | my-other-pod | service-instance_a12b3456-78cd-90e1-fa2b-3456c789def0 | +--------------------------------------+---------------------+---------------------+--------------+--------------+-------------------------------------------------------+ 2 rows in set (0.00 sec)
(Optional) For information about running additional queries against the billing database, see the following articles in the Pivotal Knowledge Base:
Please send any feedback you have to pks-feedback@pivotal.io.