Skip to main content

Connect an Existing EKS Cluster

Ocean is a managed infrastructure service for Kubernetes that automatically adjusts infrastructure capacity and size to meet the needs of pods, containers, and applications.

To enable Ocean to start managing your EKS cluster, you need to connect the cluster to Spot. This page includes the procedures to connect an existing EKS cluster to Ocean using the Spot console.

Prerequisites

Add Required Permissions

To import the configurations of your EKS Node Groups, ensure the following permissions are added to the Spot Policy associated with the role of the Spot.io account.

connect-eks-cluster-02

  1. Go to the IAM role in your AWS account that is associated with the Spot.io account. It can be found in the Account details.
  2. In the AWS IAM console, add the following permissions to your Spot policy. These permissions are used to get the Labels and Taints of the Node Groups.
{ 
"Sid": "AccessEks",
"Action": ["eks:ListClusters", "eks:DescribeNodegroup", "eks:ListNodegroups"],
"Effect": "Allow",
"Resource": ["*"]
}

Get Started

To connect an existing cluster, complete the following steps:

  1. In the left menu of the Spot Console, choose Ocean.
  2. Click Cloud Clusters and then click Create Cluster.

connect-eks-cluster-04

  1. Click Elastic Kubernetes Service (EKS) and Continue.

connect-eks-cluster-01

Step 1: Choose EKS Cluster

The Ocean Cluster Name that is created in this step will also be used as a Cluster Identifier.

connect-eks-cluster-00
  1. Choose the region where the cluster is running.
  2. Choose the EKS cluster you wish to import. The Ocean Cluster Name will automatically generate according to the EKS cluster name and can be edited. We recommend that you give the cluster you are importing the same name as the original cluster. This will make identifying the Ocean cluster associated with your EKS cluster easier.
  3. The Ocean name will also be used as a Cluster Identifier, which is the unique key used to connect the Ocean SaaS to the Kubernetes cluster. Click Next.

Step 2: VNG Template

In this step, choose one of your EKS Node Groups you want to use as a template for your other custom VNGs.

connect-eks-cluster-03

The selected EKS Node Group’s configuration will be imported to the template VNG and will be used for other custom VNGs unless explicitly set in a VNG. For example, all VNGs inherit the image set of the EKS Node Group you imported to the Template VNG unless the custom VNG is set to a different image.

Template Configuration

Complete the VNG template configuration as described below.

  1. Choose a Node Group in the dropdown.
  2. Confirm or change the configuration in the Template Configuration if needed.

Instance Types

All instance types are selected by default to allow Ocean to choose the best types for your workload. It is recommended that you use the automatic configurations.

There are three options:

  • Automatic Selection (recommended) - All instance types are selected to allow Ocean to choose the best types for your workload.
  • Manual Selection – Select the instance family/types for the Ocean cluster’s whitelist.
  • Advanced Selection – Use advanced filters to select specific instance families.

Use the Instance Type guide for more information.

Tags

Set the tags of the node group. Ensure the EKS required tag appears -

"kubernetes.io/cluster/<clusterName>":"owned". 

Step 3: Virtual Node Groups

In this step, you can import the existing Node Groups to Ocean by importing their configuration to Ocean custom VNGs.

Consolidate Node Groups into a Single VNG

There are two ways to consolidate node groups:

Node groups with different capacity types (Spot and OD)

Using Ocean VNGs, you can use only one VNG by setting the Spot percentage so that a specific percentage of the infrastructure will run on an OD instance and a specific percentage on a Spot instance. By default, the VNG is running on spot instances, and if no spot is available it would fall back to OD instances.

connect-eks-cluster-09

Node groups that run on different instance types

Ocean is a pod-driven Autoscaler that launches the node that best fits the pod's requirements. Therefore, in Ocean’s VNG, you can run the workloads in the same VNG, and Ocean will scale only the instance type that fits the pod.

How to consolidate:

Since Ocean provides the flexibility to configure multiple types of infrastructure configurations in the same Ocean cluster, we recommend consolidating node groups that contain similar or the same configurations to one VNG according to the suggestions below:

If you have two or more node groups with similar configurations, mark one for import and unmark the others. (In the example below, the two node groups shown will be consolidated into a single VNG called Intelligent-COM-Frozen-46.)

connect-eks-cluster-10

Choose EKS Node Group to Import

You can define which EKS Node Group or Node Groups will be imported to a VNG by marking the checkbox by the node group. Once you have chosen the node groups, Ocean imports the compute configurations of the chosen EKS node groups. A virtual node group will be created with the same configurations. A separate VNG is created for each node group you marked.

If no VNG is chosen, Ocean will create a VNG based on the Template VNG.

  1. Mark the Node Group or Node Groups you want to import in the checkbox.
connect-eks-cluster-06
  1. To change the VNG’s configuration, click the Virtual Node Group’s name you want to configure in the corresponding VNG Name row of the Virtual Node Group you marked. The edit VNG page opens.

connect-eks-cluster-12

Enter your changes for the following parameters:

  • Node Group Name
  • Image
  • Security Groups
  • Subnets
  • Instance Profile
  • Root Volume Size (GiB)
  • User Data (Startup Script on the right)

Node Selection

This section displays the labels and taints of the imported node group.

If the required permissions were not set, the labels and taints cannot be imported. In this case you should add the required labels and taints.

Instance Types

All instance types are selected by default to grant Ocean the ability to choose the best market. It is recommended to use automatic configurations. You can select Manual Selection if an adjustment is required. Use the Instance Type guide for more details.
You can customize the following parameters:

  • Advanced:
    • Spot % - Percentage of total instances in this VNG that should be Spot instances. The rest will be on-demand instances. This setting can only be used in a VNG configuration if it is not already set in the cluster configuration (i.e., using the attribute cluster.strategy.spotPercentage).
    • Restrict Scale Down
    • Block Device Mappings
  • Tags — If an additional tag is added to the VNG, the Template VNG tags are overridden. Make sure to add the required EKS tag.
  • Headroom

Step 4: Connectivity

The Connectivity page provides steps for installing the Ocean Controller and establishing the connection between the Ocean SaaS and the cluster.

aws-connectivity-for-v2-t2

Complete the following steps:

  1. Create a Spot Programmatic token (or use an existing one) and copy it to the text box.

  2. Install the Ocean Controller: Leverage our script for a swift, Helm-based installation of the Ocean Controller Deployment.

  3. Click Test Connectivity to ensure the controller's functionality. The test should take approximately two minutes to complete.

  4. Click Next.

Step 5: Review

Review all the Ocean settings you have configured. Click Create to finish or use the JSON or Terraform-generated templates to create the Ocean cluster using other tools.

Ocean will now ensure the most cost-effective capacity and sizing possible for your cluster.

Learn how to Migrate your Workloads to Ocean.