Run all components in one namespace
[oom.git] / kubernetes / message-router / templates / message-router-dmaap.yaml
index eda5093..cc13a38 100644 (file)
@@ -1,9 +1,11 @@
+#{{ if not .Values.disableMessageRouterDmaap }}
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: dmaap
-  namespace: {{ .Values.NS }}
+  name: message-router-dmaap
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
+  replicas: {{ .Values.dmaapReplicas }}
   selector:
     matchLabels:
       app: dmaap
@@ -11,36 +13,25 @@ spec:
     metadata:
       labels:
         app: dmaap
-      name: dmaap
-      annotations:
-        pod.beta.kubernetes.io/init-containers: '[
-          {
-              "args": [
-                  "--container-name",
-                  "global-kafka",
-                  "--container-name",
-                  "zookeeper"
-              ],
-              "command": [
-                  "/root/ready.py"
-              ],
-              "env": [
-                  {
-                      "name": "NAMESPACE",
-                      "valueFrom": {
-                          "fieldRef": {
-                              "apiVersion": "v1",
-                              "fieldPath": "metadata.namespace"
-                          }
-                      }
-                  }
-              ],
-              "image": "{{ .Values.image.readiness }}",
-              "imagePullPolicy": "{{ .Values.pullPolicy }}",
-              "name": "dmaap-readiness"
-          }
-          ]'
+      name: message-router-dmaap
     spec:
+      initContainers:
+      - command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - global-kafka
+        - --container-name
+        - zookeeper
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: {{ .Values.image.readiness }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: dmaap-readiness
       containers:
       - image: {{ .Values.image.dmaap }}
         imagePullPolicy: {{ .Values.pullPolicy }}
@@ -54,6 +45,9 @@ spec:
           initialDelaySeconds: 5
           periodSeconds: 10
         volumeMounts:
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
         - mountPath: /appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
           name: appprops
         - mountPath: /appl/dmaapMR1/etc/cadi.properties
@@ -62,14 +56,18 @@ spec:
           name: mykey
       restartPolicy: Always
       volumes:
+      - name: localtime
+        hostPath:
+          path: /etc/localtime
       - name: appprops
         hostPath:
-          path: /dockerdata-nfs/onap/message-router/dmaap/MsgRtrApi.properties
+          path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/message-router/dmaap/MsgRtrApi.properties
       - name: cadi
         hostPath:
-          path: /dockerdata-nfs/onap/message-router/dmaap/cadi.properties
+          path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/message-router/dmaap/cadi.properties
       - name: mykey
         hostPath:
-          path: /dockerdata-nfs/onap/message-router/dmaap/mykey
+          path: {{ .Values.dataRootDir }}/{{ .Values.nsPrefix }}/message-router/dmaap/mykey
       imagePullSecrets:
-      - name: onap-docker-registry-key
+      - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+{{ end }}