This is the first step to implement checkpointing and restoring of
container and containers starting from the lowest layer in the kubelet.
Signed-off-by: Adrian Reber <areber@redhat.com>
The utils found in pkg/kubelet/cri/remote/utils are the same as the
ones in pkg/kubelet/utils, with the difference that the latter have
had a few improvements recently.
This commit removes the duplicated code.
The remote runtime implementation now supports the `verbose` fields,
which are required for consumers like cri-tools to enable multi CRI
version support.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
We should not touch the dockershim ahead of removal and therefore
default to `v1alpha2` CRI instead of `v1`.
Partially reverts changes from https://github.com/kubernetes/kubernetes/pull/106501
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This patch makes the CRI `v1` API the new project-wide default version.
To allow backwards compatibility, a fallback to `v1alpha2` has been added
as well. This fallback can either used by automatically determined by
the kubelet.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
This implements a stream cleanup when using portforwardings. Before
applying this patch, the streams []httpstream.Stream within
`spdy/connection.go` would fill-up for each streaming request. This
could result in heavy memory usage. Now we use the stream identifier to
keep track of them and finally remove them again once they're no longer
needed.
Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
Based on the comments in this file, it seems like these import
restrictions were originally meant for the kubelet CRI streaming
package. This commit moves the import restrictions to
pkg/kubelet/cri/streaming so that pkg/kubelet/cri can import internal
packages like pkg/probe/exec
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This change also involves adding a custom error type for probe timeouts
so that the kubelet exec prober can distinguish between failed probes
that have exited or probes that have timed out.
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>
This fixes a bug where the exec timeouts are not respected with
containerd
Exec prober expects a utilexec.CodeExitError on failed probes, otherwise
the prober returns 'Unknown' and a non-nil error which the kubelet throws
away. As a temporary fix, ExecSync as part of the CRI remote runtime
should return utilexec.CodeExitError when the grpc error code is
DeadlineContextExceeded. This ensure the exec prober registers exec
timeouts as real probe failures to the kubelet. We should also add a
TimededError type to k8s.io/utils/exec since it doesn't really make
sense to use CodeExitError for exec time outs.
Signed-off-by: Andrew Sy Kim <kim.andrewsy@gmail.com>