sureshanaparti commented on code in PR #9102:
URL: https://github.com/apache/cloudstack/pull/9102#discussion_r2137424051
##########
engine/schema/src/main/resources/META-INF/db/schema-42010to42100.sql:
##########
@@ -34,10 +34,47 @@ INSERT INTO `cloud`.`role_permissions` (uuid, role_id,
rule, permission, sort_or
SELECT uuid(), role_id, 'quotaCreditsList', permission, sort_order
FROM `cloud`.`role_permissions` rp
WHERE rp.rule = 'quotaStatement'
-AND NOT EXISTS(SELECT 1 FROM cloud.role_permissions rp_ WHERE rp.role_id =
rp_.role_id AND rp_.rule = 'quotaCreditsList');
+ AND NOT EXISTS(SELECT 1 FROM cloud.role_permissions rp_ WHERE rp.role_id =
rp_.role_id AND rp_.rule = 'quotaCreditsList');
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.host', 'last_mgmt_server_id',
'bigint unsigned DEFAULT NULL COMMENT "last management server this host is
connected to" AFTER `mgmt_server_id`');
+-----------------------------------------------------------
+-- CKS Enhancements:
+-----------------------------------------------------------
+-- Add for_cks column to the vm_template table
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.vm_template','for_cks', 'int(1)
unsigned DEFAULT "0" COMMENT "if true, the template can be used for CKS cluster
deployment"');
+
+-- Add support for different node types service offerings on CKS clusters
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','control_service_offering_id',
'bigint unsigned COMMENT "service offering ID for Control Node(s)"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','worker_service_offering_id',
'bigint unsigned COMMENT "service offering ID for Worker Node(s)"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','etcd_service_offering_id',
'bigint unsigned COMMENT "service offering ID for etcd Nodes"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','etcd_node_count',
'bigint unsigned COMMENT "number of etcd nodes to be deployed for the
Kubernetes cluster"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','control_template_id',
'bigint unsigned COMMENT "template id to be used for Control Node(s)"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','worker_template_id',
'bigint unsigned COMMENT "template id to be used for Worker Node(s)"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','etcd_template_id',
'bigint unsigned COMMENT "template id to be used for etcd Nodes"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','cni_config_id',
'bigint unsigned COMMENT "userdata id representing the associated cni
configuration"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster','cni_config_details',
'varchar(4096) DEFAULT NULL COMMENT "userdata details representing the values
required for the cni configuration associated"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster_vm_map','etcd_node',
'tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT "indicates if the VM is an etcd
node"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster_vm_map','external_node',
'tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT "indicates if the node was
imported into the Kubernetes cluster"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster_vm_map','manual_upgrade',
'tinyint(1) unsigned NOT NULL DEFAULT 0 COMMENT "indicates if the node is
marked for manual upgrade and excluded from the Kubernetes cluster upgrade
operation"');
+CALL
`cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.kubernetes_cluster_vm_map','kubernetes_node_version',
'varchar(40) COMMENT "version of k8s the cluster node is on"');
+
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__control_service_offering_id` FOREIGN KEY
`fk_cluster__control_service_offering_id`(`control_service_offering_id`)
REFERENCES `service_offering`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__worker_service_offering_id` FOREIGN KEY
`fk_cluster__worker_service_offering_id`(`worker_service_offering_id`)
REFERENCES `service_offering`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__etcd_service_offering_id` FOREIGN KEY
`fk_cluster__etcd_service_offering_id`(`etcd_service_offering_id`) REFERENCES
`service_offering`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__control_template_id` FOREIGN KEY
`fk_cluster__control_template_id`(`control_template_id`) REFERENCES
`vm_template`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__worker_template_id` FOREIGN KEY
`fk_cluster__worker_template_id`(`worker_template_id`) REFERENCES
`vm_template`(`id`) ON DELETE CASCADE;
+ALTER TABLE `cloud`.`kubernetes_cluster` ADD CONSTRAINT
`fk_cluster__etcd_template_id` FOREIGN KEY
`fk_cluster__etcd_template_id`(`etcd_template_id`) REFERENCES
`vm_template`(`id`) ON DELETE CASCADE;
+
+-- Add for_cks column to the user_data table to represent CNI Configuration
stored as userdata
+CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data','for_cks', 'int(1)
unsigned DEFAULT "0" COMMENT "if true, the userdata represent CNI configuration
meant for CKS use only"');
Review Comment:
```suggestion
CALL `cloud`.`IDEMPOTENT_ADD_COLUMN`('cloud.user_data','for_cks', 'int(1)
unsigned DEFAULT "0" COMMENT "if true, the user data represent CNI
configuration meant for CKS use only"');
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]