|
|
|
@@ -355,6 +355,10 @@ public class K8sClientUtil { |
|
|
|
int lastIndex = hostPath.lastIndexOf('/'); |
|
|
|
String newPath = hostPath.substring(0, lastIndex); |
|
|
|
V1Pod pod; |
|
|
|
|
|
|
|
V1HTTPGetAction httpGetAction = new V1HTTPGetAction().path("/").port(new IntOrString(port)); |
|
|
|
V1Probe readinessProbe = new V1Probe().httpGet(httpGetAction).initialDelaySeconds(10).periodSeconds(5).failureThreshold(2); |
|
|
|
|
|
|
|
if (useProxy) { |
|
|
|
pod = new V1PodBuilder() |
|
|
|
.withNewMetadata() |
|
|
|
@@ -368,6 +372,7 @@ public class K8sClientUtil { |
|
|
|
.withPorts(new V1ContainerPort().containerPort(port).protocol("TCP")) |
|
|
|
.withVolumeMounts(new V1VolumeMount().name("workspace").mountPath(mountPath).subPath(subPath)) |
|
|
|
.withNewSecurityContext().withNewPrivileged(true).endSecurityContext() |
|
|
|
.withReadinessProbe(readinessProbe) |
|
|
|
.addNewEnv() |
|
|
|
.withName("HTTP_PROXY") |
|
|
|
.withValue(proxyUrl) |
|
|
|
@@ -402,6 +407,7 @@ public class K8sClientUtil { |
|
|
|
.withPorts(new V1ContainerPort().containerPort(port).protocol("TCP")) |
|
|
|
.withVolumeMounts(new V1VolumeMount().name("workspace").mountPath(mountPath).subPath(subPath)) |
|
|
|
.withNewSecurityContext().withNewPrivileged(true).endSecurityContext() |
|
|
|
.withReadinessProbe(readinessProbe) |
|
|
|
.addNewEnv() |
|
|
|
.withName("NO_PROXY") |
|
|
|
.withValue("localhost,kubernetes.default.svc") |
|
|
|
|