[ Agent ] [ APP ] - k8s dashboard
This commit is contained in:
@@ -94,8 +94,8 @@ public class AppFuncScheduler {
|
||||
);
|
||||
|
||||
List<AppFunctionEnum> appFunctionEnumList = List.of(
|
||||
AppFunctionEnum.DEPLOY_RKE
|
||||
// AppFunctionEnum.DEPLOY_K8S_DASHBOARD
|
||||
// AppFunctionEnum.DEPLOY_RKE
|
||||
AppFunctionEnum.DEPLOY_K8S_DASHBOARD
|
||||
);
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
@@ -43,12 +44,8 @@ public class BaseFuncScheduler {
|
||||
|
||||
private void doRunProcedure(ProjectDeployContext projectDeployContext) {
|
||||
|
||||
// 执行 基础功能施工的内容
|
||||
String masterTopicName = projectDeployContext
|
||||
.getMasterNode()
|
||||
.getTopicName();
|
||||
|
||||
if (!MasterNodeBaseProcedure(masterTopicName)) {
|
||||
if (!MasterNodeBaseProcedure(projectDeployContext)) {
|
||||
log.error("Master 初始化过程错误! 即将终止!");
|
||||
}
|
||||
|
||||
@@ -83,7 +80,19 @@ public class BaseFuncScheduler {
|
||||
|
||||
}
|
||||
|
||||
private boolean MasterNodeBaseProcedure(String masterTopicName) {
|
||||
private boolean MasterNodeBaseProcedure(ProjectDeployContext projectDeployContext) {
|
||||
|
||||
// 执行 基础功能施工的内容
|
||||
String masterTopicName = projectDeployContext
|
||||
.getMasterNode()
|
||||
.getTopicName();
|
||||
|
||||
// base func args
|
||||
ArrayList<String> baseFuncArgList = new ArrayList<>();
|
||||
baseFuncArgList.add(projectDeployContext
|
||||
.getMasterNode()
|
||||
.getServerIpInV4());
|
||||
|
||||
|
||||
List<BaseFunctionEnum> masterNodeProcedureList = List.of(
|
||||
// BaseFunctionEnum.DISABLE_SWAP,
|
||||
@@ -98,10 +107,17 @@ public class BaseFuncScheduler {
|
||||
|
||||
|
||||
for (BaseFunctionEnum procedure : masterNodeProcedureList) {
|
||||
|
||||
// add op name
|
||||
baseFuncArgList.add(
|
||||
0,
|
||||
procedure.getFuncName()
|
||||
);
|
||||
|
||||
if (!funcService.callBaseFuncAndJudge(
|
||||
masterTopicName,
|
||||
procedure,
|
||||
null,
|
||||
baseFuncArgList,
|
||||
false
|
||||
)) {
|
||||
|
||||
@@ -115,17 +131,24 @@ public class BaseFuncScheduler {
|
||||
}
|
||||
|
||||
List<BaseFunctionEnum> masterNodeDurationTaskList = List.of(
|
||||
BaseFunctionEnum.INSTALL_DEFAULT_SSH_KEY
|
||||
BaseFunctionEnum.MODIFY_DOCKER_CONFIG
|
||||
// BaseFunctionEnum.INSTALL_DOCKER,
|
||||
// BaseFunctionEnum.INSTALL_DOCKER_COMPOSE,
|
||||
// BaseFunctionEnum.INSTALL_HARBOR
|
||||
);
|
||||
|
||||
for (BaseFunctionEnum durationBaseFunc : masterNodeDurationTaskList) {
|
||||
|
||||
// add op name
|
||||
baseFuncArgList.add(
|
||||
0,
|
||||
durationBaseFunc.getFuncName()
|
||||
);
|
||||
|
||||
if (!funcService.callBaseFuncAndJudge(
|
||||
masterTopicName,
|
||||
durationBaseFunc,
|
||||
null,
|
||||
baseFuncArgList,
|
||||
true
|
||||
)) {
|
||||
log.error(
|
||||
|
||||
@@ -50,14 +50,6 @@ public class FuncServiceImpl implements FuncService {
|
||||
"调用基本脚本 => {}",
|
||||
baseFunctionEnum.getDesc()
|
||||
);
|
||||
// 重新构造内容,增加Function Name
|
||||
if (CollectionUtils.isEmpty(funcArgs)) {
|
||||
funcArgs = new ArrayList<>();
|
||||
}
|
||||
funcArgs.add(
|
||||
0,
|
||||
baseFunctionEnum.getFuncName()
|
||||
);
|
||||
|
||||
List<String> syncResultLog = syncCallFunction(
|
||||
agentTopicName,
|
||||
|
||||
@@ -53,11 +53,11 @@ public class TestBaseFuncScheduler {
|
||||
projectDeployContext.setMasterNode(serverInfoPO);
|
||||
|
||||
|
||||
baseFuncScheduler.runProcedure(projectDeployContext);
|
||||
// baseFuncScheduler.runProcedure(projectDeployContext);
|
||||
|
||||
// harborFuncScheduler.runProcedure(projectDeployContext);
|
||||
|
||||
// appFuncScheduler.runProcedure(projectDeployContext);
|
||||
appFuncScheduler.runProcedure(projectDeployContext);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user