Skip to content

Commit

Permalink
disable bpm, switch to standard monit process
Browse files Browse the repository at this point in the history
  • Loading branch information
poblin-orange committed Jan 24, 2020
1 parent 560f3d5 commit ed211c2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jobs/k3s-agent/monit
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
check process k3s-agent
with pidfile /var/vcap/sys/run/bpm/k3s-agent/k3s-agent.pid
start program "/var/vcap/jobs/bpm/bin/bpm start k3s-agent"
stop program "/var/vcap/jobs/bpm/bin/bpm stop k3s-agent"
with pidfile /var/vcap/sys/run/k3s-agent/pid
start program "/var/vcap/jobs/k3s-agent/bin/ctl start"
stop program "/var/vcap/jobs/k3s-agent/bin/ctl stop"
group vcap
42 changes: 42 additions & 0 deletions jobs/k3s-agent/templates/bin/ctl.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
#!/bin/bash

RUN_DIR=/var/vcap/sys/run/k3s-agent
LOG_DIR=/var/vcap/sys/log/k3s-agent
PIDFILE=${RUN_DIR}/pid

case $1 in

start)
mkdir -p $RUN_DIR $LOG_DIR
chown -R vcap:vcap $RUN_DIR $LOG_DIR

echo $$ > $PIDFILE


exec /var/vcap/packages/k3s/k3s agent \
-v 4 \
--data-dir=/var/vcap/store/k3s-agent \
--default-local-storage-path=/var/vcap/store/k3s-agent/local-storage-path \
--private-registry=/var/vcap/jobs/k3s-agent/config/registries.yaml \
--write-kubeconfig=/var/vcap/store/k3s-agent/kubeconfig.yml \
--write-kubeconfig-mode=755 \
>> $LOG_DIR/k3s-agent.stdout.log \
2>> $LOG_DIR/k3s-agent.stderr.log

;;

stop)
kill -9 `cat $PIDFILE`
rm -f $PIDFILE

;;

*)
echo "Usage: ctl {start|stop}" ;;

esac





0 comments on commit ed211c2

Please sign in to comment.