我正在尝试使用 Jenkins/Kubernetes 插件与 Jenkins 协调 docker 从属服务器。
我正在使用这个插件:https://github.com/jenkinsci/kubernetes-plugin https://github.com/jenkinsci/kubernetes-plugin
我的问题是所有从站都离线,因此作业无法执行:
我已经使用 minikube 在我的本地机器上以及我们的操作组托管的 K8 集群上尝试过此操作。我尝试过 Jenkins 1.9 和 Jenkins 2。我总是得到相同的结果。截图来自Jenkins 1.642.4,K8 v1.2.0
这是我的配置...请注意,当我单击“测试连接”时,我获得了成功。另请注意,我不需要任何凭据(这是我能看到的与记录示例的唯一区别)。
Jenkins 日志反复显示以下内容:
Waiting for slave to connect (11/100): docker-6b55f1b7fafce
Jul 20, 2016 5:01:06 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud$ProvisioningCallback call
Waiting for slave to connect (12/100): docker-6b55f1b7fafce
Jul 20, 2016 5:01:07 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud$ProvisioningCallback call
Waiting for slave to connect (13/100): docker-6b55f1b7fafce
Jul 20, 2016 5:01:08 PM INFO org.csanchez.jenkins.plugins.kubernetes.KubernetesCloud$ProvisioningCallback call
当我跑步时kubectl get events
我看到这个:
24s 24s 1 docker-6b3c2ff27dad3 Pod Normal Scheduled {default-scheduler } Successfully assigned docker-6b3c2ff27dad3 to 96.xxx.xx.159
24s 23s 2 docker-6b3c2ff27dad3 Pod Warning MissingClusterDNS {kubelet 96.xxx.xx.159} kubelet does not have ClusterDNS IP configured and cannot create Pod using "ClusterFirst" policy. Falling back to DNSDefault policy.
23s 23s 1 docker-6b3c2ff27dad3 Pod spec.containers{slave} Normal Pulled {kubelet 96.xxx.xx.159} Container image "jenkinsci/jnlp-slave" already present on machine
23s 23s 1 docker-6b3c2ff27dad3 Pod spec.containers{slave} Normal Created {kubelet 96.xxx.xx.159} Created container with docker id 82fcf1bd0328
23s 23s 1 docker-6b3c2ff27dad3 Pod spec.containers{slave} Normal Started {kubelet 96.xxx.xx.159} Started container with docker id 82fcf1bd0328
有任何想法吗?
更新:csanchez 建议的更多日志信息
➜ docker git:(master) ✗ kubectl get pods --namespace default -o wide
NAME READY STATUS RESTARTS AGE NODE
docker-6bb647254a2a4 1/1 Running 0 1m 96.x.x.159
➜ docker git:(master) ✗ kubectl log docker-6bafbac10b392
Jul 20, 2016 6:45:10 PM hudson.remoting.jnlp.Main$CuiListener status
INFO: Connecting to 96.x.x.159:50000 (retrying:10)
java.net.ConnectException: Connection refused
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
我得看看这个端口 50000 是用来做什么的?