ubicloud/model/kubernetes
Eren Başak 0d61f0359b Update billing after kubernetes nodepool is scaled
KubernetesClusterNexus#create_billing_records is replaced with
update_billing_records. This method compares the desired list and
existing list of billing records and performs add/remove to make
the desired list the reality with minimal changes.

The removal of billing records are done on the later-created ones,
in order to create less confusion around the final bill. If a user
creates a 3-node cluster, then scales it to 5 nodes to reduce it back
to 3 nodes, at the end of the month, the user will see 3 long and 2 short
nodes in the billing items.

The billing update is done right at the beginning of node removal and
at the end of node addition process, skewing the bill in favor of the user.
The update semaphore is raised right after the node removal begins, and
the updating logic eliminates the nodes flagged for retirement
from the equation.
2025-09-19 09:13:43 +03:00
..
kubernetes_cluster.rb Update billing after kubernetes nodepool is scaled 2025-09-19 09:13:43 +03:00
kubernetes_node.rb Refactor KubernetesNode billing records 2025-09-19 09:13:43 +03:00
kubernetes_nodepool.rb Scale node pool count in KubernetesNodepools 2025-09-01 13:15:05 +02:00