How do I troubleshoot namespaces in a terminated state in my Amazon EKS cluster?
"I tried to delete a namespace in my Amazon Elastic Kubernetes Service (Amazon EKS) cluster. However, the namespace is stuck in the "Terminating" status."
"I tried to delete a namespace in my Amazon Elastic Kubernetes Service (Amazon EKS) cluster. However, the namespace is stuck in the "Terminating" status.Short descriptionTo delete a namespace, Kubernetes must first delete all the resources in the namespace. Then, it must check registered API services for the status. A namespace gets stuck in Terminating status for the following reasons:The namespace contains resources that Kubernetes can't delete.An API service has a False status.Resolution1.    Save a JSON file like in the following example:kubectl get namespace TERMINATING_NAMESPACE -o json > tempfile.jsonNote: Replace TERMINATING_NAMESPACE with the name of your stuck namespace.2.    Remove the finalizers array block from the spec section of the JSON file:"spec": {        "finalizers": [            "kubernetes"        ]    }After you remove the finalizers array block, the spec section of the JSON file looks like this:"spec" : {    }3.    To apply the changes, run the following command:kubectl replace --raw "/api/v1/namespaces/TERMINATING_NAMESPACE/finalize" -f ./tempfile.jsonNote: Replace TERMINATING_NAMESPACE with the name of your stuck namespace.4.    Verify that the terminating namespace is removed:kubectl get namespacesRepeat these steps for any remaining namespaces that are stuck in the Terminating status.Related informationWhat is Amazon EKS?Namespaces (on the Kubernetes site)Follow"