skip to Main Content

while I scale down EC2 node count into zero (basically EC2 gets terminated)under each ASG of EKS cluster and scale up again , then dynamically provisioned EBS(PV) volume gets deleted , though "Delete on termination" flag is set to "No" in case of EBS(PV). why its happening ? suppose if my cluster has currently 3 nodes and if I down 1 node or two nodes then EBS volume persists. But when I down all 3 nodes under ASG then EBS volume gets deleted. Need to know the root cause of it . Thanks in advance.

I tried by checking different scenario like terminating one EC2 /two EC2 instances , but EBS volume still there. Checked PV reclaim policy was mentioned as Delete, but PV lifecycle doesn’t depend on Nodes termination so I ignored this logic.

2

Answers


  1. This should not be the case, I myself downscale our worker nodes to 0 many times and never have the PVs got deleted, can you check the Volumes in AWS EC2 dashboard and see if they are actually getting deleted from there or not?

    Login or Signup to reply.
  2. Checked PV reclaim policy was mentioned as Delete…

    It should be Retain:

    apiVersion: v1
    kind: PersistentVolume
    metadata:
      name: ...
    spec:
      persistentVolumeReclaimPolicy: Retain  # <-- Ensure "Retain" is used
      ...
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search