Merge changes I6a379ec4,I982a75a9,Id8a84b79,I423294a5,Iefe3d89a
[oom.git] / kubernetes / aai / templates / data-router-deployment.yaml
index 0033208..b1cb834 100644 (file)
@@ -1,20 +1,58 @@
+# Copyright © 2017 Amdocs, Bell Canada
+#
+# 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.
+
+#{{ if not .Values.disableAaiDataRouter }}
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: data-router
-  namespace: "{{ .Values.nsPrefix }}-aai"
+  name: aai-data-router
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
+  replicas: {{ .Values.dataRouterReplicas }}
   selector:
     matchLabels:
-      app: data-router
+      app: aai-data-router
   template:
     metadata:
       labels:
-        app: data-router
-      name: data-router
+        app: aai-data-router
+      name: aai-data-router
     spec:
+      initContainers:
+      - command:
+        - /bin/sh
+        - -c
+        - |
+          mkdir -p /logroot/data-router/logs
+          chmod -R 777 /logroot/data-router/logs
+          chown -R root:root /logroot
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        securityContext:
+          privileged: true
+        image: {{ .Values.image.es_bb }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: init-sysctl
+        volumeMounts:
+        - name: aai-data-router-logs
+          mountPath: /logroot/
       containers:
-      - name: data-router
+      - name: aai-data-router
         image: "{{ .Values.image.dataRouterImage }}:{{ .Values.image.dataRouterVersion }}"
         imagePullPolicy: {{ .Values.pullPolicy }}
         env:
@@ -33,16 +71,34 @@ spec:
         - name: JAVA_HOME
           value: usr/lib/jvm/java-8-openjdk-amd64
         volumeMounts:
-        - mountPath: /opt/app/data-router/config/
-          name: data-router-config
-        - mountPath: /opt/app/data-router/config/auth/tomcat_keystore
-          name: data-router-tomcat-key
-        - mountPath: /opt/app/data-router/config/auth/client-cert-onap.p12 
-          name: data-router-client-cert
-        - mountPath: /opt/app/data-router/dynamic/
-          name: data-router-dynamic
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
+        - mountPath: /opt/app/data-router/config/model/aai_oxm_v8.xml
+          subPath: aai_oxm_v8.xml
+          name: aai-data-router-model-v8
+        - mountPath: /opt/app/data-router/config/model/aai_oxm_v9.xml
+          subPath: aai_oxm_v9.xml
+          name: aai-data-router-model-v9
+        - mountPath: /opt/app/data-router/config/model/aai_oxm_v10.xml
+          subPath: aai_oxm_v10.xml
+          name: aai-data-router-model-v10
+        - mountPath: /opt/app/data-router/config/model/aai_oxm_v11.xml
+          subPath: aai_oxm_v11.xml
+          name: aai-data-router-model-v11
+        - mountPath:  /opt/app/data-router/config/auth
+          name: aai-data-router-auth
+        - mountPath:  /opt/app/data-router/config/data-router.properties
+          name: aai-data-router-properties
+          subPath: data-router.properties
+        - mountPath: /opt/app/data-router/dynamic/routes/entity-event.route
+          subPath: entity-event.route
+          name: aai-data-router-dynamic-route
+        - mountPath: /opt/app/data-router/dynamic/conf/entity-event-policy.xml
+          subPath: entity-event-policy.xml
+          name: aai-data-router-dynamic-policy
         - mountPath: /logs/
-          name: data-router-logs
+          name: aai-data-router-logs
         ports:
         - containerPort: 9502
         readinessProbe:
@@ -51,21 +107,38 @@ spec:
           initialDelaySeconds: 5
           periodSeconds: 10
       volumes:
-      - name: data-router-config
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/data-router/appconfig/"
-      - name: data-router-dynamic
+      - name: localtime
         hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/data-router/dynamic/"
-      - name: data-router-logs
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/data-router/logs/"
-      - name: data-router-tomcat-key
-        secret:
-          secretName: secret-{{ .Values.nsPrefix }}-aai
-      - name: data-router-client-cert
+          path: /etc/localtime
+      - name: aai-data-router-model-v8
+        configMap:
+          name: aai-data-router-model-v8-configmap
+      - name: aai-data-router-model-v9
+        configMap:
+          name: aai-data-router-model-v9-configmap
+      - name: aai-data-router-model-v10
+        configMap:
+          name: aai-data-router-model-v10-configmap
+      - name: aai-data-router-model-v11
+        configMap:
+          name: aai-data-router-model-v11-configmap
+      - name: aai-data-router-auth
         secret:
-          secretName: secret-{{ .Values.nsPrefix }}-aai
+          secretName: aai-data-router-secret
+      - name: aai-data-router-properties
+        configMap:
+          name: aai-data-router-prop-configmap
+      - name: aai-data-router-dynamic-route
+        configMap:
+          name: aai-data-router-dynamic-configmap
+      - name: aai-data-router-dynamic-policy
+        configMap:
+          name: aai-data-router-dynamic-configmap
+      - name: aai-data-router-logs
+        hostPath:
+          path: {{ .Values.persistence.mountPath }}/{{ .Release.Name }}/aai/data-router/logs
       restartPolicy: Always
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
+