@@ -756,6 +756,7 @@ private void handleK8sAutoscaling(DeploymentHistory deployment, ApplicationStatu
756756 log .info ("Redeployment completed for event: {}" , latestPendingEvent .getId ());
757757
758758 // 스케일 아웃 완료 알람 전송
759+ log .info ("===>>>> send alert message for scale out is completed ==" );
759760 sendScaleOutCompletedAlert (deployment , targetNodeCount );
760761 } catch (Exception e ) {
761762 log .error ("Error redeploying to new nodes: {}" , e .getMessage (), e );
@@ -899,12 +900,17 @@ private int getCurrentDesiredNodeSize(DeploymentHistory deployment, KubernetesCl
899900 K8sClusterDto clusterInfo = cbtumblebugRestApi .getK8sClusterByName (
900901 deployment .getNamespace (), deployment .getClusterName ());
901902
902- if (clusterInfo != null && clusterInfo .getCspViewK8sClusterDetail () != null ) {
903- List <K8sClusterDto .NodeGroup > nodeGroupList = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
904-
903+ if (clusterInfo != null ) {
904+ List <K8sClusterDto .NodeGroup > nodeGroupList = null ;
905+ if (clusterInfo .getSpiderViewK8sClusterDetail () != null ) {
906+ nodeGroupList = clusterInfo .getSpiderViewK8sClusterDetail ().getNodeGroupList ();
907+ } else if (clusterInfo .getCspViewK8sClusterDetail () != null ) {
908+ nodeGroupList = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
909+ }
910+
905911 if (nodeGroupList != null && deployment .getNodeGroupName () != null ) {
906912 for (K8sClusterDto .NodeGroup nodeGroup : nodeGroupList ) {
907- if (nodeGroup .getIid () != null &&
913+ if (nodeGroup .getIid () != null &&
908914 nodeGroup .getIid ().getNameId () != null &&
909915 deployment .getNodeGroupName ().equals (nodeGroup .getIid ().getNameId ())) {
910916 log .info ("Current desired node size from cluster info: {}" , nodeGroup .getDesiredNodeSize ());
@@ -1563,15 +1569,20 @@ private int getCurrentNodeCountFromCluster(String namespace, String clusterName,
15631569
15641570 log .info ("Cluster info retrieved successfully: {}" , clusterInfo .getName ());
15651571
1566- if (clusterInfo .getCspViewK8sClusterDetail () == null ) {
1567- log .error ("CspViewK8sClusterDetail is null for cluster: {}" , clusterName );
1572+ if (clusterInfo .getSpiderViewK8sClusterDetail () == null && clusterInfo . getCspViewK8sClusterDetail () == null ) {
1573+ log .error ("SpiderViewK8sClusterDetail and CspViewK8sClusterDetail are null for cluster: {}" , clusterName );
15681574 log .warn ("Will use default node count: {}" , defaultNodeCount );
15691575 return defaultNodeCount ;
15701576 }
15711577
15721578 log .info ("CspViewK8sClusterDetail retrieved successfully" );
15731579
1574- List <K8sClusterDto .NodeGroup > nodeGroups = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
1580+ List <K8sClusterDto .NodeGroup > nodeGroups = null ;
1581+ if (clusterInfo .getSpiderViewK8sClusterDetail () != null ) {
1582+ nodeGroups = clusterInfo .getSpiderViewK8sClusterDetail ().getNodeGroupList ();
1583+ } else if (clusterInfo .getCspViewK8sClusterDetail () != null ) {
1584+ nodeGroups = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
1585+ }
15751586
15761587 log .info ("Node groups found: {}" , nodeGroups != null ? nodeGroups .size () : 0 );
15771588
@@ -1628,10 +1639,15 @@ public List<String> getNewlyCreatedNodes(ScalingEvent event, KubernetesClient cl
16281639 try {
16291640 K8sClusterDto clusterInfo = cbtumblebugRestApi .getK8sClusterByName (
16301641 event .getNamespace (), event .getClusterName ());
1631-
1632- if (clusterInfo != null && clusterInfo .getCspViewK8sClusterDetail () != null ) {
1633- List <K8sClusterDto .NodeGroup > nodeGroups = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
1634-
1642+
1643+ if (clusterInfo != null ) {
1644+ List <K8sClusterDto .NodeGroup > nodeGroups = null ;
1645+ if (clusterInfo .getSpiderViewK8sClusterDetail () != null ) {
1646+ nodeGroups = clusterInfo .getSpiderViewK8sClusterDetail ().getNodeGroupList ();
1647+ } else if (clusterInfo .getCspViewK8sClusterDetail () != null ) {
1648+ nodeGroups = clusterInfo .getCspViewK8sClusterDetail ().getNodeGroupList ();
1649+ }
1650+
16351651 if (nodeGroups != null ) {
16361652 for (K8sClusterDto .NodeGroup nodeGroup : nodeGroups ) {
16371653 String groupName = nodeGroup .getIid ().getNameId ();
0 commit comments