| @@ -627,8 +627,8 @@ public class K8sClientUtil { | |||||
| public V1Pod createPodWithEnv(String podName, String namespace, String proxyUrl, String mountPath, String pvcName, String image) { | public V1Pod createPodWithEnv(String podName, String namespace, String proxyUrl, String mountPath, String pvcName, String image) { | ||||
| CoreV1Api api = new CoreV1Api(apiClient); | CoreV1Api api = new CoreV1Api(apiClient); | ||||
| V1SecurityContext v1SecurityContext = new V1SecurityContext(); | |||||
| v1SecurityContext.setPrivileged(true); | |||||
| // V1SecurityContext v1SecurityContext = new V1SecurityContext(); | |||||
| // v1SecurityContext.setPrivileged(true); | |||||
| // 配置卷和卷挂载 | // 配置卷和卷挂载 | ||||
| List<V1VolumeMount> volumeMounts = new ArrayList<>(); | List<V1VolumeMount> volumeMounts = new ArrayList<>(); | ||||
| @@ -645,7 +645,7 @@ public class K8sClientUtil { | |||||
| .addNewContainer() | .addNewContainer() | ||||
| .withName(podName) | .withName(podName) | ||||
| .withImage(image) // 替换为您实际要使用的镜像名称 | .withImage(image) // 替换为您实际要使用的镜像名称 | ||||
| .withSecurityContext(v1SecurityContext) | |||||
| // .withSecurityContext(v1SecurityContext) | |||||
| // .withVolumeMounts(new V1VolumeMount().name("workspace").mountPath(mountPath)) | // .withVolumeMounts(new V1VolumeMount().name("workspace").mountPath(mountPath)) | ||||
| .withVolumeMounts(volumeMounts) | .withVolumeMounts(volumeMounts) | ||||
| .withNewSecurityContext().withNewPrivileged(true).endSecurityContext() | .withNewSecurityContext().withNewPrivileged(true).endSecurityContext() | ||||