I have a project that uses declarative pipeline to run a Jenkins jobs. It works without issues. At the beginning of the pipeline I have:
agent { kubernetes {