Pods in status Terminating and Job not deleted after a Security Update

Roberto Sarati 5 Reputation points
2024-08-05T07:50:12.39+00:00

I've a AKS cluster composed by 2 nodes. The version of k8s is 1.29.6.

Every week, during Sunday, I've scheduled a Security update (Node security channel type = Node Image).

On the cluster there are a lot of cronjobs, few of them scheduled every 1 minute.

It happens that, for some reason, during nodes update the running scheduled job doesn't complete, the pod stays in "Terminating" status and no more pods are created because the job is not deleted.

Now I've manually deleted the job and:

  • cronjob is now able to run the jobs as expected
  • I still have a Terminating Pod I cannot delete (every if I specify wait=false, force, grace-period parameters)

So... how I can avoid this situation (and how I can delete these pods?).

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,141 questions
{count} vote

1 answer

Sort by: Most helpful
  1. Nikhil Duserla 2,665 Reputation points Microsoft Vendor
    2024-08-21T08:20:33.06+00:00

    Hi @Roberto Sarati,

    Thank you for sharing the information.

    It seems that the issue might be due to the pod you’re trying to delete having a QoS class set to Burstable. Kubernetes automatically assigns a QoS class based on the resource requests and limits when the pod is created, and this QoS class cannot be changed later.

    To resolve this, please update the pod’s QoS class to BestEffort before attempting to delete it. This adjustment should help you avoid the immutability error.

    If you have any further queries, do let us know.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.