浏览代码

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