Traefik v1.7.5 Kubernetes 1.10(在AWS上具有kubenet网络)
我正在使用Traefik作为Kubernetes入口控制器。我的Elixir应用程序在生产中一直运行良好,但是现在我正在使用puma网络服务器迁移Ruby服务。大多数请求(〜200 / s)均得到正确处理。但有些似乎导致Traefik重试120-200次。日志仅显示其中的100个:
172.58.x.x - - [11/Dec/2018:01:34:48 +0000] "PUT /users/123/game_results/234 HTTP/2.0" 500 21 "-" "okhttp/3.5.0" 610758 "www.example.com/" "http://100.96.13.37:5000" 329108ms
Rails日志中的相应错误为零。
如何解决此问题?
traefik配置模板(使用Helm):
defaultEntryPoints = ["http","https"]
debug = false
logLevel = "INFO"
# Do not verify backend certificates (use https backends)
InsecureSkipVerify = true
[entryPoints]
[entryPoints.traefik]
address = ":8080"
[entryPoints.http]
address = ":80"
compress = true
[entryPoints.http.redirect]
entryPoint = "https"
[entryPoints.https]
address = ":443"
compress = true
[entryPoints.https.proxyProtocol]
trustedIPs = ["0.0.0.0/0"]
[entryPoints.https.tls]
sniStrict = true
minVersion = "VersionTLS12"
[accessLog]
[api]
[kubernetes]
[metrics]
[metrics.prometheus]
buckets=[0.1,0.3,1.2,5.0]
entryPoint = "traefik"
[ping]
entryPoint = "http"
[acme]
email = "{{ .Values.acme.email }}"
storage = "{{ .Values.acme.storage }}"
acmeLogging = true
entryPoint = "https"
OnHostRule = true
caServer = "https://acme-v02.api.letsencrypt.org/directory"
[acme.dnsChallenge]
provider = "route53"
delayBeforeCheck = 5
{{- range .Values.acme.domains }}
[[acme.domains]]
main = "{{ .main }}"
{{- end }}
[consul]
endpoint = "traefik-consul.ingress:8500"
watch = true
prefix = "traefik"
[retry]
attempts = 1
编辑
我用调试级别的日志运行了足够长的时间,以查看是否有更多信息。不幸的是,我只有一堆:
msg = vulcand/oxy/forward: completed ServeHttp on request
Request = {"Method":"PUT","URL":{"Scheme":"http","Opaque":"","User":null,"Host":"100.96.13.37:5000","Path":"","RawPath":"","ForceQuery":false,"RawQuery":"","Fragment":""},"Proto":"HTTP/2.0","ProtoMajor":2,"ProtoMinor":0,"Header":{"Accept":["application/json version=1"],"Accept-Encoding":["gzip"],"Authorization":["Bearer abc"],"Content-Length":["138"],"Content-Type":["application/json; charset=utf-8"],"User-Agent":["okhttp/3.5.0"]},"ContentLength":138,"TransferEncoding":null,"Host":"www.example.com","Form":null,"PostForm":null,"MultipartForm":null,"Trailer":null,"RemoteAddr":"1.2.3.4:55773","RequestURI":"/users/123/game_results/123","TLS":null}
所以这似乎并没有帮助我理解问题。我还升级到Traefik 1.7.5,但这也无济于事。