Panfactum LogoPanfactum
Bootstrapping Stack

Suspending and Resuming the EKS Clusters

Objective

Shut down an idle cluster to save costs without deleting cluster data, with the ability to fully recover.

Background

When the script is executed, the following resources are suspended:

  1. EKS Controller Nodes
  2. EKS Karpenter Nodes
  3. EC2 NAT Nodes
  4. Load Balancers and IP Addresses

These resources are considered non-essential during periods when the cluster is not actively in use and can be safely suspended to reduce AWS charges to ~$3 a day.

Prerequisites

Before running the suspend or resume script, the following must be completed:

  1. Set up AWS Root Profile: Ensure you have configured an AWS root profile that the script will use to interact with the necessary AWS services.

  2. Update the .kube/config.user.yaml: Run pf-update-kube to ensure your Kubernetes configuration is up to date and ready for cluster operations.

Suspending a Cluster

To suspend the AWS resources:

  1. Run pf-eks-suspend.
  2. The script will prompt you to select an EKS cluster that has been set up.
  3. Once the cluster is confirmed, the script proceeds to shut down the defined resources associated with the selected cluster.

Resuming a Cluster

To resume the suspended resources:

  1. Run pf-eks-resume.
  2. The script will prompt you to select an EKS cluster that has previously been suspended.
  3. The script will validate that the cluster was suspended using pf-eks-suspend by checking for the panfactum.com/suspended=true tag. If this tag is not found, the resume process will fail, ensuring only properly suspended clusters are resumed.