Java 8 agent on k8s with Java 11 controller

我在k8s上安装了jdk17的Jenkins,跑jdk8的动态pod报错

有没有大佬,遇见过,k8s部署的Jenkins高版本jdk11或者17,跑动态pod(jdk8)可以跑成功的?求docker-agent的dockerfile,谢谢

Have you ever met a leader who successfully runs a dynamic pod (jdk8) with Jenkins, a higher version jdk11 or 17 deployed on k8s? Request Docker Agent’s Dockerfile, thank you

That is not expected to work and is not supported, based on the requirement that Jenkins agents and the Jenkins controller must run the same Java version. The Jenkins controller sends Java class files from the controller to the agent for execution. If the controller is running Java 11 then it will send Java 11 classes to the agent. A Java 8 agent cannot run Java 11 classes.

https://www.jenkins.io/doc/administration/requirements/upgrade-java-guidelines/#jvm-version-on-agents

says:

All agents must be running on the same JVM version as the controller due to how controllers and agents communicate. If you’re upgrading your Jenkins controller to run on Java 11, you also need to upgrade the JVM on your agents.