-
Bug
-
Resolution: Not A Defect
-
Major
-
None
-
Jenkins 2.104
kubernetes-plugin 1.1.4
After upgrading to 1.1.4, my agents were getting deployed as what appeared to be a default template instead of my custom pod template. My custom template includes a custom container, but the Pod being created only had the jnlp container in it.
Here is my plugin configuration that works correctly in 1.1.3:
<org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud plugin="kubernetes@1.1.3"> <name>kubernetes</name> <defaultsProviderTemplate></defaultsProviderTemplate> <templates> <org.csanchez.jenkins.plugins.kubernetes.PodTemplate> <inheritFrom></inheritFrom> <name>rok8sslave</name> <namespace>jenkins</namespace> <privileged>false</privileged> <alwaysPullImage>false</alwaysPullImage> <instanceCap>2</instanceCap> <slaveConnectTimeout>100</slaveConnectTimeout> <idleMinutes>1</idleMinutes> <activeDeadlineSeconds>1800</activeDeadlineSeconds> <label>rok8s</label> <nodeSelector></nodeSelector> <nodeUsageMode>EXCLUSIVE</nodeUsageMode> <customWorkspaceVolumeEnabled>false</customWorkspaceVolumeEnabled> <workspaceVolume class="org.csanchez.jenkins.plugins.kubernetes.volumes.workspace.EmptyDirWorkspaceVolume"> <memory>false</memory> </workspaceVolume> <volumes> <org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume> <mountPath>/usr/bin/docker</mountPath> <hostPath>/usr/bin/docker</hostPath> </org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume> <org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume> <mountPath>/var/run/docker.sock</mountPath> <hostPath>/var/run/docker.sock</hostPath> </org.csanchez.jenkins.plugins.kubernetes.volumes.HostPathVolume> </volumes> <containers> <org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate> <name>rok8s</name> <image>repository.internal/org/ciimage</image> <privileged>false</privileged> <alwaysPullImage>true</alwaysPullImage> <workingDir>/home/jenkins</workingDir> <command>/bin/sh -c</command> <args>cat</args> <ttyEnabled>true</ttyEnabled> <resourceRequestCpu></resourceRequestCpu> <resourceRequestMemory></resourceRequestMemory> <resourceLimitCpu></resourceLimitCpu> <resourceLimitMemory></resourceLimitMemory> <envVars/> <ports/> <livenessProbe> <execArgs></execArgs> <timeoutSeconds>0</timeoutSeconds> <initialDelaySeconds>0</initialDelaySeconds> <failureThreshold>0</failureThreshold> <periodSeconds>0</periodSeconds> <successThreshold>0</successThreshold> </livenessProbe> </org.csanchez.jenkins.plugins.kubernetes.ContainerTemplate> </containers> <envVars/> <annotations/> <imagePullSecrets/> </org.csanchez.jenkins.plugins.kubernetes.PodTemplate> </templates> <serverUrl>https://kubernetes.default</serverUrl> <skipTlsVerify>false</skipTlsVerify> <namespace>jenkins</namespace> <jenkinsUrl>http://jenkins-ui.jenkins.svc.cluster.local:8080</jenkinsUrl> <jenkinsTunnel>jenkins-discovery.jenkins.svc.cluster.local:50000</jenkinsTunnel> <containerCap>10</containerCap> <retentionTimeout>5</retentionTimeout> <connectTimeout>0</connectTimeout> <readTimeout>0</readTimeout> <labels class="com.google.common.collect.ImmutableMap"> <entry> <string>jenkins</string> <string>slave</string> </entry> </labels> <maxRequestsPerHost>32</maxRequestsPerHost> </org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud>
And here is the basic format of the pipeline:
podTemplate(label: 'rok8s') { node('rok8s') { stage('Name') { container('rok8s') { //do stuff } } } }
- is duplicated by
-
JENKINS-49366 Nested podTemplate stopped working in 1.1.4
- Resolved