summaryrefslogtreecommitdiffstats
path: root/kubernetes/dmaap
diff options
context:
space:
mode:
authorMandeep Khinda <mandeep.khinda@amdocs.com>2018-05-14 20:55:52 +0000
committerMandeep Khinda <mandeep.khinda@amdocs.com>2018-05-14 20:55:52 +0000
commitca210a9856321996ff03f0067e7e9f06248b3bf4 (patch)
tree00bbf1ac6a304b8b0c2bd1005535aef489f9e279 /kubernetes/dmaap
parent99dad55c6cc107ed86c8239b12f0d37cddcc4c61 (diff)
Correcting message-router topic seeding
It was using amsterdam topics from the config-init image that isn't maintained in Beijing. Dynamically clone the first time the PV/PVC is created and files are copied then See the JIRA for verification logs etc. Issue-ID: OOM-1073 Change-Id: I6856267574189b98eb7642599ab0276ee70f453b Signed-off-by: Mandeep Khinda <mandeep.khinda@amdocs.com>
Diffstat (limited to 'kubernetes/dmaap')
-rw-r--r--kubernetes/dmaap/charts/message-router/charts/message-router-kafka/templates/deployment.yaml27
-rw-r--r--kubernetes/dmaap/charts/message-router/charts/message-router-kafka/values.yaml11
-rw-r--r--kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/templates/deployment.yaml27
-rw-r--r--kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/values.yaml10
4 files changed, 47 insertions, 28 deletions
diff --git a/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/templates/deployment.yaml b/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/templates/deployment.yaml
index 25ab2101cf..f514dd1315 100644
--- a/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/templates/deployment.yaml
+++ b/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/templates/deployment.yaml
@@ -31,17 +31,24 @@ spec:
release: {{ .Release.Name }}
spec:
initContainers:
- - command:
- - bash
- args:
+ - name: {{ include "common.name" . }}-seed-kafka-topics
+ command:
+ - /bin/bash
- -c
- - "if [ -d /var/tmp/SDC-DISTR-NOTIF-TOPIC-SDC-OPENSOURCE-ENV1-0 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-kafka/* /var/tmp/; fi"
- image: "{{ .Values.global.configRepository }}/{{ .Values.global.configImage }}"
+ - >
+ if [ -d /tmp/topics/ECOMP-PORTAL-INBOX-0 ]; then
+ echo "nothing to do";
+ else
+ git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
+ echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-kafka/kafka-logs/* to /tmp/topics";
+ cp -var /tmp/gerrit/oom-topics/data-kafka/kafka-logs/* /tmp/topics;
+ echo "Done.";
+ fi
+ image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
volumeMounts:
- - mountPath: /var/tmp
+ - mountPath: /tmp/topics
name: kafka-data
- name: kafka-primer
- command:
- /root/ready.py
args:
@@ -62,15 +69,13 @@ spec:
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ports:
- containerPort: {{ .Values.service.internalPort }}
- # disable liveness probe when breakpoints set in debugger
- # so K8s doesn't restart unresponsive container
- {{- if eq .Values.liveness.enabled true }}
+ {{ if eq .Values.liveness.enabled true }}
livenessProbe:
tcpSocket:
port: {{ .Values.service.internalPort }}
initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.liveness.periodSeconds }}
- {{ end -}}
+ {{ end }}
readinessProbe:
tcpSocket:
port: {{ .Values.service.internalPort }}
diff --git a/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/values.yaml b/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/values.yaml
index bf5ee4c4e8..d6a8c2c03c 100644
--- a/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/values.yaml
+++ b/kubernetes/dmaap/charts/message-router/charts/message-router-kafka/values.yaml
@@ -21,9 +21,8 @@ global:
readinessImage: readiness-check:2.0.0
loggingRepository: docker.elastic.co
loggingImage: beats/filebeat:5.5.0
- configRepository: oomk8s
- configImage: config-init:2.0.0-SNAPSHOT
persistence: {}
+ ubuntuInitRepository: registry.hub.docker.com
#################################################################
# Application configuration defaults.
@@ -32,6 +31,7 @@ global:
repository: docker.io
image: wurstmeister/kafka:1.1.0
pullPolicy: Always
+ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
zookeeper:
name: message-router-zookeeper
@@ -41,7 +41,12 @@ zookeeper:
debugEnabled: false
# application configuration
-config: {}
+config:
+ # gerrit branch where the latest code is checked in
+ gerritBranch: master
+ # gerrit project where the latest code is checked in
+ gerritProject: http://gerrit.onap.org/r/dmaap/messagerouter/messageservice.git
+
# default number of instances
replicaCount: 1
diff --git a/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/templates/deployment.yaml b/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/templates/deployment.yaml
index 678b83e3bd..327afca767 100644
--- a/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/templates/deployment.yaml
+++ b/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/templates/deployment.yaml
@@ -31,32 +31,37 @@ spec:
release: {{ .Release.Name }}
spec:
initContainers:
- - command:
- - bash
- args:
+ - name: {{ include "common.name" . }}-seed-zookeeper-topics
+ command:
+ - /bin/bash
- -c
- - "if [ -d /var/tmp/version-2 ]; then echo nothing to do; else cp -a /opt/config/src/message-router/dcae-startup-vm-message-router/docker_files/data-zookeeper/* /var/tmp/; fi"
- image: "{{ .Values.global.configRepository }}/{{ .Values.global.configImage }}"
+ - >
+ if [ -d /tmp/topics/version-2 ]; then
+ echo "nothing to do";
+ else
+ git clone -b {{ .Values.config.gerritBranch }} --single-branch {{ .Values.config.gerritProject }} /tmp/gerrit;
+ echo "Clone complete. Copying from /tmp/gerrit/oom-projects/data-zookeeper/* to /tmp/topics";
+ cp -var /tmp/gerrit/oom-topics/data-zookeeper/* /tmp/topics;
+ echo "Done.";
+ fi
+ image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.ubuntuInitImage }}"
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
volumeMounts:
- - mountPath: /var/tmp
+ - mountPath: /tmp/topics
name: zookeeper-data
- name: zookeeper-primer
containers:
- name: {{ include "common.name" . }}
image: "{{ include "common.repository" . }}/{{ .Values.image }}"
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
ports:
- containerPort: {{ .Values.service.internalPort }}
- # disable liveness probe when breakpoints set in debugger
- # so K8s doesn't restart unresponsive container
- {{- if eq .Values.liveness.enabled true }}
+ {{ if eq .Values.liveness.enabled true }}
livenessProbe:
tcpSocket:
port: {{ .Values.service.internalPort }}
initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
periodSeconds: {{ .Values.liveness.periodSeconds }}
- {{ end -}}
+ {{ end }}
readinessProbe:
tcpSocket:
port: {{ .Values.service.internalPort }}
diff --git a/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/values.yaml b/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/values.yaml
index 93ba66576d..a71b14a046 100644
--- a/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/values.yaml
+++ b/kubernetes/dmaap/charts/message-router/charts/message-router-zookeeper/values.yaml
@@ -21,8 +21,7 @@ global:
readinessImage: readiness-check:2.0.0
loggingRepository: docker.elastic.co
loggingImage: beats/filebeat:5.5.0
- configRepository: oomk8s
- configImage: config-init:2.0.0-SNAPSHOT
+ ubuntuInitRepository: registry.hub.docker.com
persistence: {}
#################################################################
@@ -32,12 +31,17 @@ global:
repository: docker.io
image: wurstmeister/zookeeper:latest
pullPolicy: Always
+ubuntuInitImage: oomk8s/ubuntu-init:2.0.0
# flag to enable debugging - application support required
debugEnabled: false
# application configuration
-config: {}
+config:
+ # gerrit branch where the latest code is checked in
+ gerritBranch: master
+ # gerrit project where the latest code is checked in
+ gerritProject: http://gerrit.onap.org/r/dmaap/messagerouter/messageservice.git
# default number of instances
replicaCount: 1