This script can be used to recover kube-controller-manager and kube-scheduler in the case where both of the deployed pods have failed to startup.
It assumes a 1.5 kubernetes cluster. The script will try to identify a node to place the rescue pod on using the label master. In 1.6 this label is node-role.kubernetes.io/master
If you want to use the script with a 1.6 cluster just provide the nodeName manually.
We have documentation around this process: https://coreos.com/tectonic/docs/latest/troubleshooting/controller-recovery.html
If you want to specify a host to use for the nodeName you can set it with the second argument so something like:
bash rescue-pod.sh kube-scheduler $HOSTNAME
Note that the requirement for the rescue pods are that they are deployed onto a node that has flannel running. These are part of the overlay by default. So in some cases you may want to deploy them to a worker.
There is also work being done to get this functionality built into bootkube. kubernetes-retired/bootkube#491