summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormayankg2703 <mayank.gupta@amdocs.com>2017-12-07 14:02:26 +0000
committerAlexis de Talhouƫt <alexis.de_talhouet@bell.ca>2017-12-20 15:25:51 +0000
commitec27362126f1072bb6ef9394cc5afaa1722d9743 (patch)
tree9cb72718b09c4e68d9f534199d770e6fad95ddad
parent34ca33b895d29cc5f4196679354f3a1880506dc8 (diff)
Incorrect start-kafka.sh mounted to global-kafka
Issue-ID: OOM-481 Change-Id: Ie8bdcf5fdd3999488728fc751596121399e9738c Signed-off-by: mayankg2703 <mayank.gupta@amdocs.com> (cherry picked from commit 2c1e36d2e9c224e901179d253616d0ee62a41a86)
-rw-r--r--kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh69
-rw-r--r--kubernetes/message-router/templates/message-router-kafka.yaml7
2 files changed, 1 insertions, 75 deletions
diff --git a/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh b/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh
deleted file mode 100644
index 4d955daf4a..0000000000
--- a/kubernetes/config/docker/init/src/config/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh
+++ /dev/null
@@ -1,69 +0,0 @@
-#!/bin/bash
-
-if [[ -z "$KAFKA_PORT" ]]; then
- export KAFKA_PORT=9092
-fi
-if [[ -z "$KAFKA_ADVERTISED_PORT" ]]; then
- export KAFKA_ADVERTISED_PORT=$(docker port `hostname` $KAFKA_PORT | sed -r "s/.*:(.*)/\1/g")
-fi
-if [[ -z "$KAFKA_BROKER_ID" ]]; then
- # By default auto allocate broker ID
- #export KAFKA_BROKER_ID=-1
- export KAFKA_BROKER_ID=1
-fi
-#if [[ -z "$KAFKA_LOG_DIRS" ]]; then
- #export KAFKA_LOG_DIRS="/kafka/kafka-logs-$HOSTNAME"
- export KAFKA_LOG_DIRS="/kafka/kafka-logs"
-#fi
-if [[ -z "$KAFKA_ZOOKEEPER_CONNECT" ]]; then
- export KAFKA_ZOOKEEPER_CONNECT=$(env | grep ZK.*PORT_2181_TCP= | sed -e 's|.*tcp://||' | paste -sd ,)
-fi
-
-if [[ -n "$KAFKA_HEAP_OPTS" ]]; then
- sed -r -i "s/(export KAFKA_HEAP_OPTS)=\"(.*)\"/\1=\"$KAFKA_HEAP_OPTS\"/g" $KAFKA_HOME/bin/kafka-server-start.sh
- unset KAFKA_HEAP_OPTS
-fi
-
-if [[ -z "$KAFKA_ADVERTISED_HOST_NAME" && -n "$HOSTNAME_COMMAND" ]]; then
- export KAFKA_ADVERTISED_HOST_NAME=$(eval $HOSTNAME_COMMAND)
-fi
-
-for VAR in `env`
-do
- if [[ $VAR =~ ^KAFKA_ && ! $VAR =~ ^KAFKA_HOME ]]; then
- kafka_name=`echo "$VAR" | sed -r "s/KAFKA_(.*)=.*/\1/g" | tr '[:upper:]' '[:lower:]' | tr _ .`
- env_var=`echo "$VAR" | sed -r "s/(.*)=.*/\1/g"`
- if egrep -q "(^|^#)$kafka_name=" $KAFKA_HOME/config/server.properties; then
- sed -r -i "s@(^|^#)($kafka_name)=(.*)@\2=${!env_var}@g" $KAFKA_HOME/config/server.properties #note that no config values may contain an '@' char
- else
- echo "$kafka_name=${!env_var}" >> $KAFKA_HOME/config/server.properties
- fi
- fi
-done
-
-if [[ -n "$CUSTOM_INIT_SCRIPT" ]] ; then
- eval $CUSTOM_INIT_SCRIPT
-fi
-
-
-KAFKA_PID=0
-
-# see https://medium.com/@gchudnov/trapping-signals-in-docker-containers-7a57fdda7d86#.bh35ir4u5
-term_handler() {
- echo 'Stopping Kafka....'
- if [ $KAFKA_PID -ne 0 ]; then
- kill -s TERM "$KAFKA_PID"
- wait "$KAFKA_PID"
- fi
- echo 'Kafka stopped.'
- exit
-}
-
-
-# Capture kill requests to stop properly
-trap "term_handler" SIGHUP SIGINT SIGTERM
-create-topics.sh &
-$KAFKA_HOME/bin/kafka-server-start.sh $KAFKA_HOME/config/server.properties &
-KAFKA_PID=$!
-
-wait "$KAFKA_PID"
diff --git a/kubernetes/message-router/templates/message-router-kafka.yaml b/kubernetes/message-router/templates/message-router-kafka.yaml
index 3e2628b750..8f04a40706 100644
--- a/kubernetes/message-router/templates/message-router-kafka.yaml
+++ b/kubernetes/message-router/templates/message-router-kafka.yaml
@@ -70,8 +70,6 @@ spec:
name: docker-socket
- mountPath: /kafka
name: kafka-data
- - mountPath: /start-kafka.sh
- name: start-kafka
restartPolicy: Always
volumes:
- name: localtime
@@ -83,9 +81,6 @@ spec:
- name: kafka-data
persistentVolumeClaim:
claimName: message-router-kafka
- - name: start-kafka
- hostPath:
- path: /dockerdata-nfs/{{ .Values.nsPrefix }}/message-router/dcae-startup-vm-message-router/docker_files/start-kafka.sh
imagePullSecrets:
- name: "{{ .Values.nsPrefix }}-docker-registry-key"
-#{{ end }} \ No newline at end of file
+#{{ end }}