[ Agent ] [ App ] - fix middlewares bugs
This commit is contained in:
@@ -399,6 +399,10 @@ func (op *AgentOsOperator) deployPVC(funcArgs []string) (bool, []string) {
|
|||||||
result = append(result, "替换SUPREME信息")
|
result = append(result, "替换SUPREME信息")
|
||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
// 替换版本号
|
||||||
|
if !BasicReplace(k8sPvcYamlFile, "KIMMY", funcArgs[6]) {
|
||||||
|
log.WarnF("[deployPVC] - pvc config version replace error , expected => %s", funcArgs[6])
|
||||||
|
}
|
||||||
|
|
||||||
// 启动服务
|
// 启动服务
|
||||||
exec, strings := KubectlApplyExec(k8sPvcYamlFile)
|
exec, strings := KubectlApplyExec(k8sPvcYamlFile)
|
||||||
@@ -528,16 +532,36 @@ func (op *AgentOsOperator) deployMiddlewares(funcArgs []string) (bool, []string)
|
|||||||
return false, result
|
return false, result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 替换版本号
|
||||||
|
if !BasicReplace(k8sMiddlewaresYamlFile, "KIMMY", funcArgs[6]) {
|
||||||
|
log.WarnF("[deployPVC] - pvc config version replace error , expected => %s", funcArgs[6])
|
||||||
|
}
|
||||||
|
|
||||||
// 启动服务
|
// 启动服务
|
||||||
exec, strings := KubectlApplyExec(k8sMiddlewaresYamlFile)
|
exec, strings := KubectlApplyExec(k8sMiddlewaresYamlFile)
|
||||||
if !exec {
|
if !exec {
|
||||||
return false, append(result, strings...)
|
return false, append(result, strings...)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 成功启动
|
// check status
|
||||||
return true, []string{
|
podNameList := []string{
|
||||||
"中间件部署成功!",
|
"helm-rabbitmq",
|
||||||
|
"helm-mongo",
|
||||||
|
"helm-emqxs",
|
||||||
|
"helm-nacos",
|
||||||
}
|
}
|
||||||
|
for _, podName := range podNameList {
|
||||||
|
if !K8sCheckPodStatusTimeout(podName, funcArgs[1], 180) {
|
||||||
|
return false, []string{
|
||||||
|
fmt.Sprintf("Namepsace [%s] Pod [%s] 启动失败!", funcArgs[1], podName),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 成功启动
|
||||||
|
return true, append(podNameList,
|
||||||
|
"中间件部署成功!",
|
||||||
|
)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -144,7 +144,7 @@ func K8sCheckPVCStatusTimeOut(specificPvcName string, supreme string, waitTimeOu
|
|||||||
log.ErrorF("[K8sCheckPVCStatusTimeOut] - 命名空间: [ %s ], 获取 PVC [%s] 信息失败: %s ", supreme, specificPvcName, err.Error())
|
log.ErrorF("[K8sCheckPVCStatusTimeOut] - 命名空间: [ %s ], 获取 PVC [%s] 信息失败: %s ", supreme, specificPvcName, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if pvc.Status.Phase == "Running" {
|
if pvc.Status.Phase == corev1.ClaimBound {
|
||||||
log.DebugF("K8sCheckPVCStatusTimeOut] - PVC %s in namespace %s is running", specificPvcName, supreme)
|
log.DebugF("K8sCheckPVCStatusTimeOut] - PVC %s in namespace %s is running", specificPvcName, supreme)
|
||||||
return true
|
return true
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -97,9 +97,9 @@ public class AppFuncScheduler {
|
|||||||
// AppFunctionEnum.DEPLOY_RKE
|
// AppFunctionEnum.DEPLOY_RKE
|
||||||
// AppFunctionEnum.DEPLOY_TEST_NFS
|
// AppFunctionEnum.DEPLOY_TEST_NFS
|
||||||
// AppFunctionEnum.DEPLOY_K8S_NAMESPACE,
|
// AppFunctionEnum.DEPLOY_K8S_NAMESPACE,
|
||||||
AppFunctionEnum.DEPLOY_K8S_MYSQL
|
// AppFunctionEnum.DEPLOY_K8S_MYSQL
|
||||||
|
|
||||||
// AppFunctionEnum.DEPLOY_K8S_REDIS
|
// AppFunctionEnum.DEPLOY_K8S_REDIS
|
||||||
|
AppFunctionEnum.DEPLOY_K8S_PVC
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user