简体   繁体   English

Jenkins Kubernetes 插件 URL 一段时间后连接失败

[英]Jenkins Kubernetes Plugin URL Connection Fails After Some Time

I run into a strange issue, as the title suggests.正如标题所示,我遇到了一个奇怪的问题。

I am running my Jenkins on a Kubernetes cluster on IBM Cloud.我正在 IBM Cloud 上的 Kubernetes 集群上运行我的 Jenkins。 I used the kubernetes plugin to configure a cloud and dynamically create a slave container to run jobs.我使用 kubernetes 插件来配置云并动态创建从容器来运行作业。

When I set up this cloud configuration, I provided the Kubernetes Public Service Endpoint URL (as I found on some other guides) of the cluster that Jenkins is on, as the Kubernetes URL. When I set up this cloud configuration, I provided the Kubernetes Public Service Endpoint URL (as I found on some other guides) of the cluster that Jenkins is on, as the Kubernetes URL. I can test it and it works successfully.我可以对其进行测试,并且可以成功运行。

Strangely, after running a few jobs, it starts to give me errors that It cant start the containers.奇怪的是,在运行了几个作业之后,它开始给我错误,它无法启动容器。

If I go back into the cloud configuration, and click "Test Connection", it now throws an error: Error testing connection https://<Public Service Endpoint URL>: null .如果我 go 回到云配置,然后单击“测试连接”,现在会抛出错误: Error testing connection https://<Public Service Endpoint URL>: null If I restart Jenkins, it works again.如果我重新启动 Jenkins,它会再次工作。

Any advise is much appreciated!任何建议都非常感谢! Thanks!谢谢!

I am not sure why it sometimes worked with using the Public Service Endpoint, but posting this for future people:我不确定为什么它有时可以使用公共服务端点,但将其发布给未来的人:

  1. I created clusterrolebinding as per this thread我根据这个线程创建了clusterrolebinding
  2. I created a credential (type: secret text) and used it with "Kubernetes URL" of https://kubernetes.default.svc.cluster.local for the cloud configuration我创建了一个凭证(类型:秘密文本)并将其与https://kubernetes.default.svc.cluster.local的“Kubernetes URL”一起用于云配置

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM