Kubernetes Host: Add the Public SSH Key

About this task

NOTE

This procedure is only needed if you are adding a Kubernetes Worker host with SSH key-based access.

If you are using the agent installation as described in Agent-Based Kubernetes Host Installation, skip this procedure and go to Kubernetes Host: Select the Hosts.

You must upload the public key to the Kubernetes Worker hosts before uploading the corresponding private key to add those hosts via the web interface. The following procedure assumes that you created the keys using a tool like ssh-keygen.

CAUTION The key must be in PEM format.

Procedure

  1. Execute the command ssh-keygen -m PEM -t rsa # and then follow the onscreen instructions.
  2. Copy the id_rsa.pub file to the Kubernetes Worker host.
  3. Add the public key to the list of authorized keys for the root user. Execute a command similar to the following:
    cat id_rsa.pub >> /root/.ssh/authorized_keys
  4. Test the key by executing the ssh -i id_rsa root@<worker> command from the Controller host (where <worker> is the host name or IP address of the Kubernetes Worker host).
    This command should log the root user into the Kubernetes Worker host without being prompted for a password.
  5. Proceed to Kubernetes Host: Select the Hosts.