You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java
if (clusterSize == kubernetesCluster.getNodeCount()) {
811
+
return;
812
+
}
813
+
if (kubernetesCluster.getState().equals(KubernetesCluster.State.Stopped)) { // Cannot scale stopped cluster currently for cluster size
814
+
thrownewPermissionDeniedException(String.format("Kubernetes cluster : %s is in %s state", kubernetesCluster.getName(), kubernetesCluster.getState().toString()));
815
+
}
816
+
if (clusterSize < 1) {
817
+
thrownewInvalidParameterValueException(String.format("Kubernetes cluster : %s cannot be scaled for size, %d", kubernetesCluster.getName(), clusterSize));
818
+
}
819
+
if (clusterSize + kubernetesCluster.getControlNodeCount() > maxClusterSize) {
820
+
thrownewInvalidParameterValueException(
821
+
String.format("Maximum cluster size can not exceed %d. Please contact your administrator", maxClusterSize));
822
+
}
823
+
if (clusterSize > kubernetesCluster.getNodeCount()) { // Upscale
thrownewInvalidParameterValueException(String.format("Invalid template associated with Kubernetes cluster : %s", kubernetesCluster.getName()));
827
+
}
828
+
if (CollectionUtils.isEmpty(templateJoinDao.newTemplateView(template, zone.getId(), true))) {
829
+
thrownewInvalidParameterValueException(String.format("Template : %s associated with Kubernetes cluster : %s is not in Ready state for datacenter : %s", template.getName(), kubernetesCluster.getName(), zone.getName()));
logAndThrow(Level.WARN, String.format("Kubernetes cluster cannot be scaled down for service offering. Service offering : %s offers lesser resources as compared to service offering : %s of Kubernetes cluster : %s",
if (kubernetesCluster.getState().equals(KubernetesCluster.State.Stopped)) { // Cannot scale stopped cluster currently for cluster size
926
-
thrownewPermissionDeniedException(String.format("Kubernetes cluster : %s is in %s state", kubernetesCluster.getName(), kubernetesCluster.getState().toString()));
927
-
}
928
-
if (clusterSize < 1) {
929
-
thrownewInvalidParameterValueException(String.format("Kubernetes cluster : %s cannot be scaled for size, %d", kubernetesCluster.getName(), clusterSize));
930
-
}
931
-
if (clusterSize + kubernetesCluster.getControlNodeCount() > maxClusterSize) {
932
-
thrownewInvalidParameterValueException(
933
-
String.format("Maximum cluster size can not exceed %d. Please contact your administrator", maxClusterSize));
934
-
}
935
-
if (clusterSize > kubernetesCluster.getNodeCount()) { // Upscale
thrownewInvalidParameterValueException(String.format("Invalid template associated with Kubernetes cluster : %s", kubernetesCluster.getName()));
939
-
}
940
-
if (CollectionUtils.isEmpty(templateJoinDao.newTemplateView(template, zone.getId(), true))) {
941
-
thrownewInvalidParameterValueException(String.format("Template : %s associated with Kubernetes cluster : %s is not in Ready state for datacenter : %s", template.getName(), kubernetesCluster.getName(), zone.getName()));
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterResourceModifierActionWorker.java
Copy file name to clipboardExpand all lines: plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterScaleWorker.java
@@ -417,11 +430,17 @@ public boolean scaleCluster() throws CloudRuntimeException {
417
430
if (existingServiceOffering == null) {
418
431
logAndThrow(Level.ERROR, String.format("Scaling Kubernetes cluster : %s failed, service offering for the Kubernetes cluster not found!", kubernetesCluster.getName()));
0 commit comments