Deploy an Ubuntu Pro EKS cluster — using Pro tokens

This guide shows how to deploy an EKS cluster with Ubuntu Pro nodes using Ubuntu Pro tokens and EC2 launch templates.

This guide covers creating Pro clusters using tokens only. If you prefer getting a pre-activated Ubuntu Pro AMI with metered billing, please check Deploy an Ubuntu Pro EKS cluster - using a Pro AMI.

For FIPS clusters, please note that only Ubuntu 22.04 LTS has NIST-validated FIPS modules at the moment.

Prerequisites

  • eksctl: Check the instructions to install eksctl

  • Packer version 1.8.1 or newer installed. (Packer installation instructions). Only needed if you want to enable FIPS for the cluster nodes.

  • Your AWS access key ID and secret access key

  • An Ubuntu Pro token

Prepare the cluster for deployment

The steps needed for deploying the cluster depend on whether you need to enable FIPS or not.

When FIPS is not enabled, you can use one of the existing Ubuntu EKS AMIs and customize it using cloud-init’s ubuntu-pro module during deployment.

For this deployment, you’ll also need to have an existing launch template on AWS.

Update user-data in launch template

Go to the EC2 console and create a Launch Template for your nodes. This Launch Template will be used to create the Node Groups.

On the advanced section of your launch template (user-data section), copy the following code.

Make sure to replace the <PRO_TOKEN> field with your Pro token and <CLUSTER_NAME> with your cluster’s name

MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="==MYBOUNDARY=="

--==MYBOUNDARY==
Content-Type: text/cloud-config; charset="us-ascii"
ubuntu_advantage:
token: <PRO_TOKEN>
enable:
- esm

--==MYBOUNDARY==
Content-Type: text/x-shellscript; charset="us-ascii"

#!/bin/bash
sudo /etc/eks/bootstrap.sh <CLUSTER_NAME>

--==MYBOUNDARY==--

Cloud-init will use this user-data to attach an Ubuntu Pro subscription on the node and bootstrap the AWS EKS cluster.

Create the eksctl config file

You’re now ready to deploy the EKS cluster with Ubuntu Pro nodes. To do so, start by creating a cluster.yaml with the following content

apiVersion: eksctl.io/v1alpha5
kind: ClusterConfig
metadata:
name: <CLUSTER_NAME>
region: us-east-1
version: <YOUR_EKS_VERSION>

Change <CLUSTER_NAME> and <YOUR_EKS_VERSION> accordingly.

Note that Ubuntu 22.04 LTS (non pro) covers EKS versions up to 1.32. For newer EKS versions please use Ubuntu 24.04 LTS or use the already pre activated Pro AMIs which provide broader coverage: Deploy an Ubuntu Pro EKS cluster - using a Pro AMI).

Add the following content to your file.

managedNodeGroups:
- name: ng-procluster
desiredCapacity: 2
launchTemplate:
  id: <YOUR_LAUNCH_TEMPLATE_ID>
  version: "1"

This config file will allow you to create an EKS cluster using the launch template from above, with two nodes. Remember to replace <YOUR_LAUNCH_TEMPLATE_ID> accordingly.

For further cluster customization check out eksctl details.

Create the EKS cluster

To create the EKS cluster, run eksctl create nodegroup -f cluster.yaml (you might need to specify the --profile option if you have multiple profiles). When this command finishes, see the nodes with

$ kubectl get nodes

NAME                                           STATUS   ROLES    AGE     VERSION
ip-xxx-xxx-xx-xxx.us-east-1.compute.internal   Ready    <none>   2m45s   v1.32.x
ip-xxx-xxx-x-xx.us-east-1.compute.internal     Ready    <none>   2m45s   v1.32.x