monocular icon indicating copy to clipboard operation
monocular copied to clipboard

why api uses emptyDir instead of PVC?

Open chz8494 opened this issue 7 years ago • 3 comments

It takes a long time for API to boot up, why api uses emptyDir instead of PVC? so it can also fix the issue that K8s keeps restarting API pods.

 "spec": {
    "volumes": [
      {
        "name": "config",
        "configMap": {
          "name": "monocular-monocular-api-config",
          "defaultMode": 420
        }
      },
      {
        "name": "cache",
        "emptyDir": {}
      }
    ],
        "volumeMounts": [
          {
            "name": "cache",
            "mountPath": "/monocular"

chz8494 avatar May 30 '18 16:05 chz8494

emptyDirs are persisted through container restarts, they just aren't when pods get deleted. So switching to a PV will not really affect the restart problem.

prydonius avatar May 30 '18 20:05 prydonius

If I use pvc to keep downloaded charts from deleting or upgrading pod, will API downloads all charts all over again every time when it boots up?

chz8494 avatar May 30 '18 21:05 chz8494

it won't know, you're right that it'll be faster if upgrading or after deleting. That said, I don't think we'll change this as it's meant to be a cache and not really persisted.

prydonius avatar May 30 '18 22:05 prydonius