How to open a console session to a running container within a pod

Overview

Engine Yard Kontainers (EYK) users can connect to a running container instance from the CLI for purposes of executing supported commands.

Solution

Follow these steps to connect to a running pod:

  1. Use the EYK ssologin command to log in and ensure you are connected to the correct cluster. See Steps 3 and 4 in the Getting Started with Engine Yard Kontainers step-by-step guide for additional information on this step.
    Successful_cli_login2.png
    Note: If you need to move your application to a new cluster, follow the steps outlined in Moving an application to a new cluster before proceeding.
  2. Obtain the pod name by running the following command:
    eyk ps -a appname
    The output will display the pod name in the format <appname>-<type>-<pod>
    e.g. qzapp-web-866587cc47-kfj4j as shown in the below example for the EYK sample ruby-quiz app:
    Example:
    Obtain_pod_name.png
  3. Obtain a console session to a running container within a pod using the command:
    eyk ps:console <podname> <type> <appname> <command> [options]
    Example:
    eyk ps:console qzapp-web-866587cc47-kfj4j web qzapp /bin/bash
    Output:
    Successful_console_session.png
  4. The root@qzapp-web-866587cc47-kfj4j:/app#  CLI prompt confirms successful initiation of a console session to a running container and ready to execute commands. 
  5. You may exit the session by typing exit and hitting enter twice.
    Exit_session.png
Note: The eyk ps console session is not meant to be a full-featured CLI console similar to what you get when using SSH. See Problems running console commands when connected through 'eyk ps:console' for more information on known limitations.

Comments

Article is closed for comments.