我的jenkins作为Pod在kubernetes(在私有云上)上运行,我试图通过配置jenkins slave使用kaniko构建映像。但是我一直在收到错误消息,说连接被拒绝。
我通过提供有关kubernetes集群和jenkins主pod链接的详细信息,在jenkins上配置了kubernetes插件。我还已经为jenkins配置了具有所需权限的服务帐户。
kubectl logs -f pods/kaniko-8bzq8-gbtgp jnlp
Warning: JnlpProtocol3 is disabled by default, use JNLP_PROTOCOL_OPTS to alter the behavior
Jul 10, 2019 11:01:42 PM hudson.remoting.jnlp.Main createEngine
INFO: Setting up agent: kaniko-8bzq8-gbtgp
Jul 10, 2019 11:01:42 PM hudson.remoting.jnlp.Main$CuiListener <init>
INFO: Jenkins agent is running in headless mode.
Jul 10, 2019 11:01:43 PM hudson.remoting.Engine startEngine
INFO: Using Remoting version: 3.29
Jul 10, 2019 11:01:43 PM hudson.remoting.Engine startEngine
WARNING: No Working Directory. Using the legacy JAR Cache location: /home/jenkins/.jenkins/cache/jars
Jul 10, 2019 11:01:43 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Locating server among [https://jenkins:8080/]
Jul 10, 2019 11:01:43 PM hudson.remoting.jnlp.Main$CuiListener error
SEVERE: Failed to connect to https://jenkins:8080/tcpSlaveAgentListener/: Connection refused (Connection refused)
java.io.IOException: Failed to connect to https://jenkins:8080/tcpSlaveAgentListener/: Connection refused (Connection refused)
........
.....
预期结果是,在jenkins中运行构建后,应预配置kaniko代理并构建docker映像。