This patch adds new columns to kubernetes models so that we allow specific compute and storage sizes on Kubernetes VMs. This change applies to both KubernetesCluster model for control plane nodes and KubernetesNodepool model for worker nodes. For both models, the compute specification is not null and the default will be set in the nexus. The theory is that, kubernetes community usually are not interested in the actual size of the nodes, and slap cluster autoscaler to handle the number of nodes. Even less important, is the storage size of the nodes, so that's left as null-able. In clover, we usually pick the lowest available storage size of the selected compute size by default, so we can implement the same logic for k8s nodes as well.
16 lines
453 B
Ruby
16 lines
453 B
Ruby
# frozen_string_literal: true
|
|
|
|
Sequel.migration do
|
|
change do
|
|
alter_table(:kubernetes_nodepool) do
|
|
add_column(:target_node_size, :text, collate: '"C"', null: false)
|
|
add_column(:target_node_storage_size_gib, :bigint, null: true)
|
|
end
|
|
|
|
alter_table(:kubernetes_cluster) do
|
|
add_column(:target_node_size, :text, collate: '"C"', null: false)
|
|
add_column(:target_node_storage_size_gib, :bigint, null: true)
|
|
end
|
|
end
|
|
end
|