nvazquez commented on code in PR #12386:
URL: https://github.com/apache/cloudstack/pull/12386#discussion_r2720878588
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -861,24 +861,38 @@ public KubernetesClusterResponse
createKubernetesClusterResponse(long kubernetes
List<KubernetesUserVmResponse> vmResponses = new ArrayList<>();
List<KubernetesClusterVmMapVO> vmList =
kubernetesClusterVmMapDao.listByClusterId(kubernetesCluster.getId());
- ResponseView respView = ResponseView.Restricted;
+ ResponseView userVmResponseView = ResponseView.Restricted;
Review Comment:
Cool +1
##########
engine/schema/src/main/resources/META-INF/db/schema-42210to42300.sql:
##########
@@ -24,6 +24,19 @@
UPDATE `cloud`.`configuration` SET value='random' WHERE name IN
('vm.allocation.algorithm', 'volume.allocation.algorithm') AND
value='userconcentratedpod_random';
UPDATE `cloud`.`configuration` SET value='firstfit' WHERE name IN
('vm.allocation.algorithm', 'volume.allocation.algorithm') AND
value='userconcentratedpod_firstfit';
+-- Create kubernetes_cluster_affinity_group_map table for CKS per-node-type
affinity groups
+CREATE TABLE IF NOT EXISTS `cloud`.`kubernetes_cluster_affinity_group_map` (
+ `id` bigint unsigned NOT NULL AUTO_INCREMENT,
+ `cluster_id` bigint unsigned NOT NULL COMMENT 'kubernetes cluster id',
+ `node_type` varchar(32) NOT NULL COMMENT 'CONTROL, WORKER, or ETCD',
+ `affinity_group_id` bigint unsigned NOT NULL COMMENT 'affinity group id',
+ PRIMARY KEY (`id`),
+ CONSTRAINT `fk_kubernetes_cluster_ag_map__cluster_id` FOREIGN KEY
(`cluster_id`) REFERENCES `kubernetes_cluster`(`id`) ON DELETE CASCADE,
+ CONSTRAINT `fk_kubernetes_cluster_ag_map__ag_id` FOREIGN KEY
(`affinity_group_id`) REFERENCES `affinity_group`(`id`) ON DELETE CASCADE,
+ INDEX `i_kubernetes_cluster_ag_map__cluster_id`(`cluster_id`),
+ INDEX `i_kubernetes_cluster_ag_map__ag_id`(`affinity_group_id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Review Comment:
Can we use CHARSET=utf instead, to match the charset across other the sql
files?
##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java:
##########
@@ -2348,6 +2417,83 @@ private List<Long> validateNodes(List<Long> nodeIds,
Long networkId, String netw
return validNodeIds;
}
+ protected void validateNodeAffinityGroups(List<Long> nodeIds,
KubernetesCluster cluster) {
Review Comment:
This method seems a bit complex, can it be split into submethods?
--
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]