If you have an existing EKS cluster, we recommend creating a new node group specifically for Imageless Kubernetes. This guide will walk through the steps needed to create the node group and configure the cluster with both Terraform and eksctl. To run on EKS, each node in the node group will need to:Documentation Index
Fetch the complete documentation index at: https://flox-robinbrantley-containers.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
- Install Flox
- Install the Flox
containerdruntime shim - Register the shim with
containerd - Register the shim with Kubernetes
NoteAdditional information on
nodeadm and bootstrapping with user data can be found in the EKS documentation.Versioning
The installation procedure described here will install the latest version of the Flox CLI and runtime shim that is available when the nodes are created. Any time you replace a node, either of these may be updated to the latest version.Node Configuration via Terraform
Terraform Prerequisites
To create the node group, you will need:- Subnets for the node group to use
- IDs for cluster and node security groups
- The cluster’s service CIDR (i.e. the range from which cluster services will receive IPs)
Terraform node group creation
This example will use the eks-managed-node-group submodule of terraform-aws-eks, but it can also be used standalone, regardless of how the cluster was defined in Terraform. The following Terraform configuration can be used to provision a node group with the Flox runtime; see comments for guidance on each input. This example assumes you already have Terraform configuration for a cluster including the AWS provider.NoteSee the upstream module documentation for details on adding this node group to an autoscaling scheme (e.g. Cluster Autoscaler, Karpenter).
nodegroup.tf
cloudinit_pre_nodeadm section is used by nodeadm to bootstrap the node as it starts up.
First, it installs Flox on the node using the latest rpm package, which will then be used to create pods backed by Flox environments.
Then, the flox activate command executes an installer that detects the node’s running containerd version, downloads the correct version of the Flox runtime shim to match, and installs it to /usr/local/bin on the node.
Finally, it uses a NodeConfig manifest to leverage nodeadm’s native functionality to update the node’s containerd configuration to be aware of the Flox runtime.
The labels section is used to give each Flox-enabled node an identifier to ensure that Flox pods only target these nodes.
The label is used in concert with a RuntimeClass in the next section to make Kubernetes aware of the Flox runtime.
Node Configuration via eksctl
For clusters created using methods other than Terraform (e.g. AWS management console), we recommend using eksctl to create the Flox node group.eksctl is a utility developed by AWS to create and manage EKS clusters, including clusters it did not create.
For our purposes, eksctl greatly simplifies appending custom configuration to the base launch template.
eksctl Prerequisites
- A running EKS cluster with at least one existing node group
- List of VPC subnet IDs to be used for the new node group
- Connectivity to the cluster API (i.e.
kubectlis usable)
Installation
Cluster access
First, installeksctl and ensure that you have access to the cluster:
- Install
eksctl(e.g.flox install eksctl). - Set AWS credentials in your environment (e.g. copy
AWS_ACCESS_KEY_IDandAWS_SECRET_ACCESS_KEYfrom management console). - Run
eksctl get clusterand ensure the cluster is visible via the command below.
eksctl node group creation
Next, we’ll create aClusterConfig manifest that will be used to create the Flox node group.
NoteSee the eksctl documentation for guidance on additional parameters such as IAM configuration and autoscaler support.
ClusterConfig with eksctl create nodegroup -f nodegroup.yaml. You can also visualize the changes before deployment with eksctl create nodegroup --dry-run -f nodegroup.yaml.
nodegroup.yaml
Kubernetes Configuration
A RuntimeClass is used to expose the runtime to Kubernetes such that it can be utilized to create pods. TheRuntimeClass needs to be applied to the cluster, where the nodeSelector matches the label given to the node group above
RuntimeClass.yaml
kubectl apply -f RuntimeClass.yaml.
The nodeSelector ensures that Flox pods will only be scheduled on nodes with the Flox runtime installed.
Conclusion
Once the node group is running, you are ready to create pods using the Flox runtime. A samplePod manifest is available in the Introduction, but any Kubernetes resource that creates a pod (e.g. Deployment) can be used by setting the runtimeClassName parameter to flox.