Warning
This page was translated from the original Japanese version by PLaMo Translate. The Japanese version is authoritative; the English translation may contain inaccuracies.
Managing Workload Costs
Warning
The workload cost management feature is currently in preview status. Please note that specifications may change without prior notice, so please use this functionality with caution.
This page explains the features for managing costs associated with your workloads.
Configuring Cost Tags
Warning
The cost aggregation functionality using cost tags will be added at a later date.
For Pod and PersistentVolumeClaim resources created in PFCP’s Kubernetes cluster, you can configure metadata for cost management called “cost tags.” By setting cost tags, you can aggregate cluster usage metrics by each cost tag category.
Cost tags are configured as dedicated labels on resources, with labels allowing up to 16 characters of arbitrary text. If more than 16 characters are specified, only the first 16 characters will be recorded.
cost.preferred.jp/tag
The following examples demonstrate how to configure cost tags for Pod and PersistentVolumeClaim resources.
apiVersion: v1
kind: Pod
metadata:
name: jupyter-notebook
labels:
# Cost tag configuration
cost.preferred.jp/tag: dev-research
spec:
# ...
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: jupyter-notebook-data
labels:
# Cost tag configuration
cost.preferred.jp/tag: dev-research
spec:
# ...
Setting Default Cost Tags for Sub-Namespaces
Cost tags can be configured not only for resources but also for sub-namespaces. When cost tags are set for a sub-namespace, their values will automatically be applied to all Pod and PersistentVolumeClaim resources created under that namespace. Configuring cost tags for sub-namespaces requires organizational administrator privileges.
For example, to configure cost tags for a sub-namespace org-<organization-name>--foo, you would use the following command:
$ kubectl edit subnamespaceanchor org-<organization-name>--foo -n org-<organization-name>
- spec: {}
+ spec:
+ labels:
+ - key: cost.preferred.jp/tag
+ value: dev
If both cost tags are set for the sub-namespace and individual resources, the cost tag value specified for the resource will take precedence. For instance, if the cost tags are configured as shown below, the Pod resource will be processed with the tag dev-research.
- Cost tag value for the sub-namespace:
dev - Cost tag value for the Pod resource:
dev-research