Kubernetes agent does not inherit from default pod template

Hi, trying to inherit container/pod configuration from default global template (kubernetes clouds config) in a declarative pipeline I got following results:

Using yaml with unexpected results:

  • environment variables aren’t inherited from global pod templates
  • resources aren’t inherited from global pod template

Using deprecated containerTemplate works:

  • environment variables are inherited from global pod templates
  • resources are inherited from global pod templates

But for both variants, the volume mounts defined globally in default pod template are inherited.

The documentation says:
Note that it was previously possible to define containerTemplate but that has been deprecated in favor of the yaml format.

I’m really confused, containerTemplate is the only config that works as expected but is deprecated since more than 2 years.

So has anybody an idea how to setup a declarative pipeline with inherited container config which will still work in the future (not deprecated)?