Skip to content
This repository has been archived by the owner on Feb 29, 2024. It is now read-only.

Commit

Permalink
Add healthcheck for ODL container
Browse files Browse the repository at this point in the history
This patch adds healtcheck logic for ODL container.

Change-Id: I75af8119f495e2eb1b617b9773dde7abb6ea1727
Closes-Bug: #1713632
  • Loading branch information
Jaanki committed Sep 20, 2017
1 parent b46a35a commit 83eeb18
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
7 changes: 7 additions & 0 deletions container-images/tripleo_kolla_template_overrides.j2
Expand Up @@ -326,6 +326,13 @@ RUN mkdir -p /openstack && \
HEALTHCHECK CMD /openstack/healthcheck
{% endblock %}

{% block opendaylight_footer %}
RUN mkdir -p /openstack && \
ln -s /usr/share/openstack-tripleo-common/healthcheck/opendaylight-api /openstack/healthcheck && \
chmod -R a+rx /openstack
HEALTHCHECK CMD /openstack/healthcheck
{% endblock %}

{% block rabbitmq_footer %}
RUN yum install -y pacemaker pacemaker-remote pcs libqb resource-agents && mkdir /etc/libqb

Expand Down
11 changes: 11 additions & 0 deletions healthcheck/opendaylight-api
@@ -0,0 +1,11 @@
#!/bin/bash

. ${HEALTHCHECK_SCRIPTS:-/usr/share/openstack-tripleo-common/healthcheck}/common.sh

username=$(get_config_val /opt/opendaylight/etc/org.jolokia.osgi.cfg DEFAULT org.jolokia.user admin)
password=$(get_config_val /opt/opendaylight/etc/org.jolokia.osgi.cfg DEFAULT org.jolokia.password admin)
bind_host=$(grep -r '<Set name="host">' "/opt/opendaylight/etc/jetty.xml" | awk -F'>' FNR==1'{print $2}')
bind_port=$(grep -r '<Property name="jetty.port" default=' "/opt/opendaylight/etc/jetty.xml" | awk FNR==2'{print $3}' | cut -d'"' -f2)
odl_check_url=restconf/operational/network-topology:network-topology/topology/netvirt:1

healthcheck_curl -u $username:$password http://$bind_host:$bind_port/$odl_check_url

0 comments on commit 83eeb18

Please sign in to comment.