| @@ -263,7 +263,7 @@ public class ImageServiceImpl implements ImageService { | |||||
| V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); | V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); | ||||
| if (pod == null) { | if (pod == null) { | ||||
| String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); | String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); | ||||
| pod = createPod(serviceNS, podName); | |||||
| pod = k8sClientUtil.createPodWithEnv(podName,serviceNS,proxyUrl,mountPath,pvcName,image); | |||||
| } | } | ||||
| String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; | String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; | ||||
| // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 | // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 | ||||
| @@ -305,7 +305,7 @@ public class ImageServiceImpl implements ImageService { | |||||
| V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); | V1Pod pod = k8sClientUtil.getNSPodList(serviceNS, deploymentName); | ||||
| if (pod == null) { | if (pod == null) { | ||||
| String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); | String podName = deploymentName+"-"+ DateUtils.formatYMD10(new Date()); | ||||
| pod = createPod(serviceNS, podName); | |||||
| pod = k8sClientUtil.createPodWithEnv(podName,serviceNS,proxyUrl,mountPath,pvcName,image); | |||||
| } | } | ||||
| String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; | String loginCmd = "docker login -u " + harborUser +" -p "+harborpassword+" "+harborUrl; | ||||
| // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 | // 执行命令 docker login -u admin -p Harbor12345 172.20.32.187 | ||||
| @@ -346,8 +346,4 @@ public class ImageServiceImpl implements ImageService { | |||||
| String path = loginUser.getUsername()+"/"+file.getOriginalFilename(); | String path = loginUser.getUsername()+"/"+file.getOriginalFilename(); | ||||
| return minioService.uploadFile(bucketName, path, file); | return minioService.uploadFile(bucketName, path, file); | ||||
| } | } | ||||
| private V1Pod createPod(String namespace, String podName){ | |||||
| return k8sClientUtil.createPodWithEnv(podName,namespace,proxyUrl,mountPath,pvcName,image); | |||||
| } | |||||
| } | } | ||||