If you do not enable SSH Logon when you create a cluster, you cannot connect to the cluster by using SSH or kubectl. To use SSH to connect to a cluster after it has been created, you can manually attach elastic IP addresses to your ECS instances, configure security group rules, and open the SSH port 22.

Background information

For how to enable SSH Logon when you create a cluster, see Bind an Elastic IP address to the API server during cluster creation.

Procedure

  1. Log on to the Container Service console.
  2. In the left-side navigation pane, click Clusters to go to the Clusters page.
  3. Select the target cluster and click Manage in the Actions column.
  4. In the Cluster Resources section, click the ID of the public SLB instance. You are redirected to the Instance Details page of the SLB instance.
  5. In the left-side navigation pane, choose Instances > Server Load Balancer. Find the target SLB instance and click Configure Listener in the Actions column.
  6. Add an SSH listener. Add an SSH listener. For more information, see Add a TCP listener.
  7. After the listener is created, you can use SSH to connect to your cluster through the public IP of the SLB instance.
    Use SSH to connect to a cluster