In this procedure, you complete the steps to create an Amazon EKS cluster directly from the Spot console and an Ocean object to manage the cluster worker nodes.

Prerequisites

  1. Ensure you have an IAM user in your AWS account with both Console and Programmatic Access credentials. If you do not have one,  you can follow this AWS procedure to create one or refer to your account administrator for the necessary permissions.
  2. Connect your AWS account to Spot
  3. Install awscli 1.16.18+ and configure AWS credentials.
  4. Install kubectl (Amazon EKS-vended).
  5. Install aws-iam-authenticator (only for awscli versions below 1.16.156).

Get Started

  1. In the left menu of the Spot console, click Ocean/Cloud Clusters, and click Create Cluster.
  2. When the Create Ocean Cluster page appears, you will need to choose a use case template. Under Create a New Cluster, click Create an EKS Cluster.

Complete the steps described in the Create Cluster page. The steps are also described below.

Step 1: Create A Spotinst Token Or Use An Existing One

Click Generate Token or use an existing Spot token. If you already have a token, you can paste it in the text box. The Spot token will be used later in the process to authenticate the Spot Kubernetes Controller with Ocean SaaS, so be sure to save a copy in a safe place.

Step 2: Set The Generated EKS Cluster Parameters

Fill in general details including Cluster Name, Region, and the Key Pair used for the EC2 instances.

Step 3: Provision Resources

Provision the cluster resources using a CloudFormation template.

  1. Use existing VPC & Subnets. Mark this box to launch CloudFormation with your existing VPC & Subnets. Leave unchecked to launch within a new VPC that CloudFormation will create for you.
  2. Click Launch CloudFormation Stack.

To launch the stack mark the checkbox at the bottom confirming CloudFormation will create IAM resources, and click Create stack.

Before you can continue to the next step, CloudFormation must complete creation of all of the resources in the EKS stack. You can check the status on the CloudFormation page that opens.

Step 4: Install the Spot Kubernetes controller on the newly created EKS cluster

  1. Connect your workstation to the EKS cluster by copying the command shown in Step 4 of the Create page and running it in your command-line interface. Note that the command must include the Ocean Cluster Name that you entered previously.
    Tip: Just click on the command to copy it.
  2. Verify that kubectl is connected to your EKS cluster by running the next command shown:
    kubectl get svc
  3. To install the controller on the EKS cluster, run the predefined script from your command line.

Step 5: Update AWS Authentication Config-Map

  1. Download the AWS authenticator configuration map:
    curl -O https://amazon-eks.s3-us-west-2.amazonaws.com/1.10.3/2018-06-05/aws-auth-cm.yaml
  2. In the aws-auth-cm.yaml file, replace the <ARN of instance role (not instance profile)> snippet with the NodeInstanceRole value from the Outputs tab of EKS cluster CloudFormation Stack.
  3. Apply the updated aws-auth-cm.yaml to the cluster:
    kubectl apply -f aws-auth-cm.yaml

Note: Do not modify any other lines in this file.

That’s it! Ocean will now manage the worker nodes, optimizing cluster resource utilization and maximizing savings with Spot instances.

Troubleshooting

  • If you receive the error "aws-iam-authenticator": executable file not found in $PATH, then your kubectl is not configured for Amazon EKS. For more information, see Configure kubectl for Amazon EKS.
  • You can list your cluster nodes with the following command:
    kubectl get nodes.