Learn KOP - EKS Cluster with AWS Karpenter Setup - Rafay Product Documentation

Part 1: Setup

What Will You Do

This is Part 1 of a multi-part, self-paced quick start exercise. In this part, you will perform a few "one-time" tasks required for cluster provisioning.


Step 1: Create Cloud Credentials

In this step, you will create a cloud credential which will be used for provisioning and managing the cluster resources in AWS. Cloud credentials provide privileges to programmatically interact with your Amazon AWS account so that the lifecycle of infrastructure associated with the Amazon EKS cluster can be managed.


Step 2: Download RCTL

The RCTL CLI allows you to programmatically interact with the controller enabling users to construct sophisticated automation workflows.


Step 3: Clone Git Repo

Declarative specs for the Amazon EKS cluster and other resources are available in a Git repository

git clone https://github.com/RafaySystems/getstarted.git

Step 4: Create IAM Role

In this step, you will create an IAM role and instance profile in AWS that will be used by Karpenter to manage nodes that it will create. This is not the same role that was used for the Cloud Credential in Step 1.

{
  "Version": "2012-10-17",
  "Statement": [\
    {\
      "Effect": "Allow",\
      "Principal": {\
        "Service": "ec2.amazonaws.com"\
      },\
      "Action": "sts:AssumeRole"\
    }\
  ]
}
aws iam create-role --role-name KarpenterNodeRole-Rafay --assume-role-policy-document file://"node-role-trust-relationship.json"
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy --role-name KarpenterNodeRole-Rafay
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonEKSWorkerNodePolicy --role-name KarpenterNodeRole-Rafay
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonEC2ContainerRegistryReadOnly --role-name KarpenterNodeRole-Rafay
aws iam attach-role-policy --policy-arn arn:aws:iam::aws:policy/AmazonSSMManagedInstanceCore --role-name KarpenterNodeRole-Rafay
aws iam create-instance-profile --instance-profile-name KarpenterNodeRole-Rafay
aws iam add-role-to-instance-profile --instance-profile-name KarpenterNodeRole-Rafay --role-name KarpenterNodeRole-Rafay

Recap

At this point, you have everything setup and configured to provision a Amazon EKS Cluster.