shareinto opened a new issue, #8144: URL: https://github.com/apache/apisix/issues/8144
### Current Behavior I use apisix as the proxy of k8s-apiserver, when I use kubectl node-shell plugin(https://github.com/kvaps/kubectl-node-shell), there will be an error of timed out wait for condition ``` k node-shell $NODE ──(Fri,Oct21)─┘ spawning "nsenter-uvxhk8" on "..." error: timed out waiting for the condition pod "nsenter-uvxhk8" deleted ``` It is normal if nginx ingress controller is used as a proxy I tracked kubectl's requests and found that it uses k8s watch interface to discover pod status changes,like that ``` /api/v1/namespaces/default/pods?allowWatchBookmarks=true&fieldSelector=metadata.name%3Dtest&resourceVersion=0&timeout=9m8s&timeoutSeconds=548&watch=true ``` when proxy is apisix ,the response data was truncated ,like this: ``` {"type":"DELETED","object":{"kind":"Pod","apiVersion":"v1","metadata":{"name":"test","namespace":"default","selfLink":"/api/v1/namespaces/default/pods/test","uid":"aa7b70dd-cf23-4f05-aff4-3563b65ee3e0","resourceVersion":"926306705","creationTimestamp":"2022-10-21T08:38:12Z","deletionTimestamp":"2022-10-21T08:38:22Z","deletionGracePeriodSeconds":0,"labels":{"run":"test"},"annotations":{"kubernetes.io/psp":"eks.privileged"},"managedFields":[{"manager":"kubectl-run","operation":"Update","apiVersion":"v1","time":"2022-10-21T08:38:12Z","fieldsType":"FieldsV1","fieldsV1":{"f:metadata":{"f:labels":{".":{},"f:run":{}}},"f:spec":{"f:containers":{"k:{\"name\":\"test\"}":{".":{},"f:args":{},"f:image":{},"f:imagePullPolicy":{},"f:name":{},"f:resources":{},"f:stdin":{},"f:stdinOnce":{},"f:terminationMessagePath":{},"f:terminationMessagePolicy":{},"f:tty":{}}},"f:dnsPolicy":{},"f:enableServiceLinks":{},"f:restartPolicy":{},"f:schedulerName":{},"f:securityContext":{},"f:terminationGracePeriodSec onds":{}}}},{"manager":"kubelet","operation":"Update","apiVersion":"v1","time":"2022-10-21T08:38:54Z","fieldsType":"FieldsV1","fieldsV1":{"f:status":{"f:conditions":{"k:{\"type\":\"ContainersReady\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Initialized\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:status":{},"f:type":{}},"k:{\"type\":\"Ready\"}":{".":{},"f:lastProbeTime":{},"f:lastTransitionTime":{},"f:message":{},"f:reason":{},"f:status":{},"f:type":{}}},"f:containerStatuses":{},"f:hostIP":{},"f:phase":{},"f:podIP":{},"f:podIPs":{".":{},"k:{\"ip\":\"10.0.253.5\"}":{".":{},"f:ip":{}}},"f:startTime":{}}}}]},"spec":{"volumes":[{"name":"default-token-kgzrj","secret":{"secretName":"default-token-kgzrj","defaultMode":420}}],"containers":[{"name":"test","image":"alpine","args":["sh"],"resources":{},"volumeMounts":[{"name":"default-token-kgzrj","readOnly":true,"mountPath":"/var/run/secrets /kubernetes.io/serviceaccount"}],"terminationMessagePath":"/dev/termination-log","terminationMessagePolicy":"File","imagePullPolicy":"Always","stdin":true,"stdinOnce":true,"tty":true}],"restartPolicy":"Always","terminationGracePeriodSeconds":30,"dnsPolicy":"ClusterFirst","serviceAccountName":"default","serviceAccount":"default","nodeName":"ip-10-0-253-23.us-east-2.compute.internal","securityContext":{},"imagePullSecrets":[{"name":"image-pull-secret"}],"schedulerName":"default-scheduler","tolerations":[{"key":"node.kubernetes.io/not-ready","operator":"Exists","effect":"NoExecute","tolerationSeconds":300},{"key":"node.kubernetes.io/unreachable","operator":"Exists","effect":"NoExecute","tolerationSeconds":300}],"priority":0,"enableServiceLinks":true,"preemptionPolicy":"PreemptLowerPriority"},"status":{"phase":"Running","conditions":[{"type":"Initialized","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-10-21T08:38:12Z"},{"type":"Ready","status":"False","lastProbeTime":nu ll,"lastTransitionTime":"2022-10-21T08:38:54Z","reason":"ContainersNotReady","message":"containers with unready status: [test]"},{"type":"ContainersReady","status":"False","lastProbeTime":null,"lastTransitionTime":"2022-10-21T08:38:54Z","reason":"ContainersNotReady","message":"containers with unready status: [test]"},{"type":"PodScheduled","status":"True","lastProbeTime":null,"lastTransitionTime":"2022-10-21T08:38:12Z"}],"hostIP":"10.0.253.23","podIP":"10.0.253.5","podIPs":[{"ip":"10.0.253.5"}],"startTime":"2022-10-21T08:38:12Z","containerStatuses":[{"name":"test","state":{"terminated":{"exitCode":137,"reason":"Error","startedAt":"2022-10-21T08:38:19Z","finishedAt":"2022-10-21T08:38:52Z","containerID":"docker://c9e1261fec4914138cd2aac0348c25f757b7468cab401db78075fcdac75f7dec"}},"lastState":{"terminated":{"exitCode":0,"reason":"Completed","startedAt":"2022-10-21T08:38:13Z","f ``` And this doesn't happen on nginx ingress controller So is this a bug, or is there something wrong with the configuration, please help ### Expected Behavior kubectl node-shell spawn normaly ### Error Logs ``` k node-shell $NODE ──(Fri,Oct21)─┘ spawning "nsenter-uvxhk8" on "..." error: timed out waiting for the condition pod "nsenter-uvxhk8" deleted ``` ### Steps to Reproduce 1, use apisix as k8s-apiserver proxy 2. use kubectl node-shell plugin spawn a node ### Environment - APISIX version (run `apisix version`): - Operating system (run `uname -a`): - OpenResty / Nginx version (run `openresty -V` or `nginx -V`): - etcd version, if relevant (run `curl http://127.0.0.1:9090/v1/server_info`): - APISIX Dashboard version, if relevant: - Plugin runner version, for issues related to plugin runners: - LuaRocks version, for installation issues (run `luarocks --version`): -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
