Destroying the AWS EKS cluster

When you are done with the AWS EKS cluster, you can release its resources.

Stop the Pod running nginx

$ kubectl delete pod nitro-nginx-pod

When issuing the delete pod option, the Anjuna Runtime will first send a SIGTERM signal to the main process inside the enclave, allowing it to do any needed activities to allow for a graceful termination before exiting. The main process has a grace period of 30 seconds for any termination activities. After the main process exits or the grace period expires, the Anjuna Runtime will perform any remaining termination activities and then destroy the enclave. If the grace period expires before the enclave finishes its activities, a message is sent to the Pod logs indicating that a forceful termination of the enclave occurred due to the expiration of the grace period.

You can also define a specific grace period other than 30 seconds or decide to destroy the enclave immediately. The Anjuna webhook sets the termination grace period for the enclave based on the terminationGracePeriodSeconds value in the Pod specification. To change the grace period to another value, you should change the value of the terminationGracePeriodSeconds in the Pod specification. A grace period of 0 (zero) seconds destroys the enclave immediately.

Anjuna does not support the Kubernetes kubectl delete command, when used with the --grace-period=<seconds> option for overriding the default value.

Stop the Anjuna Webhook

$ ./anjuna-k8s.sh --delete-webhook

Destroy the AWS EKS cluster

$ ./anjuna-k8s.sh --destroy-eks-cluster
You might have to invoke ./anjuna-k8s.sh –destroy-eks-cluster multiple times.