Help Center/ Cloud Application Engine/ User Guide/ Instance Management/ Logging In to a Container Using CloudShell
Updated on 2025-10-22 GMT+08:00

Logging In to a Container Using CloudShell

If unexpected problems occur when you use a container, you can use CloudShell to log in to the container for debugging.

Constraints

  • Only instances in the Running state support remote login.
  • Remote login is available in CN North-Beijing4, CN East-Shanghai1, CN South-Guangzhou, AP-Singapore, ME-Riyadh, TR-Istanbul, AF-Johannesburg, and LA-Mexico City2.
  • Using CloudShell to access containers is only available in the following regions: CN North-Beijing1, CN North-Beijing4, CN North-Ulanqab1, CN East-Shanghai1, CN East-Shanghai2, CN South-Guangzhou, CN Southwest-Guiyang1, and AP-Singapore. For details, see the console.

    For other regions, use the remote login function developed by CAE to access the container.

  • CloudShell does not support account or sub-project agencies.
  • If you use the CloudShell remote login function for the first time, log in to CloudIDE as an administrator and grant the CloudIDE AgencyAccess, VPC Administrator, and VPCEndpoint Administrator permissions to CloudIDE. Authorization method:

    After you log in to the CAE console as an administrator and use the CloudShell remote login function for the first time, click Agree on the service authorization page. After the authorization is complete, CloudIDE creates an agency named cloudide_admin_trust on IAM. To ensure normal service usage, do not delete or modify cloudide_admin_trust when using CloudIDE. Permissions are described as follows: CloudIDE AgencyAccess: permissions to create tenant agencies on CloudIDE.

    • VPC Administrator: VPC administrator.
    • VPCEndpoint Administrator: VPC Endpoint allows you to privately connect your VPC to a supported service.

Remote Login

  1. Log in to CAE.
  2. Choose Instance List.
  3. Select the target environment and application from the drop-down lists in the upper part of the page, and click the target component.
  4. Select the target instance and click Remote Login in the Operation column. A shell is required for executing commands. The common shells are /bin/bash (rich functions) and /bin/sh (simple functions). You need to select a shell based on the deployed container. If the deployed container supports both /bin/sh and /bin/bash, /bin/bash is recommended.
  5. In the displayed dialog box, select the command to be executed.

    • /bin/sh
    • /bin/bash

  6. Click Confirm.
  7. Switch to CloudShell, initialize kubectl, and run the kubectl exec command to log in to the container.

    Wait until the kubectl exec command is automatically executed.

    Figure 1 Running the kubectl exec command to log in to the container

  8. Run commands in CloudShell as required to view and debug your container.