use of com.cloud.kubernetes.cluster.actionworkers.KubernetesClusterScaleWorker in project cloudstack by apache.
the class KubernetesClusterManagerImpl method scaleKubernetesCluster.
@Override
public boolean scaleKubernetesCluster(ScaleKubernetesClusterCmd cmd) throws CloudRuntimeException {
if (!KubernetesServiceEnabled.value()) {
logAndThrow(Level.ERROR, "Kubernetes Service plugin is disabled");
}
validateKubernetesClusterScaleParameters(cmd);
KubernetesClusterVO kubernetesCluster = kubernetesClusterDao.findById(cmd.getId());
Account owner = accountService.getActiveAccountById(kubernetesCluster.getAccountId());
String[] keys = getServiceUserKeys(owner);
KubernetesClusterScaleWorker scaleWorker = new KubernetesClusterScaleWorker(kubernetesClusterDao.findById(cmd.getId()), serviceOfferingDao.findById(cmd.getServiceOfferingId()), cmd.getClusterSize(), cmd.getNodeIds(), cmd.isAutoscalingEnabled(), cmd.getMinSize(), cmd.getMaxSize(), this);
scaleWorker.setKeys(keys);
scaleWorker = ComponentContext.inject(scaleWorker);
return scaleWorker.scaleCluster();
}
Aggregations