2017-08-16 4 views
0

config podTemplateを設定すると、Time in minutes to retain slave when idleMax number of instancesがパイプラインで設定されますか?jenkins kubernetes-pluginはパイプラインでidletimeoutを設定します

[システム]> [Could-> kubernetes]の2つの設定オプションがあります。しかし、私はパイプラインを使用して、私はそれを設定する方法を理解していませんでした。

私のパイプラインは次のようになります。

podTemplate(label: 'docker-go', 
    containers: [ 
     containerTemplate(
      name: 'jnlp', 
      image: 'docker.mydomain.com/library/jnlp-slave:2.62', 
      command: '', 
      args: '${computer.jnlpmac} ${computer.name}', 
     ), 
     containerTemplate(name: 'docker', image: 'docker.mydomain.com/library/docker:1.12.6', ttyEnabled: true, command: 'cat'), 
     containerTemplate(name: 'golang', image: 'docker.mydomain.com/library/golang:1.8.3', ttyEnabled: true, command: '') 
    ], 
    volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')] 
) { 

    def image_tag = "docker.mydomain.com/deploy-demo/demo-go:v0.1" 
    def workdir = "/go/src/demo-go" 
    node('docker-go') { 
    stage('setup') { 

    } 

    stage('clone') { 
    } 
    stage('compile') { 

    } 
    stage('build and push image') { 
    } 
    } 
} 

答えて

0

[OK]を、私は

をそれをfiguireこれら二つを追加します。 idleMinutes: 10 instanceCap: 10

podTemplate(label: 'docker-go', 
    containers: [ 
     containerTemplate(
      name: 'jnlp', 
      image: 'docker.mydomain.com/library/jnlp-slave:2.62', 
      command: '', 
      args: '${computer.jnlpmac} ${computer.name}', 
     ), 
     containerTemplate(name: 'docker', image: 'docker.mydomain.com/library/docker:1.12.6', ttyEnabled: true, command: 'cat'), 
     containerTemplate(name: 'golang', image: 'docker.mydomain.com/library/golang:1.8.3', ttyEnabled: true, command: '') 
    ], 
    volumes: [hostPathVolume(hostPath: '/var/run/docker.sock', mountPath: '/var/run/docker.sock')], 
    idleMinutes: 10 
    instanceCap: 10 
) { 

    def image_tag = "docker.mydomain.com/deploy-demo/demo-go:v0.1" 
    def workdir = "/go/src/demo-go" 
    node('docker-go') { 
    stage('setup') { 

    } 

    stage('clone') { 
    } 
    stage('compile') { 

    } 
    stage('build and push image') { 
    } 
    } 
} 
関連する問題