diff --git a/dist/index.js b/dist/index.js index 91258ba5..f3435294 100644 Binary files a/dist/index.js and b/dist/index.js differ diff --git a/dist/index.js.map b/dist/index.js.map index 384ed7d2..91b89fb0 100644 Binary files a/dist/index.js.map and b/dist/index.js.map differ diff --git a/src/model/cloud-runner/providers/k8s/index.ts b/src/model/cloud-runner/providers/k8s/index.ts index b5fdb700..a492031c 100644 --- a/src/model/cloud-runner/providers/k8s/index.ts +++ b/src/model/cloud-runner/providers/k8s/index.ts @@ -127,12 +127,14 @@ class Kubernetes implements ProviderInterface { ? CloudRunner.lockedWorkspace : this.buildParameters.buildGuid; this.pvcName = `unity-builder-pvc-${id}`; - await KubernetesStorage.createPersistentVolumeClaim( - this.buildParameters, - this.pvcName, - this.kubeClient, - this.namespace, - ); + if (process.env['CLOUD_RUNNER_MINIKUBE']) { + await KubernetesStorage.createPersistentVolumeClaim( + this.buildParameters, + this.pvcName, + this.kubeClient, + this.namespace, + ); + } this.buildGuid = buildGuid; this.secretName = `build-credentials-${this.buildGuid}`; this.jobName = `unity-builder-job-${this.buildGuid}`; diff --git a/src/model/cloud-runner/providers/k8s/kubernetes-job-spec-factory.ts b/src/model/cloud-runner/providers/k8s/kubernetes-job-spec-factory.ts index de91f871..af488c5e 100644 --- a/src/model/cloud-runner/providers/k8s/kubernetes-job-spec-factory.ts +++ b/src/model/cloud-runner/providers/k8s/kubernetes-job-spec-factory.ts @@ -107,6 +107,16 @@ class KubernetesJobSpecFactory { }, }; + if (process.env['CLOUD_RUNNER_MINIKUBE']) { + job.spec.template.spec.volumes[0] = { + name: 'build-mount', + hostPath: { + path: `/data`, + type: `Directory`, + }, + }; + } + job.spec.template.spec.containers[0].resources.requests[`ephemeral-storage`] = '10Gi'; return job; diff --git a/src/model/cloud-runner/providers/k8s/kubernetes-storage.ts b/src/model/cloud-runner/providers/k8s/kubernetes-storage.ts index fcce49e9..7f6f642d 100644 --- a/src/model/cloud-runner/providers/k8s/kubernetes-storage.ts +++ b/src/model/cloud-runner/providers/k8s/kubernetes-storage.ts @@ -94,27 +94,7 @@ class KubernetesStorage { }, }, }; - if (process.env['CLOUD_RUNNER_MINIKUBE']) { - pvc.spec.storageClassName = `manual`; - } const result = await kubeClient.createNamespacedPersistentVolumeClaim(namespace, pvc); - if (process.env['CLOUD_RUNNER_MINIKUBE']) { - const hostPathVolume = { - metadata: { - name: `${pvcName}-volume`, - labels: { - type: `local`, - }, - }, - spec: { - storageClassName: `manual`, - capacity: { storage: `5Gi` }, - accessModes: ['ReadWriteOnce'], - hostPath: { path: `/data/${pvcName}` }, - }, - }; - await kubeClient.createPersistentVolume(hostPathVolume); - } return result; }