Connecting to the terminal of a running container
You can use the Managed Service for Kubernetes management console to connect to a container running in a pod and run commands without restarting or stopping the container. This approach is equivalent to kubectl exec -it <pod_name> -- <shell_name> and enables you to inspect logs during debugging, restart services, and modify configurations.
To connect to the terminal:
-
In the management console
, navigate to the folder dashboard and select Managed Service for Kubernetes. -
Click the cluster name and select
Workload in the left-hand panel. -
Click the pod name.
-
In the top-right corner, click
Terminal.The terminal will open at the bottom of the screen.
-
Note that for multi-container pods, the terminal will open for the first container specified under
spec.containersin the pod manifest.To switch to a shell of another container, select it from the drop-down menu in the top-left corner of the terminal window.
The container’s default command shell will open.
Warning
The following error occurs when attempting to access the terminal of containers deployed from minimal or distroless images
Connection failed. Terminal shell is not found
In such cases, we recommend you use ephemeral containers