You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2022/03/25 06:26:58 UTC

[GitHub] [cloudstack] Pearl1594 commented on a change in pull request #6132: CKS: Support deployment of CKS clusters on Advanced zones with security groups

Pearl1594 commented on a change in pull request #6132:
URL: https://github.com/apache/cloudstack/pull/6132#discussion_r834985801



##########
File path: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java
##########
@@ -1035,17 +1043,34 @@ public KubernetesCluster createKubernetesCluster(CreateKubernetesClusterCmd cmd)
             logAndThrow(Level.ERROR, String.format("Creating Kubernetes cluster failed due to error while finding suitable deployment plan for cluster in zone : %s", zone.getName()));
         }
 
+        SecurityGroupVO securityGroupVO = null;
+        if (zone.isSecurityGroupEnabled()) {
+            securityGroupVO = securityGroupManager.createSecurityGroup("CKSSecurityGroup", "Security group for CKS nodes", owner.getDomainId(), owner.getId(), owner.getAccountName());
+            if (securityGroupVO == null) {
+                throw new CloudRuntimeException("Failed to create security group");
+            }
+            List<String> cirdList = new ArrayList<>();
+            cirdList.add(NetUtils.ALL_IP4_CIDRS);
+            securityGroupService.authorizeSecurityGroupRule(securityGroupVO.getId(), NetUtils.ALL_PROTO, null, null, null, null, cirdList, null, SecurityRule.SecurityRuleType.IngressRule);

Review comment:
       Thanks @weizhouapache -  I was going to ask for advice on how open should the security group rules be - I'll make the necessary changes. Thanks 




-- 
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: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org