From 268b617b84888a41d66199961dfc5b8687897b47 Mon Sep 17 00:00:00 2001 From: Robert Bailey Date: Wed, 25 Mar 2015 23:24:24 -0700 Subject: [PATCH] Add local babysitting for the kube-proxy. --- cluster/saltbase/salt/monit/init.sls | 12 ++++++++++-- cluster/saltbase/salt/monit/kube-proxy | 9 +++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 cluster/saltbase/salt/monit/kube-proxy diff --git a/cluster/saltbase/salt/monit/init.sls b/cluster/saltbase/salt/monit/init.sls index a53ada3667a..e51300684a5 100644 --- a/cluster/saltbase/salt/monit/init.sls +++ b/cluster/saltbase/salt/monit/init.sls @@ -30,14 +30,22 @@ monit: - user: root - group: root - mode: 644 + +/etc/monit/conf.d/kube-proxy: + file: + - managed + - source: salt://monit/kube-proxy + - user: root + - group: root + - mode: 644 {% endif %} monit-service: service: - running - - name: monit + - name: monit - watch: - - pkg: monit + - pkg: monit - file: /etc/monit/conf.d/* {% endif %} diff --git a/cluster/saltbase/salt/monit/kube-proxy b/cluster/saltbase/salt/monit/kube-proxy new file mode 100644 index 00000000000..ede37c4cfa9 --- /dev/null +++ b/cluster/saltbase/salt/monit/kube-proxy @@ -0,0 +1,9 @@ +check process kube-proxy with pidfile /var/run/kube-proxy.pid +group kube-proxy +start program = "/etc/init.d/kube-proxy start" +stop program = "/etc/init.d/kube-proxy stop" +if does not exist then restart +if failed port 10249 + protocol HTTP request "/healthz" + with timeout 10 seconds + then restart