Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ enum Event {
AddNodeRequested,
RemoveNodeRequested,
UpgradeRequested,
UpdateRequested,
OperationSucceeded,
OperationFailed,
CreateFailed,
Expand All @@ -62,6 +63,7 @@ enum State {
Scaling("Transient state in which resources are either getting scaled up/down"),
ScalingStoppedCluster("Transient state in which the service offerings of stopped clusters are getting scaled"),
Upgrading("Transient state in which cluster is getting upgraded"),
Updating("Transient state in which the nodes of the cluster are restarted with their stored settings, a few at a time"),
Importing("Transient state in which additional nodes are added as worker nodes to a cluster"),
RemovingNodes("Transient state in which additional nodes are removed from a cluster"),
Alert("State to represent Kubernetes clusters which are not in expected desired state (operationally in active control place, stopped cluster VM's etc)."),
Expand All @@ -88,6 +90,7 @@ enum State {
s_fsm.addTransition(State.Stopping, Event.OperationFailed, State.Alert);

s_fsm.addTransition(State.Stopped, Event.StartRequested, State.Starting);
s_fsm.addTransition(State.Alert, Event.StartRequested, State.Starting);
s_fsm.addTransition(State.Stopped, Event.OperationSucceeded, State.Stopped);
s_fsm.addTransition(State.Running, Event.OperationSucceeded, State.Running);

Expand All @@ -103,9 +106,16 @@ enum State {
s_fsm.addTransition(State.ScalingStoppedCluster, Event.OperationFailed, State.Alert);

s_fsm.addTransition(State.Running, Event.UpgradeRequested, State.Upgrading);
s_fsm.addTransition(State.Alert, Event.UpgradeRequested, State.Upgrading);
s_fsm.addTransition(State.Upgrading, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.Upgrading, Event.OperationFailed, State.Alert);

// a rollout ends in Running if the cluster is healthy, and in Alert otherwise
s_fsm.addTransition(State.Running, Event.UpdateRequested, State.Updating);
s_fsm.addTransition(State.Alert, Event.UpdateRequested, State.Updating);
s_fsm.addTransition(State.Updating, Event.OperationSucceeded, State.Running);
s_fsm.addTransition(State.Updating, Event.OperationFailed, State.Alert);

s_fsm.addTransition(State.Running, Event.AddNodeRequested, State.Importing);
s_fsm.addTransition(State.Alert, Event.AddNodeRequested, State.Importing);
s_fsm.addTransition(State.Importing, Event.OperationSucceeded, State.Running);
Expand Down Expand Up @@ -153,6 +163,9 @@ enum State {
long getCores();
long getMemory();
long getNodeRootDiskSize();
Long getControlNodeRootDiskSize();
Long getWorkerNodeRootDiskSize();
Long getEtcdNodeRootDiskSize();
String getEndpoint();
boolean isCheckForGc();
@Override
Expand Down
10 changes: 10 additions & 0 deletions api/src/main/java/org/apache/cloudstack/api/ApiConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -1324,6 +1324,16 @@ public class ApiConstants {
public static final String NODE_TYPE_OFFERING_MAP = "nodeofferings";
public static final String NODE_TYPE_TEMPLATE_MAP = "nodetemplates";
public static final String NODE_TYPE_AFFINITY_GROUP_MAP = "nodeaffinitygroups";
public static final String NODE_TYPE_ROOT_DISK_SIZE_MAP = "noderootdisksizes";
public static final String CONTROL_ROOT_DISK_SIZE = "controlrootdisksize";
public static final String WORKER_ROOT_DISK_SIZE = "workerrootdisksize";
public static final String ETCD_ROOT_DISK_SIZE = "etcdrootdisksize";
public static final String CONTROL_NODES_OUT_OF_DATE = "controlnodesoutofdate";
public static final String WORKER_NODES_OUT_OF_DATE = "workernodesoutofdate";
public static final String ETCD_NODES_OUT_OF_DATE = "etcdnodesoutofdate";
public static final String ROLLOUT = "rollout";
public static final String CANCEL_ROLLOUT = "cancelrollout";
public static final String MAX_UNAVAILABLE = "maxunavailable";
public static final String CONTROL_AFFINITY_GROUP_IDS = "controlaffinitygroupids";
public static final String CONTROL_AFFINITY_GROUP_NAMES = "controlaffinitygroupnames";
public static final String WORKER_AFFINITY_GROUP_IDS = "workeraffinitygroupids";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,3 +239,8 @@ CREATE TABLE IF NOT EXISTS `cloud`.`instance_boot_group_details` (
PRIMARY KEY (`id`),
CONSTRAINT `fk_instance_boot_group_details__group_id` FOREIGN KEY (`boot_group_id`) REFERENCES `instance_boot_group` (`id`) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

-- CKS: root disk size per node type. When not set, the cluster wide node_root_disk_size is used, as before.
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster', 'control_node_root_disk_size', 'bigint unsigned DEFAULT NULL COMMENT "root disk size in GB of the control nodes, node_root_disk_size when not set"');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster', 'worker_node_root_disk_size', 'bigint unsigned DEFAULT NULL COMMENT "root disk size in GB of the worker nodes, node_root_disk_size when not set"');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster', 'etcd_node_root_disk_size', 'bigint unsigned DEFAULT NULL COMMENT "root disk size in GB of the etcd nodes, the size of the template when not set"');
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,5 @@ public class KubernetesClusterEventTypes {
public static final String EVENT_KUBERNETES_CLUSTER_NODES_ADD = "KUBERNETES.CLUSTER.NODES.ADD";
public static final String EVENT_KUBERNETES_CLUSTER_NODES_REMOVE = "KUBERNETES.CLUSTER.NODES.REMOVE";
public static final String EVENT_KUBERNETES_CLUSTER_AFFINITY_UPDATE = "KUBERNETES.CLUSTER.AFFINITY.UPDATE";
public static final String EVENT_KUBERNETES_CLUSTER_UPDATE = "KUBERNETES.CLUSTER.UPDATE";
}
Loading
Loading