Browse Source
Kubernetes bay needs to be fully functional before notifying Heat to bring the stack to CREATE_COMPLETE. This patch added a systemd unit that keeps pinging the kube-apiserver and notify Heat once it goes through. Change-Id: Ib4fb22f3040d76d488c6cac6873d64b4d973ebb1 Closes-Bug: #1551824changes/54/301954/3
3 changed files with 38 additions and 7 deletions
@ -0,0 +1,36 @@
|
||||
#!/bin/sh |
||||
|
||||
. /etc/sysconfig/heat-params |
||||
|
||||
WC_NOTIFY_BIN=/usr/local/bin/wc-notify |
||||
WC_NOTIFY_SERVICE=/etc/systemd/system/wc-notify.service |
||||
|
||||
cat > $WC_NOTIFY_BIN <<EOF |
||||
#!/bin/bash -v |
||||
until curl -sf "http://127.0.0.1:8080/healthz"; do |
||||
echo "Waiting for Kubernetes API..." |
||||
sleep 5 |
||||
done |
||||
$WAIT_CURL --data-binary '{"status": "SUCCESS"}' |
||||
EOF |
||||
|
||||
cat > $WC_NOTIFY_SERVICE <<EOF |
||||
[Unit] |
||||
Description=Notify Heat |
||||
After=docker.service etcd.service |
||||
Requires=docker.service etcd.service |
||||
[Service] |
||||
Type=oneshot |
||||
ExecStart=$WC_NOTIFY_BIN |
||||
[Install] |
||||
WantedBy=multi-user.target |
||||
EOF |
||||
|
||||
chown root:root $WC_NOTIFY_BIN |
||||
chmod 0755 $WC_NOTIFY_BIN |
||||
|
||||
chown root:root $WC_NOTIFY_SERVICE |
||||
chmod 0644 $WC_NOTIFY_SERVICE |
||||
|
||||
systemctl enable wc-notify |
||||
systemctl start --no-block wc-notify |
Loading…
Reference in new issue