Преглед на файлове

When the node process is down, don't exit

If the kubelet is down and we exit, we won't get restarted. Stay up
even if no kubelet processes are found. Also, use a simpler formulation
for finding the hyperkube process.
Clayton Coleman преди 6 години
родител
ревизия
71f227157a
променени са 1 файла, в които са добавени 8 реда и са изтрити 3 реда
  1. 8 3
      roles/openshift_node_group/files/sync.yaml

+ 8 - 3
roles/openshift_node_group/files/sync.yaml

@@ -129,11 +129,16 @@ spec:
                   fi
                 fi
               else
-                echo "error: The downloaded node configuration is invalid, exiting" 2>&1
-                exit 1
+                echo "error: The downloaded node configuration is invalid, retrying later" 2>&1
+                sleep 10 &
+                wait $!
+                continue
               fi
-              if ! kill $(pgrep -U 0 -f '^/usr/bin/hyperkube kubelet ' | head -n1); then
+              if ! pkill -U 0 -f '(^|/)hyperkube kubelet '; then
                 echo "error: Unable to restart Kubelet" 2>&1
+                sleep 10 &
+                wait $!
+                continue
               fi
             fi
             cp -f /tmp/.new /tmp/.old