sureshanaparti commented on code in PR #9102:
URL: https://github.com/apache/cloudstack/pull/9102#discussion_r1969336094


##########
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterStartWorker.java:
##########
@@ -263,11 +333,84 @@ private String 
getKubernetesAdditionalControlNodeConfig(final String joinIp, fin
         return k8sControlNodeConfig;
     }
 
-    private UserVm createKubernetesAdditionalControlNode(final String joinIp, 
final int additionalControlNodeInstance) throws ManagementServerException,
+    private String getInitialEtcdClusterDetails(List<String> ipAddresses, 
List<String> hostnames) {
+        String initialCluster = "%s=http://%s:2380";;
+        StringBuilder clusterInfo = new StringBuilder();
+            for (int i = 0; i < ipAddresses.size(); i++) {
+                clusterInfo.append(String.format(initialCluster, 
hostnames.get(i), ipAddresses.get(i)));
+                if (i < ipAddresses.size()-1) {
+                    clusterInfo.append(",");
+                }
+            }
+            return clusterInfo.toString();
+    }
+
+    /**
+     *
+     * @param ipAddresses list of etcd node guest IPs
+     * @return a formatted list of etcd endpoints adhering to YAML syntax
+     */
+    private String getEtcdEndpointList(List<Network.IpAddresses> ipAddresses) {
+        StringBuilder endpoints = new StringBuilder();
+        for (int i = 0; i < ipAddresses.size(); i++) {
+            endpoints.append(String.format("- http://%s:2379";, 
ipAddresses.get(i).getIp4Address()));

Review Comment:
   use _ETCD_NODE_CLIENT_REQUEST_PORT_ const defined in 
KubernetesClusterActionWorker.java (or keep them in some common kubernetes 
utils)



-- 
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-unsubscr...@cloudstack.apache.org

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

Reply via email to