Purser Plugin Usage
December 14, 2018 ยท View on GitHub
Once installed, Purser is ready for use right away. You can query using native Kubernetes grouping artifacts.
Purser supports the following list of commands.
# query cluster visibility in terms of savings and summary for the application.
kubectl plugin purser get [summary|savings]
# query resources filtered by associated namespace, labels and groups.
kubectl plugin purser get resources group <group-name>
# query cost filtered by associated labels, pods and node.
kubectl plugin purser get cost label <key=val>
kubectl plugin purser get cost pod <pod name>
kubectl plugin purser get cost node all
# configure user-costs for the choice of deployment.
kubectl plugin purser [set|get] user-costs
Use flag --kubeconfig=<absolute path to config> if your cluster configuration is not at the default location.
Examples
-
Get Cluster Summary
$ kubectl plugin purser get summary Cluster Summary Compute: Node count: 57 Cost: 3015.48$ Total Capacity: Cpu(vCPU): 456 Memory(GB): 1770.50 Provisioned Resources: Cpu Request(vCPU): 319 Memory Request(GB): 1032.67 Storage: Persistent Volume count: 151 Capacity(GB): 9297.00 Cost: 4124.79$ PV Claim count: 108 PV Claim Capacity(GB): 8867.00 Cost: Compute cost: 3015.48$ Storage cost: 4124.79$ Total cost: 7140.27$ -
Get Cost Of All Nodes
kubectl purser get cost node all -
Get Savings
$ kubectl plugin purser get savings Savings Summary Storage: Unused Volumes: 43 Unused Capacity(GB): 430.00 Month To Date Savings: 186.33$ Projected Monthly Savings: 1066.40$
Next, define higher level groupings to define your business, logical or application constructs.
Defining Custom Groups
Refer doc for custom group installation and usage.