garden icon indicating copy to clipboard operation
garden copied to clipboard

Task runs do not copy volumeMounts

Open khaled opened this issue 4 years ago • 6 comments

Bug

I've got a helm module with some tasks in it. The service resource is a deployment that is part of the chart. The pod spec in that deployment mounts a couple of volumes, one from a secret and another from a ConfigMap, which are configuration files that are read by the primary container.

Tasks spin up a new pod, but unfortunately do not seem to copy over the volumeMounts and volumes referenced by the primary container in the deployment.

I'm stuck because afaict there's no way to specify the same secret + ConfigMap based volumes in the task definitions. And even if it were possible, I probably would not want to duplicate this configuration in the task definitions - ideally they'd be copied over from the deployment.

I suspect tests have the same issue, but have not tried them to confirm.

Expected Behavior

Task runs create pods with the same volumes and volume mounts as the ones defined in the service resource.

Or maybe instead of creating new pods, the tasks can just exec within the existing pods.

Workaround

Run kubectl exec instead of using garden tasks (and maybe tests) :(

Your environment

▶ garden --version
0.11.9

khaled avatar Apr 02 '20 23:04 khaled

This issue has been automatically marked as stale because it hasn't had any activity in 60 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Jun 07 '20 16:06 stale[bot]

This issue has been automatically marked as stale because it hasn't had any activity in 60 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Aug 15 '20 18:08 stale[bot]

This issue has been automatically marked as stale because it hasn't had any activity in 60 days. It will be closed in 14 days if no further activity occurs (e.g. changing labels, comments, commits, etc.). Please feel free to tag a maintainer and ask them to remove the label if you think it doesn't apply. Thank you for submitting this issue and helping make Garden a better product!

stale[bot] avatar Oct 20 '20 12:10 stale[bot]

This is still an issue as of garden version 0.12.20.

jamesgregorystewart avatar May 24 '21 19:05 jamesgregorystewart

Hi @jamesgregorystewart

Thanks for pointing this out. This one has kind of slipped through the cracks. We'll look into this.

eysi09 avatar Jun 01 '21 14:06 eysi09

This would be helpful for us, too.

tobiasmcnulty avatar Jun 28 '22 19:06 tobiasmcnulty

I've bumped priority as Tasks should be respecting volumeMounts by design according to our reference docs where we specify the volumes field is used (volumes must be paired with volumeMounts). This bug is also very old and bound to surface again (it bit me today) without a little Garden love 💕

worldofgeese avatar Dec 22 '22 14:12 worldofgeese

Still happening as of version 0.12.50 with garden test. This issue, plus the fact of running tests in their own new pod, makes garden test unusable in our case. I would appreciate this getting more attention!

hassinerhouma avatar Feb 03 '23 09:02 hassinerhouma

This is fixed in 0.13 with both modules and actions.

Orzelius avatar Jun 14 '23 09:06 Orzelius