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