![]()
The Luna cluster autoscaler can now run with SUSEâs RKE2 clusters on AWS EC2 nodes.
Compared to EKS, RKE2 on EC2 offers more operational control, better customization, improved flexibility, and federation across different infrastructures: EC2, on-prem, and edge. Luna 1.2.19 can create and manage RKE2 worker nodes, allowing you to scale your RKE2 compute resources more efficiently than with the basic Kubernetes cluster autoscaler. How to configure Luna for RKE2
Here are the steps to configure Luna with RKE2 with Amazon EC2. Here weâll assume that the RKE2 cluster already exists, and that Luna will get installed in the elotl namespace.
Create a Docker Hub secret
If you arenât using the trial version of Luna, youâll have to configure the Docker Hub secret to fetch the images.
This secret will be referenced later when Luna is deployed.
Create EC2 credentials for Luna
Unlike EKS, RKE2 doesnât support AWS built-in credential mechanisms to authenticate a service account attached to the pod. This means Luna has to rely on an access key to use the EC2 API.
Create the access key in the AWS console and input its information into a generic secret like this:
Because these credentials can be read by anyone with access to the cluster, itâs important to restrict the permissions of the AWS access key. The EKS installation script has a file named role_policies.json listing all the IAM permissions required by Luna; you can use these policies to restrict the IAM permissions on the AWS access key role.
Find the subnets, security groups, and node instance profile for the cluster
With EKS, Luna automatically queries the subnets and security groups based on the cluster tags, but with RKE2, these tags may not exist.
You can find the subnets with the clusterâs VPC in the AWS console. To get the security groups and node instance profile, take a look at an RKE2 control or worker node in the cluster using the AWS EC2 console. On the instance page, go to the âSecurityâ tab. The security group IDs are listed in the âSecurity Groupsâ section. To get the node instance profile, click on the âIAM roleâ link and look for âInstance profile ARNâ on the IAM role page. The node instance profile ARN format is arn:aws:iam::<account ID>:instance-profile/<node-instance-profile>, only use the <node-instance-profile> part when configuring Luna. Get the node token and the clusterâs IP address
The agent token is used to authenticate the nodes with the cluster. To get the agent token from the kube-apiserver pod, first find the apiserver pods on the RKE2 cluster:
Then exec into one of the pods and print the agent-token file:
To get the serverâs API, list the control plane nodes and use one of the nodeâs internal IP:
Alternatively, you can use the load balancerâs IP if you are using a high availability solution with the control plane.
Create Helm values file
Now letâs put it all together and create the Helm values file for the Luna chart.
Weâll use a base Ubuntu image and create the user data script required to set up the RKE2 worker node to work with Luna:
Deploy Luna with Helm and test
Once the Helm values file is created, you can deploy Luna from its Helm chart with the Helm values file:
Once the deployment is running, you can test the installation by creating a test deployment like this:
The nginx pod will initially be in the Pending state and Luna nodes will come up to run them:
Conclusion
Supporting RKE2 clusters on AWS EC2 marks a significant milestone for Luna, delivering advanced autoscaling to more Kubernetes users in the Amazon cloud. By following the configuration best practices shared above, your team can deploy Luna confidently, unlocking new opportunities for cost efficiency and operational control in your RKE2 clusters.
Author: Henry Precheur (Senior Staff Engineer, Elotl) Comments are closed.
|