aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/common/postgres/templates/statefulset.yaml
diff options
context:
space:
mode:
authorBorislavG <Borislav.Glozman@amdocs.com>2018-05-07 09:02:35 +0000
committerBorislav Glozman <Borislav.Glozman@amdocs.com>2018-05-08 12:42:53 +0000
commit339b749f934cb9dc32700e13cb2bb6a9f465d95b (patch)
tree1de52ec886ef4290b6f62f7db8511430d828f6af /kubernetes/common/postgres/templates/statefulset.yaml
parent69488f16e417fb9a6392b17af09690a5df068731 (diff)
Fix consul images repo
Change-Id: Idb0f1e99dc3023958c6e37355a4c7aaee8b25a17 Issue-ID: OOM-1050 Signed-off-by: BorislavG <Borislav.Glozman@amdocs.com>
Diffstat (limited to 'kubernetes/common/postgres/templates/statefulset.yaml')
0 files changed, 0 insertions, 0 deletions
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


if [[ -z "$START_TIMEOUT" ]]; then
    START_TIMEOUT=600
fi

start_timeout_exceeded=false
count=0
step=10
while netstat -lnt | awk '$4 ~ /:'$KAFKA_PORT'$/ {exit 1}'; do
    echo "waiting for kafka to be ready"
    sleep $step;
    count=$(expr $count + $step)
    if [ $count -gt $START_TIMEOUT ]; then
        start_timeout_exceeded=true
        break
    fi
done

if $start_timeout_exceeded; then
    echo "Not able to auto-create topic (waited for $START_TIMEOUT sec)"
    exit 1
fi

if [[ -n $KAFKA_CREATE_TOPICS ]]; then
    IFS=','; for topicToCreate in $KAFKA_CREATE_TOPICS; do
        echo "creating topics: $topicToCreate"
        IFS=':' read -a topicConfig <<< "$topicToCreate"
        if [ ${topicConfig[3]} ]; then
          JMX_PORT='' $KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $KAFKA_ZOOKEEPER_CONNECT --replication-factor ${topicConfig[2]} --partitions ${topicConfig[1]} --topic "${topicConfig[0]}" --config cleanup.policy="${topicConfig[3]}" --if-not-exists
        else
          JMX_PORT='' $KAFKA_HOME/bin/kafka-topics.sh --create --zookeeper $KAFKA_ZOOKEEPER_CONNECT --replication-factor ${topicConfig[2]} --partitions ${topicConfig[1]} --topic "${topicConfig[0]}" --if-not-exists
        fi
    done
fi