tall-greece-98310
03/06/2023, 11:02 AMrun task
that does a cat
of the file, then capture this via task output.log and I can then use this as inputs for other tasks etc.
It turns out that the task script is run in a separate container, that does not have the required volume mounted, and hence the approach fails.
Any tips to accomplish what I want? Any details on how the task container is specified to run? Does it run as a separate container in same pod or something like that?quaint-dress-831
03/07/2023, 2:25 PMvolumeMounts
by chance or do you have a sanitized garden.yml
you can share? If the former, volumeMounts
for Tasks suffer from a bug we're hoping to take a second look at after our next Garden release: https://github.com/garden-io/garden/issues/1766tall-greece-98310
03/08/2023, 9:08 AMkubectl exec
in the already existing pod/container. Launching a new one will have lots of cases where it'll be cumbersome.
One example: another case of mine the StatefulSet has pod-antiaffinity to not scheulde vault on same node. I only use 1 replica in dev so no issue, the affinity has no impact. But then the task inherits the same rules and can't launch as I also only use 1 node in my dev KinD setup.
So intuitively I'd prefer to run tasks inside existing pods/containers, not launch new ones. I'm setting up things in parallel in devspace as a comparison and it uses that approach and so far it wins out for dev convenience. I just add a few bits on top of the prod image that is useful for dev, then run these things inside the actual containers and there are no surprises.quaint-dress-831
03/09/2023, 1:47 PMgarden.yml
to share with us, it's just a good springboard to demonstrate to others. Otherwise I'll write one up myself that fits your description.tall-greece-98310
03/09/2023, 6:23 PMcat /path/to/file
and using output.log
for the task - but the task wont ever be able to cat that file from outside the actual stateful set pod.
I agree that the higher level concepts of garden are powerful, but I think we need some lower level escape hatches as well. E.g. a task can run as a separate pod or as kubectl exec
in the existing pod. that kind of thing.bright-policeman-43626
03/13/2023, 5:45 AM