aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/vid/values.yaml
blob: 9b1748f50709db6e5a75d7ec2a0afe51ddc60ebf (plain)
1
2
3
4
5
6
7
8
nsPrefix: onap
pullPolicy: Always
nodePortPrefix: 302
image:
  readiness: oomk8s/readiness-check:1.0.0
  mariadb: nexus3.onap.org:10001/library/mariadb:10
  vid: nexus3.onap.org:10001/openecomp/vid:v1.1.1
  filebeat: docker.elastic.co/beats/filebeat:5.5.0
.String.Delimiter */ .highlight .sd { color: #e6db74 } /* Literal.String.Doc */ .highlight .s2 { color: #e6db74 } /* Literal.String.Double */ .highlight .se { color: #ae81ff } /* Literal.String.Escape */ .highlight .sh { color: #e6db74 } /* Literal.String.Heredoc */ .highlight .si { color: #e6db74 } /* Literal.String.Interpol */ .highlight .sx { color: #e6db74 } /* Literal.String.Other */ .highlight .sr { color: #e6db74 } /* Literal.String.Regex */ .highlight .s1 { color: #e6db74 } /* Literal.String.Single */ .highlight .ss { color: #e6db74 } /* Literal.String.Symbol */ .highlight .bp { color: #f8f8f2 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #a6e22e } /* Name.Function.Magic */ .highlight .vc { color: #f8f8f2 } /* Name.Variable.Class */ .highlight .vg { color: #f8f8f2 } /* Name.Variable.Global */ .highlight .vi { color: #f8f8f2 } /* Name.Variable.Instance */ .highlight .vm { color: #f8f8f2 } /* Name.Variable.Magic */ .highlight .il { color: #ae81ff } /* Literal.Number.Integer.Long */ } @media (prefers-color-scheme: light) { .highlight .hll { background-color: #ffffcc } .highlight .c { color: #888888 } /* Comment */ .highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ .highlight .k { color: #008800; font-weight: bold } /* Keyword */ .highlight .ch { color: #888888 } /* Comment.Hashbang */ .highlight .cm { color: #888888 } /* Comment.Multiline */ .highlight .cp { color: #cc0000; font-weight: bold } /* Comment.Preproc */ .highlight .cpf { color: #888888 } /* Comment.PreprocFile */ .highlight .c1 { color: #888888 } /* Comment.Single */ .highlight .cs { color: #cc0000; font-weight: bold; background-color: #fff0f0 } /* Comment.Special */ .highlight .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */ .highlight .ge { font-style: italic } /* Generic.Emph */ .highlight .gr { color: #aa0000 } /* Generic.Error */ .highlight .gh { color: #333333 } /* Generic.Heading */ .highlight .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */ }
#!/bin/bash

###
# ============LICENSE_START=======================================================
# ONAP POLICY
# ================================================================================
# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved.
# ================================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# ============LICENSE_END=========================================================
##

SNAME="Policy Management"
PNAME=policy-management
CLASS=org.onap.policy.drools.system.Main


function start() {
	um_start
	if [[ ${RETVAL} != 0 ]]; then
		update_monitor off
	else
		update_monitor on
	fi
}

# unmonitored start, does not change monitor status (immutable)
function um_start() {
    status
    if [ "$_RUNNING" = "1" ]; then
      echo $_STATUS
      RETVAL=0
      return
    fi
    mkdir -p $_LOGS
    if [ -e $_LOGS/$PNAME.out.1 ]; then mv $_LOGS/$PNAME.out.1 $_LOGS/$PNAME.out.2; fi
    if [ -e $_LOGS/$PNAME.err.1 ]; then mv $_LOGS/$PNAME.err.1 $_LOGS/$PNAME.err.2; fi
    if [ -e $_LOGS/$PNAME.out ]; then mv $_LOGS/$PNAME.out $_LOGS/$PNAME.out.1; fi
    if [ -e $_LOGS/$PNAME.err ]; then mv $_LOGS/$PNAME.err $_LOGS/$PNAME.err.1; fi
    CP=$(ls $_DIR/lib/*.jar | xargs -I X printf ":%s" X)

    # pick up any new changes in the environment every time we start
    source ${POLICY_HOME}/etc/profile.d/env.sh

    ${POLICY_HOME}/bin/configure-maven
    JVM_OPTS=(${JVM_OPTIONS})

    # If 'system.properties' exists, convert it into "-D" JVM arguments.
    # Note that the following also handles property values with spaces.
    IFS=$'\n'
    systemProperties=($(
        if [[ -f $_DIR/config/system.properties ]] ; then
            sed -n -e 's/^[ \t]*\([^ \t#]*\)[ \t]*=[ \t]*\(.*\)$/-D\1=\2/p' \
                $_DIR/config/system.properties
        fi
    ))

    cd $_DIR
    (
	if [[ "${cfg}" != "" ]] ; then
	    # need to make sure that we don't pass the lock file descriptor
	    # to subprocesses
	    exec {cfg}>&-
	fi
	nohup $JAVA_HOME/bin/java "${JVM_OPTS[@]}" -cp $_DIR/config:$_DIR/lib:$CP "${systemProperties[@]}" "$@" $CLASS > >( while read line; do echo "$(date): ${line}"; done > $_LOGS/$PNAME.out) 2> >( while read line; do echo "$(date): ${line}"; done > $_LOGS/$PNAME.err) &

	_PID=$!
	echo $_PID > $_PIDFILE
    )
    sleep 5
    status
    echo $_STATUS
    if [ "$_RUNNING" = "1" ]; then
       RETVAL=0
    else
       echo "Failed to start"
       remove_pid_file
       RETVAL=1
    fi
}

function stop() {
	um_stop
	update_monitor off
}

# unmonitored stop, does not change monitor status (immutable)
function um_stop() {
    status
    if [ "$_RUNNING" = "0" ]; then
       echo $_STATUS
       remove_pid_file
    else
	if [[ -n ${TELEMETRY_PASSWORD} ]]; then
	    http_proxy= timeout 10 curl -k --silent --user ${TELEMETRY_USER}:${TELEMETRY_PASSWORD} -X DELETE https://localhost:${TELEMETRY_PORT}/policy/pdp/engine -o /dev/null
	else
	    http_proxy= timeout 10 curl -k --silent -X DELETE https://localhost:${TELEMETRY_PORT}/policy/pdp/engine -o /dev/null
	fi
	sleep 5
	echo "Stopping $SNAME..."
	_PID_TO_KILL=$_PID;
	echo "$SNAME (pid=${_PID_TO_KILL}) is stopping..."
	kill -TERM $_PID_TO_KILL 2> /dev/null
	sleep 5
	check_status_of_pid $_PID_TO_KILL
	if [ "$_RUNNING" = "1" ]; then
	   kill -TERM $_PID_TO_KILL
	fi
	while [ "$_RUNNING" = "1" ]; do
	   sleep 2
	   check_status_of_pid $_PID_TO_KILL
	done
	remove_pid_file
	echo "$SNAME has stopped."
    fi
    RETVAL=0
}

function status() {
    if [ -f "${_PIDFILE}" ]; then
        _PID=`cat "${_PIDFILE}"`
        check_status_of_pid $_PID
    else
        _STATUS="$SNAME (no pidfile) is NOT running"
        _RUNNING=0
    fi
    if [[ $_RUNNING = 1 ]]; then
        RETVAL=0
    else
        RETVAL=1
    fi
}


function check_status_of_pid ()
{
    if [ -n "$1" ] && kill -0 $1 2>/dev/null ; then
        _STATUS="$SNAME (pid $1) is running"
        _RUNNING=1
    else
        _STATUS="$SNAME (pid $1) is NOT running"
        _RUNNING=0
    fi
}

function remove_pid_file ()
{
   if [ -f "${_PIDFILE}" ]; then
      rm "${_PIDFILE}"
   fi
}

function update_monitor() {
	STATUS=$1
	if [[ -f ${POLICY_HOME}/etc/monitor/monitor.cfg ]]; then
		/bin/sed -i.bak \
			-e "s/^${CONTROLLER}=.*/${CONTROLLER}=${STATUS}/g" \
			${POLICY_HOME}/etc/monitor/monitor.cfg
	fi
}


# main

_DIR=${POLICY_HOME}
_LOGS=${POLICY_LOGS}

if [[ -z ${POLICY_LOGS} ]]; then
	_LOGS="${POLICY_HOME}"/logs
fi

CONTROLLER=policy-management-controller

RETVAL=0

_PIDFILE=${POLICY_HOME}/PID

case "$1" in
    status)
	status
	echo "$_STATUS"
	;;
    start)
	if flock ${cfg} ; then
	    start
	fi {cfg}>>${POLICY_HOME}/etc/monitor/monitor.cfg.lock
	;;
    umstart)
	um_start
	;;
    stop)
	if flock ${cfg} ; then
	    stop
	fi {cfg}>>${POLICY_HOME}/etc/monitor/monitor.cfg.lock
	;;
    umstop)
	um_stop
	;;
    restart)
	if flock ${cfg} ; then
	    stop
	    sleep 2
	    start
	fi {cfg}>>${POLICY_HOME}/etc/monitor/monitor.cfg.lock
	;;
    *)
	echo "error: invalid option $@"
	echo "Usage: $0 status|start|stop|restart"
	RETVAL=1
	;;
esac

exit ${RETVAL}