0
0
AWScloud~5 mins

Deploying workloads on EKS in AWS - Time & Space Complexity

Choose your learning style9 modes available
Time Complexity: Deploying workloads on EKS
O(n)
Understanding Time Complexity

When deploying workloads on EKS, it is important to understand how the time to deploy grows as you add more workloads.

We want to know how the number of deployments affects the total time and operations needed.

Scenario Under Consideration

Analyze the time complexity of the following operation sequence.


aws eks create-cluster --name my-cluster --role-arn role-arn --resources-vpc-config subnetIds=subnet-123,subnet-456
aws eks create-nodegroup --cluster-name my-cluster --nodegroup-name nodegroup1 --subnets subnet-123 subnet-456 --instance-types t3.medium
aws eks update-kubeconfig --name my-cluster
kubectl apply -f workload1.yaml
kubectl apply -f workload2.yaml
kubectl apply -f workloadN.yaml
    

This sequence creates an EKS cluster, adds a node group, configures access, and deploys multiple workloads.

Identify Repeating Operations

Identify the API calls, resource provisioning, data transfers that repeat.

  • Primary operation: Applying each workload manifest with kubectl apply.
  • How many times: Once per workload, so it repeats for each workload deployed.
How Execution Grows With Input

Each workload requires a separate apply operation, so as you add more workloads, the number of operations grows directly with the number of workloads.

Input Size (n)Approx. Api Calls/Operations
1010 apply operations
100100 apply operations
10001000 apply operations

Pattern observation: The total operations increase in a straight line as workloads increase.

Final Time Complexity

Time Complexity: O(n)

This means the time to deploy grows directly in proportion to the number of workloads you deploy.

Common Mistake

[X] Wrong: "Deploying multiple workloads happens all at once, so time stays the same no matter how many workloads."

[OK] Correct: Each workload requires its own deployment step, so more workloads mean more steps and more time.

Interview Connect

Understanding how deployment time grows with workload count helps you plan and explain scaling in cloud environments confidently.

Self-Check

"What if we deployed all workloads using a single combined manifest file? How would the time complexity change?"