端点未使用吊舱的新IP地址更新

时间:2019-08-13 12:57:20

标签: amazon-web-services kubernetes aws-eks eks

平台:AWS EKS

头盔版本的输出:

Client: &version.Version{SemVer:"v2.12.3", GitCommit:"eecf22f77df5f65c823aacd2dbd30ae6c65f186e", GitTreeState:"clean"}
Server: &version.Version{SemVer:"v2.14.2", GitCommit:"a8b13cc5ab6a7dbef0a58f5061bcc7c0c61598e7", GitTreeState:"clean"}

kubectl版本的输出:

Client Version: version.Info{Major:"1", Minor:"15", GitVersion:"v1.15.1", GitCommit:"4485c6f18cee9a5d3c3b4e523bd27972b1b53892", GitTreeState:"clean", BuildDate:"2019-07-18T09:18:22Z", GoVersion:"go1.12.5", Compiler:"gc", Platform:"darwin/amd64"}
Server Version: version.Info{Major:"1", Minor:"12+", GitVersion:"v1.12.10-eks-2e569f", GitCommit:"2e569fd887357952e506846ed47fc30cc385409a", GitTreeState:"clean", BuildDate:"2019-07-25T23:13:33Z", GoVersion:"go1.10.8", Compiler:"gc", Platform:"linux/amd64"}
Cloud Provider/Platform (AKS, GKE, Minikube etc.): AWS EKS

问题: 在jenkins Pod重新启动后,该Pod获得了一个新的IP地址,ReadinesProbe应该更新端点,但是没有更新。

kubectl get endpoints
jenkins                                  <none>
jenkins-agent                            <none>

错误:

Readiness probe failed: Get http://192.168.0.109:8080/login: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

我可以从所有pod和worker节点成功访问以上URL,并且获得正确的Header。

这发生在头盔无法升级jenkins之后,然后我回滚了发行版,并且成功了(除了现在不更新端点) 现在,我需要手动编辑端点,以将端点指向吊舱的正确IP地址。

当前来自部署的ReadinesProbe是:

    readinessProbe:
      failureThreshold: 3
      httpGet:
        path: /login
        port: http
        scheme: HTTP
      initialDelaySeconds: 60
      periodSeconds: 10
      successThreshold: 1
      timeoutSeconds: 1

Jenkins窗格中的日志为:

Events:
  Type     Reason                  Age    From                                                  Message
  ----     ------                  ----   ----                                                  -------
  Normal   Scheduled               8m13s  default-scheduler                                     Successfully assigned default/jenkins-pod-id to <ip>.<region>.compute.internal
  Normal   SuccessfulAttachVolume  8m6s   attachdetach-controller                               AttachVolume.Attach succeeded for volume "jenkins"
  Normal   Pulling                 8m4s   kubelet, <ip>.<region>.compute.internal  pulling image "jenkins/jenkins:2.176.2-alpine"
  Normal   Pulled                  7m57s  kubelet, <ip>.<region>.compute.internal  Successfully pulled image "jenkins/jenkins:2.176.2-alpine"
  Normal   Created                 7m56s  kubelet, <ip>.<region>.compute.internal  Created container
  Normal   Started                 7m56s  kubelet, <ip>.<region>.compute.internal  Started container
  Normal   Pulling                 7m43s  kubelet, <ip>.<region>.compute.internal  pulling image "jenkins/jenkins:2.176.2-alpine"
  Normal   Pulled                  7m42s  kubelet, <ip>.<region>.compute.internal  Successfully pulled image "jenkins/jenkins:2.176.2-alpine"
  Normal   Created                 7m42s  kubelet, <ip>.<region>.compute.internal  Created container
  Normal   Started                 7m42s  kubelet, <ip>.<region>.compute.internal  Started container
  Warning  Unhealthy               6m40s  kubelet, <ip>.<region>.compute.internal  Readiness probe failed: Get http://<IP>:8080/login: net/http: request canceled (Client.Timeout exceeded while awaiting headers)

吊舱几乎立即获得了IP,但是启动容器需要几分钟。如何获取ReadinesProbe来更新端点,甚至获取ReadinesProbe日志?它正在AWS中运行,因此无法访问控制器以获取更多日志。

如果我足够快地更新端点,则ReadinesProbe不会失败,但这在下一次pod重启时没有帮助。

更新: 刚刚启用了EKS日志并获得了此信息:

deployment_controller.go:484] Error syncing deployment default/jenkins: Operation cannot be fulfilled on deployments.apps "jenkins": the object has been modified; please apply your changes to the latest version and try again

1 个答案:

答案 0 :(得分:1)

下面有帮助。 “就绪”探针仍然失败,但这是由于詹金斯花了90多岁才开始的。我将更新它。

     users                login               logout  hours
0   User A  2019-08-04 12:30:04  2019-08-04 13:04:42  00:34
1   User A  2019-08-04 09:19:03  2019-08-04 12:30:04  03:11
2   User A  2019-08-04 07:17:51  2019-08-04 08:59:58  01:42
3   User A  2019-08-04 08:59:58  2019-08-04 09:19:03  00:19
4   User A  2019-08-04 13:04:43  2019-08-04 15:30:04  02:25
5   User B  2019-08-04 14:35:17  2019-08-04 14:35:28  00:00
6   User B  2019-08-04 07:03:09  2019-08-04 10:56:23  03:53
7   User B  2019-08-04 10:56:32  2019-08-04 14:35:17  03:38
8   User B  2019-08-04 10:56:23  2019-08-04 10:56:32  00:00
9   User B  2019-08-04 14:35:29  2019-08-04 15:29:09  00:53
10  User C  2019-08-04 09:01:39  2019-08-04 09:19:43  00:18
11  User C  2019-08-04 14:19:56  2019-08-04 15:30:44  01:10
12  User C  2019-08-04 14:02:37  2019-08-04 14:19:56  00:17
13  User C  2019-08-04 11:36:26  2019-08-04 14:02:37  02:26
14  User C  2019-08-04 09:19:43  2019-08-04 11:00:04  01:40
15  User C  2019-08-04 06:56:02  2019-08-04 09:01:39  02:05