Duplicate Server Entries in Controller

May 2017
Updated Oct 2021

When adding servers (MFEL, MFSP etc) to Controller using the configure.sh script, if you have already added a server once, and run the script again, you can end up with the same server listed twice, where one will show as not contactable.
Looking at the servers page from the Controller view (http://ipaddress:8080)
If a server has been added twice, you will see it listed twice, but with two unique names, and the same IP Address, one will report as being failed.
To remove the failed server, you need the name of that server (MFEL2 in the above example). You can then use the following command from an SSH session to remove it.

curl -XDELETE http://ipaddress:8080/api/servers/servername
Where:
ipaddress=ipaddress of the controller
servername=the name of the failed server listed in controller

For orchestrated deployments, this will not work, you have to use the following:
Login to the node with MDT installed (normally the first HA node)
Execute the following:

kubectl -n mediakind get pods (to find exact name of unified-ui pod)

We are looking for the name of the unified-ui pod.
On my test system it was called unified-ui-576c87cbbd-vd42h. Your system will be different.
Now execute the following, using your unified-ui name to edit the pod, ui is the name of the internal pod.

kubectl -n mediakind exec -it unified-ui-576c87cbbd-vd42h -c ui /bin/sh

Execute the following to list the servers:

curl api-gateway:8080/api/servers

Now you can delete the server using the following:

curl -X DELETE api-gateway:8080/api/servers/sky-01

(replace sky-01 with the server name you wish to delete)