<p>The Jenkinsfile similar to the one below works fine for me without <code>properties</code> section. But when I add <code>properties</code> Jenkins job fails with</p>

<pre><code>java.lang.NoSuchMethodError: No such DSL method 'properties' found among steps [archive, bat, build, catchError, checkout, container, containerLog, deleteDir, dir, dockerFingerprintFrom, dockerFingerprintRun, echo, error, .....
</code></pre>

<p>I've tried to place it in the root section too, but with the same result. So, I'm not sure where to put it now.</p>

<p>Jenkinsfile</p>

<pre><code>def label = "worker-${UUID.randomUUID().toString()}"

podTemplate(label: label, containers: [
  containerTemplate(name: 'kubectl', image: 'lachlanevenson/k8s-kubectl:v1.8.8', command: 'cat', ttyEnabled: true)
],
volumes: [
]) {
  node(label) {
    properties(
      [
        [
          $class  : 'jenkins.model.BuildDiscarderProperty',
          strategy: [
            $class: 'LogRotator',
            numToKeepStr: '50'
          ]
        ],
        pipelineTriggers(
          [
            [
              $class: 'hudson.triggers.TimerTrigger',
              spec  : "*/5 * * * *"
            ]
          ]
        )
      ]
    )

    stage('Run kubectl') {
      container('kubectl') {
        withEnv([
            "ES_URL=elasticsearch.storage:9200"
        ]){
            sh """
               kubectl run -it --rm=true busybox-curl --image=yauritux/busybox-curl --restart=Never -- curl "$ES_URL"
            """
      }
    }
  }
}
</code></pre>

<p>Jenkins is running on Kubernetes. To set up Jenkins I used <a href="https://github.com/kubernetes/charts/tree/master/stable/jenkins" rel="nofollow noreferrer">stable/jenkins</a> helm chart.</p>

<p>Thank you!</p>

kikulikov
<p>Ok, I've figured out the problem. Some of the plugins were not updated and apparently caused some conflicts. I updated all the plugins and the problem has gone.</p>
