Connect to Bastion and Install Software Packages

Using the bastion's public IP address and the private part of your key pair, you will connect to the Bastion, install required tools, and perform several configuration tasks.

In examples, we assume the keypair is stored in ~/.ssh

To connect to Bastion and install required software packages:

Run the following command:

ssh -i ~/.ssh/<key pair name>.pem centos@<Bastion Public IP address>

For example:
ssh -i ~/.ssh/srgdemo.pem centos@18.184.151.208

Installing kubectl

Next, you will need to install the kubectl tool for Kubernetes. AWS continually updates the kubectl version. You must use the version corresponding to the Kubernetes version used for the cluster (with a tolerance of one minor version).

Check the ITOM Platform: What's New page for the supported Kubernetes version for your version of CDF. Use only release and major version, for example, 1.15.10 would correspond to 1.15.

You will be managing your EKS cluster with this version of kubectl, so its version must match the version required by CDF.

To install kubectl:

  1. Record the required Kubernetes version in the AWS worksheet.

In the following list of commands, find the URL for the kubectl version on the page Installing kubectl. Then replace the curl -o kubectl... command below with the correct command from that page.
  1. (CentOS only) If you have not installed the epel package, run the following command:

    sudo yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
  2. Run the following commands to configure the bastion:

    sudo yum install -y vim docker mc nfs-utils unzip jq htop ncdu nload nano xauth firefox
    • CentOS deployment. Install the required tools packages:

      sudo groupadd docker
      sudo usermod -a -G docker root
      sudo usermod -a -G docker centos
      sudo systemctl start docker
      sudo systemctl enable docker
      curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
      chmod +x ./kubectl
      sudo mv kubectl /usr/bin
      curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
      unzip awscliv2.zip
      sudo ./aws/install -i /usr/local/aws -b /usr/local/bin
      
    • Amazon Linux 2 bastion. Install the required tools packages:

      sudo yum -y update
      sudo yum install -y make gcc perl-core pcre-devel wget zlib-devel
      sudo groupadd docker
      sudo usermod -a -G docker root
      sudo usermod -a -G docker ec2-user
      sudo systemctl start docker
      sudo systemctl enable docker
      
      curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
      
      chmod +x ./kubectl
      sudo mv kubectl /usr/bin
  3. Update the AWS CLI version by running these commands:

    aws --version
    which aws
    sudo rm /usr/bin/aws
    sudo rm /usr/bin/aws_completer
    aws --version
    
    curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip"
    
    unzip awscliv2.zip
    sudo ./aws/install -i /usr/local/aws -b /usr/local/bin
    hash aws
    aws --version
    

Configuring AWS CLI

To configure AWS CLI:

Connect to the bastion machine, and run the following command:

aws configure

You will be prompted for the same security data, region, and output format when you previously configured AWS CLI for the local host. Repeat the process outlined for AWS CLI configuration.

Next Steps: Download Installation Packages