R
RunPod3w ago
Cemal

Terminate worker

Hi y'all, is there any way to terminate specific worker (serverless) via api or as additional control in handler return? I do not want to refresh the worker i just want to terminate at my special occasions.
5 Replies
Jason
Jason3w ago
terminate? like can you give me an example or more details when do you want it to happen
Cemal
CemalOP3w ago
i just wanna delete that worker. sometimes some i see some workers has problems like they does not take the job or no cuda etc. idk maybe region or specific worker related, it dosent happen often but when it happens in one of my active workers my jobs keep failing. I am sending a notification myself when catch the error and delete manually. It would be so nice if that just fixed itself.
Jason
Jason3w ago
hmm i see, maybe you can use runpodctl pod terminate pod id every worker has pod id
ozzie
ozzie3w ago
I had a similar question recently which may be helpful to your question: https://discord.com/channels/912829806415085598/1351676903022530570 TL;DR is that there is a REST endpoint to delete an endpoint by id
nathaniel
nathaniel3w ago
that's not the same as terminating a pod/worker by id. I am shortly adding an update to rest api which will let you pull the list of workers for your endpoint, and once you have the ids of those you can use the delete/terminate pod endpoint just as you can for normal pods will keep you updated on that first part, the second part can already be done if you know the worker's pod id by hitting DELETE https://rest.runpod.io/v1/pods/thePodId it sounds like you are polling through separate means for the error which will tell you the pod id, so yeah you can just use the rest api's delete pod endpoint https://rest.runpod.io/v1/docs#tag/pods/DELETE/pods/{podId} ok, the update I was talking about is now released, set includeWorkers=true for get and list endpoints to show current workers

Did you find this page helpful?