kubernetes/pkg/kubelet/apis/podresources
Francesco Romani 2ea47038b9 podresources: e2e: force eager connection
Add and use more facilities to the *internal* podresources client.
Checking e2e test runs, we have quite some
```
rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial unix /var/lib/kubelet/pod-resources/kubelet.sock: connect: connection refused": rpc error: code = Unavailable desc = connection error: desc = "transport: Error while dialing: dial unix /var/lib/kubelet/pod-resources/kubelet.sock: connect: connection refused"
```

This is likely caused by kubelet restarts, which we do plenty in e2e tests,
combined with the fact gRPC does lazy connection AND we don't really
check the errors in client code - we just bubble them up.

While it's arguably bad we don't check properly error codes, it's also
true that in the main case, e2e tests, the functions should just never
fail besides few well known cases, we're connecting over a
super-reliable unix domain socket after all.

So, we centralize the fix adding a function (alongside with minor
cleanups) which wants to trigger and ensure the connection happens,
localizing the changes just here. The main advantage is this approach
is opt-in, composable, and doesn't leak gRPC details into the client
code.

Signed-off-by: Francesco Romani <fromani@redhat.com>
2023-09-07 08:24:49 +02:00
..
grpc kubelet: podresources: DOS prevention with builtin ratelimit 2023-03-11 08:00:54 +01:00
testing kubelet podresources: extend List to support Dynamic Resources and implement Get API 2023-03-14 19:33:04 +02:00
client.go podresources: e2e: force eager connection 2023-09-07 08:24:49 +02:00
constants.go add kubelet grpc server for pod-resources service 2018-11-15 09:43:20 -08:00
server_v1_test.go node: podresources: getallocatable: move to GA 2023-07-12 14:11:22 +02:00
server_v1.go node: podresources: getallocatable: move to GA 2023-07-12 14:11:22 +02:00
server_v1alpha1_test.go Add ClassName to chekpoint state and in-memory cache 2023-03-14 19:33:04 +02:00
server_v1alpha1.go kubelet: podresources: pack parameters in a struct 2023-03-14 19:33:01 +02:00
types.go kubelet podresources: extend List to support Dynamic Resources and implement Get API 2023-03-14 19:33:04 +02:00