-
Type:
Bug
-
Resolution: Unresolved
-
Priority:
Major
-
Component/s: kubernetes-plugin
I am trying to log a SpringBoot-based batch application using containerLog, and I have written the code as follows:
Â
podTemplate(yaml: """
      apiVersion: v1
      kind: Pod
      spec:
       volumes:
       - name: log-storage
        emptyDir: {}      Â
       containers:
       - name: batch-worker
        image: ...
        imagePullPolicy: Always
        tty: true
        env:
         - name: JAVA_OPTS
          value: "-Dnetworkaddress.cache.negative.ttl=0 -Xms1G -Xmx1G -XX:+UseZGC -XX:TieredStopAtLevel=2 -XX:MaxGCPauseMillis=50 -XX:CompileThreshold=200 -XX:MaxDirectMemorySize=100m
-Dserver.port=8080 -Djava.security.egd=file:/dev/./urandom"
        volumeMounts:
        - mountPath: "/workspace/logs"
         name: log-storage
""") {
 node(POD_LABEL) {
  stage('Run Batch') {
   container('batch-worker') {
    containerLog(name: 'batch-worker')
   }
  }
 }
}
I want to see all logs through containerLog when the Jenkins pipeline job is written as above, but the Jenkins pipeline job ends with the logs only visible up to the middle.
I have tried various parameters like returnLog, sinceSeconds, etc., but the logs disappear in the middle, and the position changes each time I run the Jenkins job.
I am reporting this issue as a bug. Thank you.