Merge "Notify Heat only if kube-apiserver is running"
This commit is contained in:
commit
87f0799f95
|
@ -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
|
|
@ -319,13 +319,7 @@ resources:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
properties:
|
properties:
|
||||||
group: ungrouped
|
group: ungrouped
|
||||||
config:
|
config: {get_file: fragments/wc-notify-master.sh}
|
||||||
str_replace:
|
|
||||||
template: |
|
|
||||||
#!/bin/bash -v
|
|
||||||
wc_notify --data-binary '{"status": "SUCCESS"}'
|
|
||||||
params:
|
|
||||||
wc_notify: {get_attr: [master_wait_handle, curl_cli]}
|
|
||||||
|
|
||||||
disable_selinux:
|
disable_selinux:
|
||||||
type: OS::Heat::SoftwareConfig
|
type: OS::Heat::SoftwareConfig
|
||||||
|
|
|
@ -72,6 +72,7 @@ if [[ "$COE" == "kubernetes" ]]; then
|
||||||
remote_exec $SSH_USER "sudo ip a" ipa.log
|
remote_exec $SSH_USER "sudo ip a" ipa.log
|
||||||
remote_exec $SSH_USER "sudo netstat -an" netstat.log
|
remote_exec $SSH_USER "sudo netstat -an" netstat.log
|
||||||
remote_exec $SSH_USER "sudo df -h" dfh.log
|
remote_exec $SSH_USER "sudo df -h" dfh.log
|
||||||
|
remote_exec $SSH_USER "sudo journalctl -u wc-notify --no-pager" wc-notify.log
|
||||||
elif [[ "$COE" == "swarm" ]]; then
|
elif [[ "$COE" == "swarm" ]]; then
|
||||||
SSH_USER=fedora
|
SSH_USER=fedora
|
||||||
remote_exec $SSH_USER "sudo systemctl --full list-units --no-pager" systemctl_list_units.log
|
remote_exec $SSH_USER "sudo systemctl --full list-units --no-pager" systemctl_list_units.log
|
||||||
|
|
Loading…
Reference in New Issue