[ Agent ] [ App ] - fix mysql bugs
This commit is contained in:
@@ -467,7 +467,7 @@ func (op *AgentOsOperator) deployMySQL(funcArgs []string) (bool, []string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check mysql
|
// check mysql
|
||||||
if !K8sCheckPodStatusTimeout("helm-mysql-0", funcArgs[0], 180) {
|
if !K8sCheckPodStatusTimeout("helm-mysql-0", funcArgs[1], 180) {
|
||||||
return false, []string{
|
return false, []string{
|
||||||
"helm-mysql-0 启动失败!",
|
"helm-mysql-0 启动失败!",
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ func K8sCheckPodStatusTimeout(specificPod string, supreme string, waitTimeOut in
|
|||||||
case <-tick:
|
case <-tick:
|
||||||
pod, err := k8sClient.CoreV1().Pods(supreme).Get(context.TODO(), specificPod, metav1.GetOptions{})
|
pod, err := k8sClient.CoreV1().Pods(supreme).Get(context.TODO(), specificPod, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("[K8sCheckPodStatusTimeout] - 获取Pod信息失败: %s", err.Error())
|
log.ErrorF("[K8sCheckPodStatusTimeout] - 命名空间: [%s], Pod名称: [%s], 获取Pod信息失败 !", supreme, err.Error())
|
||||||
} else {
|
} else {
|
||||||
log.DebugF("[K8sCheckPodStatusTimeout] - 命名空间: [%s], Pod名称: [%s], 状态: [%s]", supreme, pod.Name, pod.Status.Phase)
|
log.DebugF("[K8sCheckPodStatusTimeout] - 命名空间: [%s], Pod名称: [%s], 状态: [%s]", supreme, pod.Name, pod.Status.Phase)
|
||||||
if pod.Status.Phase == corev1.PodRunning || pod.Status.Phase == corev1.PodSucceeded {
|
if pod.Status.Phase == corev1.PodRunning || pod.Status.Phase == corev1.PodSucceeded {
|
||||||
@@ -86,7 +86,7 @@ func K8sCheckDeploymentStatusTimeout(specificDeployment string, supreme string,
|
|||||||
case <-tick:
|
case <-tick:
|
||||||
deployment, err := k8sClient.AppsV1().Deployments(supreme).Get(context.TODO(), specificDeployment, metav1.GetOptions{})
|
deployment, err := k8sClient.AppsV1().Deployments(supreme).Get(context.TODO(), specificDeployment, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("[K8sCheckDeploymentStatusTimeout] - 获取deployment信息失败: %v ", err)
|
log.ErrorF("[K8sCheckDeploymentStatusTimeout] - 命名空间: [%s], Deployment 名称: [%s], 获取Deployment信息失败 !", supreme, err.Error())
|
||||||
} else {
|
} else {
|
||||||
log.DebugF("[K8sCheckDeploymentStatusTimeout] - 命名空间: [ %s ], Deployment: [ %s ] 还有Pods未处于Running状态 (Ready: %d, Total: %d)\n", supreme, deployment.Name, deployment.Status.ReadyReplicas, deployment.Status.Replicas)
|
log.DebugF("[K8sCheckDeploymentStatusTimeout] - 命名空间: [ %s ], Deployment: [ %s ] 还有Pods未处于Running状态 (Ready: %d, Total: %d)\n", supreme, deployment.Name, deployment.Status.ReadyReplicas, deployment.Status.Replicas)
|
||||||
|
|
||||||
@@ -141,7 +141,7 @@ func K8sCheckPVCStatusTimeOut(specificPvcName string, supreme string, waitTimeOu
|
|||||||
case <-tick:
|
case <-tick:
|
||||||
pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(supreme).Get(context.TODO(), specificPvcName, metav1.GetOptions{})
|
pvc, err := k8sClient.CoreV1().PersistentVolumeClaims(supreme).Get(context.TODO(), specificPvcName, metav1.GetOptions{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.ErrorF("[K8sCheckPVCStatusTimeOut] - 获取 PVC 信息失败: %v ", err)
|
log.ErrorF("[K8sCheckPVCStatusTimeOut] - 命名空间: [ %s ], 获取 PVC [%s] 信息失败: %s ", supreme, specificPvcName, err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
if pvc.Status.Phase == "Running" {
|
if pvc.Status.Phase == "Running" {
|
||||||
|
|||||||
@@ -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
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user