helm-charts icon indicating copy to clipboard operation
helm-charts copied to clipboard

containerbaseDir in emptyDir does not work with persistence

Open vquie opened this issue 2 years ago • 13 comments

Hi,

I just saw that containerbaseDir in combination with persistence ist not working. I don't know if it should work since an emptyDir will be mounted inside a pvc. Maybe it also has something to do with fsGroup: 1000 which I had to setup. Otherwise the cache did not work at all.

Is this an issue or am I just deploying it wrong?

"stderr": "You don't have permission to create /tmp/renovate/cache/containerbase.\ncurl: (23) Failed writing received data to disk/application\nDownload failed: https://nodejs.org/dist/v18.14.0/node-v18.14.0-linux-x64.tar.xz\nbash: npm: command not found\n",

I am running in EKS with gp3 volumes.

Thanks.

vquie avatar Feb 14 '23 22:02 vquie

you probably need to prepare the volume with the right rights before mounting it to renovate

viceice avatar Feb 17 '23 10:02 viceice

we can accept a PR which adds a conditional startup container to change volume permission as root. that should be disabled by default.

viceice avatar Feb 17 '23 10:02 viceice

This is not about fsgroup. Is it possible to mount an emptyDir on a pvc? This is what is happening here. I think there needs to be a switch to allow a different mount point for the emptydir when using persistence in the main container.

vquie avatar Feb 17 '23 10:02 vquie

🤷‍♂️ make a PR which suggested changes and I'll review it.

viceice avatar Feb 17 '23 10:02 viceice

@vquie Are you able to post your helm configuration so I can try to reproduce this issue? I can try and look into this issue if I'm able to reproduce it. As far as I know, an emptyDir should be mountable on a PVC (since in the end, these are just Linux mounts).

kvanzuijlen avatar Feb 18 '23 22:02 kvanzuijlen

I dug a little deeper.

This is the relevant part of the config:

---
securityContext:
  fsGroup: 1000
renovate:
  config: |
    {
      "platform": "gitlab"
    }
  persistence:
    cache:
      enabled: true
      storageClass: "my-default-storageclass"
      storageSize: "50Gi"
dind:
  enabled: true
  slim:
    enabled: true
env:
  RENOVATE_DRY_RUN: "null"
  RENOVATE_AUTODISCOVER: "false"
  RENOVATE_REPOSITORIES: |
    [
      {
        "repository": "my-repo"
      }
    ]
  RENOVATE_PERSIST_REPO_DATA: "true"
  RENOVATE_REPOSITORY_CACHE: "enabled"
  RENOVATE_REPOSITORY_CACHE_TYPE: "local"

This is what is deployed to the cluster:

          containers:
            - name: renovate
              [...]
              volumeMounts:
              [...]
              - name: renovate-cache
                mountPath: /tmp/renovate
              - name: renovate-tmp-volume
                mountPath: /tmp

            - name: renovate-dind
              [...]
              volumeMounts:
                - name: renovate-tmp-volume
                  mountPath: /tmp
          volumes:
            [...]
            - name: renovate-cache
              persistentVolumeClaim:
                claimName: renovate-cache
            - name: renovate-tmp-volume
              emptyDir: {}

As you can see renovate-tmp-volume, the emptyDir, is mounted to /tmp. Default containerbaseDir resides in /tmp/renovate/cache though which is mounted inside the persistentVolumeClaim .

Maybe there needs to be a switch to change containerbaseDir if docker-in-docker is enabled?

vquie avatar Feb 20 '23 11:02 vquie

as the slim image can now be used with install mode, you should use that instead of dind. just set the binary source ENV var to install, set slim to true and disable dind.

we should document that and prefer over docker mode.

viceice avatar Feb 20 '23 13:02 viceice

That would be great. How can I enable slim without updating the tag by myself? I would like to keep up with the image version of the chart. Enabling slim in the dind scope does not work if dind is disabled.

vquie avatar Feb 20 '23 14:02 vquie

ok, we need to change it then. so we can support slim without dind.

viceice avatar Feb 21 '23 07:02 viceice

  • #281

viceice avatar Feb 21 '23 10:02 viceice

  • #298

Can anybody verify that it's working with slim image and install mode?

viceice avatar May 16 '23 07:05 viceice

I am using this and had no issues so far.

vquie avatar May 16 '23 08:05 vquie

So we can close this issue?

  • #298

viceice avatar May 17 '23 10:05 viceice

closing due to inactivity and dropped DinD support

viceice avatar May 08 '24 08:05 viceice