Suddenly my local Hyper-V CM environment stopped working. What is the reason?

Hi,

Suddenly my local Hyper-V CM environment stopped working. A lot of pods are being created. What is the reason?

BRGDS

Max Pieslinger

Hello Max,

Thank you for reaching out to us.
This is a memory issue on the VM. To fix this you need to delete all the “Evicted” pods and any pod with a status different from “Running”.

To do this, please run the following command on the VM:

kubectlget pods --all-namespaces | grep Terminating | awk ‘{print $2}’ | xargs -I {}kubectl delete pod {} --grace-period=0 --force --namespace={}

Additional commands that can help:

kubectldelete pods -n cmftraining11 --field-selector=status.phase=Failed

kubectldelete pods -n=cmftraining11 --field-selector=status.phase=Succeeded

****And to force delete **pods **one by one (in case some of the pods don’t get delete by the previous commands):

kubectldelete pods --grace-period=0 --force -n cmftraining11

After cleaning the pods, you can scale them down:

kubectl scale deployment --all --replicas 0 --namespace cmftraining11


With the pods down, run the following to free memory and clean any memory issue:

sudo lvextend -l+50%FREE /dev/mapper/ubuntu–vg-ubuntu–lv

sudo resize2fs/dev/mapper/ubuntu–vg-ubuntu–lv

Scale the pods up again:
kubectl scale deployment --all --replicas 1 --namespace cmftraining11


This should do the trick. If it issue persists we need to repeat the process but instead of scaling the pods down we will need to remove the stack repeat the commands to clear the memory and then deploy the MES infrastructure again.

We hope this helps.

Kind Regards,

Luis Pereira