k8s api服务器前面的Golang代理挂在kubectl delete pod上,带有';窗口更新';

k8s api服务器前面的Golang代理挂在kubectl delete pod上,带有';窗口更新';,go,kubernetes,proxy,amazon-eks,kubernetes-apiserver,Go,Kubernetes,Proxy,Amazon Eks,Kubernetes Apiserver,我正在编写一个位于K8SAPI服务器前面的基于Golang的L7代理。像这样的, kubectl网关/代理AWS EKS API服务器 常见的kubectl命令,如getpods,exec,run,apply,create等,工作正常。但是,对于kubectl delete pod,kubectl被卡住/挂起 通常,这些情况下,kubectl添加watch=true标志。在这种情况下,k8s服务器不发送结束\u流,因此我的代理卡在“读取帧窗口\u更新”中 有人见过这个吗?我正在查看client

我正在编写一个位于K8SAPI服务器前面的基于Golang的L7代理。像这样的,

kubectl网关/代理AWS EKS API服务器

常见的
kubectl
命令,如
getpods
exec
run
apply
create
等,工作正常。但是,对于
kubectl delete pod
kubectl
被卡住/挂起

通常,这些情况下,
kubectl
添加
watch=true
标志。在这种情况下,k8s服务器不发送
结束\u流
,因此我的代理卡在“读取帧窗口\u更新”中

有人见过这个吗?我正在查看
client go
kubernetes
repoa,以了解
kubectl
在设置
watch=true
时如何处理响应。如果有任何指点,我将不胜感激

下面是我的调试日志--

2019/10/11 00:50:19 http2:解码的hpack字段头字段:authority“=“myproxy.dev.net:8443”
2019/10/11 00:50:19 http2:解码的hpack字段头字段“:方法“=“获取”
2019/10/11 00:50:19 http2:解码的hpack字段头字段:路径“=”/api/v1/namespaces/guestbook/pods?字段选择器=元数据。名称%3Dshell测试和资源版本=1313006,监视=true”
2019/10/11 00:50:19 http2:解码的hpack字段头字段:scheme“=“https”
2019/10/11 00:50:19 http2:解码的hpack字段头字段“accept”=“application/json”
2019/10/11 00:50:19 http2:解码的hpack字段标题字段“用户代理”=“kubectl/v1.15.2(darwin/amd64)kubernetes/f627830”
2019/10/11 00:50:19 http2:解码的hpack字段头字段“授权”=“承载LS”
2019/10/11 00:50:19 http2:解码的hpack字段头字段“接受编码”=“gzip”
2019/10/11 00:50:19 http2:服务器读取帧头标志=END_-STREAM | END_-HEADERS-STREAM=5 len=86
2019/10/11 00:50:51 http2:服务器编码头“:状态“=”200”
2019/10/11 00:50:51 http2:服务器编码头“审计id”=“aaa-9682-d7b95a6daa0e”
2019/10/11 00:50:51 http2:服务器编码头“内容类型”=“应用程序/json”
2019/10/11 00:50:51 http2:服务器编码头“日期”=“2019年10月11日星期五00:50:19 GMT”
2019/10/11 00:50:51 http2:Framer 0xc0004beee0:写入的标头标志=结束\标头流=5 len=32
2019/10/11 00:50:51 http2:Framer 0xc0004beee0:写入的数据流=5 len=4096 DATA=“{”type\”:“MODIFIED\”,“object\”:{“kind\”:“Pod\”,“apiVersion\:“v1\”,“metadata\”:{“name\”:“shell test\,“namespace\”:“guestbook\”,“selfLink\”:“,“selfLink\”:“/api/v1/namespace/guestbook/pods/shell test\”,“uid\”,“uid\”,“uid\”:“baad702fed702\”,“baad2fe11c02\”,“ebe062\”,“sex02版本”:\“1313054\”,\“创建”(省略3840字节)
2019/10/11 00:50:51 http2:Framer 0xc0004beee0:写入的数据流=5 len=4096 DATA=“0}],“优先级”:0,“启用服务链接”:true;“状态”:状态:{“阶段”:运行“,”条件“:[{“类型”:初始化“,”状态“:”true“,”lastProbeTime\:null“,”lastportiontime\:”2019-10-11T00:48:21Z“,”准备就绪“,”状态“,”False\”lastProbeTime\”:空,\“lastTransit”(省略3840字节)
2019/10/11 00:50:51 http2:Framer 0xc0004beee0:read WINDOW_UPDATE stream=5 len=4 incr=6291
2019/10/11 00:50:51 http2:服务器读取帧窗口\u更新流=5 len=4 incr=6291

代理代码是使用
NewSingleHostReverseProxy在Golang中编写的,它终止TLS,修补与k8s api服务器的新连接。

我建议查看gRPC协议如何处理此问题。请使用etcd3查看
群集,默认情况下保留最近5分钟内的更改。当请求的watch操作失败,因为该资源的历史版本不可用,客户端必须通过识别状态代码410 Gone来处理该情况
2019/10/11 00:50:19 http2: decoded hpack field header field ":authority" = "myproxy.dev.net:8443"
2019/10/11 00:50:19 http2: decoded hpack field header field ":method" = "GET"
2019/10/11 00:50:19 http2: decoded hpack field header field ":path" = "/api/v1/namespaces/guestbook/pods?fieldSelector=metadata.name%3Dshell-test&resourceVersion=1313006&watch=true"
2019/10/11 00:50:19 http2: decoded hpack field header field ":scheme" = "https"
2019/10/11 00:50:19 http2: decoded hpack field header field "accept" = "application/json"
2019/10/11 00:50:19 http2: decoded hpack field header field "user-agent" = "kubectl/v1.15.2 (darwin/amd64) kubernetes/f627830"
2019/10/11 00:50:19 http2: decoded hpack field header field "authorization" = "Bearer LS<REDACTED>
2019/10/11 00:50:19 http2: decoded hpack field header field "accept-encoding" = "gzip"
2019/10/11 00:50:19 http2: server read frame HEADERS flags=END_STREAM|END_HEADERS stream=5 len=86
2019/10/11 00:50:51 http2: server encoding header ":status" = "200"
2019/10/11 00:50:51 http2: server encoding header "audit-id" = "aaa-9682-d7b95a6daa0e"
2019/10/11 00:50:51 http2: server encoding header "content-type" = "application/json"
2019/10/11 00:50:51 http2: server encoding header "date" = "Fri, 11 Oct 2019 00:50:19 GMT"
2019/10/11 00:50:51 http2: Framer 0xc0004beee0: wrote HEADERS flags=END_HEADERS stream=5 len=32
2019/10/11 00:50:51 http2: Framer 0xc0004beee0: wrote DATA stream=5 len=4096 data="{\"type\":\"MODIFIED\",\"object\":{\"kind\":\"Pod\",\"apiVersion\":\"v1\",\"metadata\":{\"name\":\"shell-test\",\"namespace\":\"guestbook\",\"selfLink\":\"/api/v1/namespaces/guestbook/pods/shell-test\",\"uid\":\"d2baa702-ebc0-11e9-06652f016772\",\"resourceVersion\":\"1313054\",\"creation" (3840 bytes omitted)
2019/10/11 00:50:51 http2: Framer 0xc0004beee0: wrote DATA stream=5 len=4096 data="0}],\"priority\":0,\"enableServiceLinks\":true},\"status\":{\"phase\":\"Running\",\"conditions\":[{\"type\":\"Initialized\",\"status\":\"True\",\"lastProbeTime\":null,\"lastTransitionTime\":\"2019-10-11T00:48:21Z\"},{\"type\":\"Ready\",\"status\":\"False\",\"lastProbeTime\":null,\"lastTransit" (3840 bytes omitted)
2019/10/11 00:50:51 http2: Framer 0xc0004beee0: read WINDOW_UPDATE stream=5 len=4 incr=6291
2019/10/11 00:50:51 http2: server read frame WINDOW_UPDATE stream=5 len=4 incr=6291