AAI parameterization
[oom.git] / kubernetes / aai / templates / aai-traversal-deployment.yaml
index 59ea7ba..f039d0f 100644 (file)
@@ -1,9 +1,25 @@
+# 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.disableAaiAaiTraversal }}
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
   name: aai-traversal
-  namespace: "{{ .Values.nsPrefix }}-aai"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
+  replicas: {{ .Values.aaiTraversalReplicas }}
   selector:
     matchLabels:
       app: aai-traversal
@@ -13,34 +29,234 @@ spec:
         app: aai-traversal
       name: aai-traversal
       annotations:
-        pod.beta.kubernetes.io/init-containers: '[
-          {
-              "args": [
-                  "--container-name",
-                  "hbase",
-                  "--container-name",
-                  "aai-resources"
-              ],
-              "command": [
-                  "/root/ready.py"
-              ],
-              "env": [
-                  {
-                      "name": "NAMESPACE",
-                      "valueFrom": {
-                          "fieldRef": {
-                              "apiVersion": "v1",
-                              "fieldPath": "metadata.namespace"
-                          }
-                      }
-                  }
-              ],
-              "image": "oomk8s/readiness-check:1.0.0",
-              "imagePullPolicy": "Always",
-              "name": "aai-traversal-readiness"
+        msb.onap.org/service-info: '[
+          {
+              "serviceName": "_aai-generic-query",
+              "version": "v11",
+              "url": "/aai/v11/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v11/search/generic-query"
+          },
+          {
+              "serviceName": "_aai-generic-query",
+              "version": "v12",
+              "url": "/aai/v12/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v12/search/generic-query"
+          },
+          {
+              "serviceName": "_aai-generic-query",
+              "version": "v13",
+              "url": "/aai/v13/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v13/search/generic-query"
+          },
+          {
+              "serviceName": "_aai-nodes-query",
+              "version": "v11",
+              "url": "/aai/v11/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v11/search/nodes-query"
+          },
+          {
+              "serviceName": "_aai-nodes-query",
+              "version": "v12",
+              "url": "/aai/v12/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v12/search/nodes-query"
+          },
+          {
+              "serviceName": "_aai-nodes-query",
+              "version": "v13",
+              "url": "/aai/v13/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v13/search/nodes-query"
+          },
+          {
+              "serviceName": "_aai-query",
+              "version": "v11",
+              "url": "/aai/v11/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v11/query"
+          },
+          {
+              "serviceName": "_aai-query",
+              "version": "v12",
+              "url": "/aai/v12/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v12/query"
+          },
+          {
+              "serviceName": "_aai-query",
+              "version": "v13",
+              "url": "/aai/v13/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/v13/query"
+          },
+          {
+              "serviceName": "_aai-named-query",
+              "url": "/aai/search",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1",
+              "path": "/aai/search"
+          },
+          {
+              "serviceName": "aai-generic-query",
+              "version": "v11",
+              "url": "/aai/v11/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-generic-query",
+              "version": "v12",
+              "url": "/aai/v12/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-generic-query",
+              "version": "v13",
+              "url": "/aai/v13/search/generic-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-nodes-query",
+              "version": "v11",
+              "url": "/aai/v11/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-nodes-query",
+              "version": "v12",
+              "url": "/aai/v12/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-nodes-query",
+              "version": "v13",
+              "url": "/aai/v13/search/nodes-query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-query",
+              "version": "v11",
+              "url": "/aai/v11/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-query",
+              "version": "v12",
+              "url": "/aai/v12/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-query",
+              "version": "v13",
+              "url": "/aai/v13/query",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
+          },
+          {
+              "serviceName": "aai-named-query",
+              "url": "/aai/search",
+              "protocol": "REST",
+              "port": "8446",
+              "enable_ssl": true,
+              "lb_policy":"ip_hash",
+              "visualRange": "1"
           }
-        ]'      
+          ]'
     spec:
+      initContainers:
+      - command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - hbase
+        - --container-name
+        - aai-resources
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: {{ .Values.image.readiness }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: aai-traversal-readiness
       containers:
       - name: aai-traversal
         image: "{{ .Values.image.aaiTraversalImage }}:{{ .Values.image.aaiTraversalVersion }}"
@@ -51,18 +267,27 @@ spec:
         - name: AAI_CHEF_ENV
           value: simpledemo
         - name: AAI_CORE_VERSION
-          value: 1.1.0-SNAPSHOT
+          value: {{ .Values.aaicoreversion }}
         - name: AAI_CHEF_LOC
           value: /var/chef/aai-data/environments
         - name: CHEF_GIT_URL
           value: http://gerrit.onap.org/r/aai
+        - name: RESOURCES_HOSTNAME
+          value: aai-resources.{{ .Values.nsPrefix }}
         volumeMounts:
-        - mountPath: /opt/aai/logroot/
-          name: aai-traversal-logs
-        - mountPath: /var/chef/aai-data/
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
+        - mountPath: /var/chef/aai-data/chef-config/dev/.knife/solo.rb
+          subPath: solo.rb
+          name: aai-chef-config
+        - mountPath: /var/chef/aai-data/environments/
           name: aai-data
-        - mountPath: /docker-entrypoint.sh
-          name: entrypoint-override
+        - mountPath: /var/log/onap
+          name: aai-traversal-logs
+        - mountPath: /opt/app/aai-traversal/bundleconfig/etc/logback.xml
+          name: aai-traversal-log-conf
+          subPath: logback.xml
         ports:
         - containerPort: 8446
         readinessProbe:
@@ -70,16 +295,39 @@ spec:
             port: 8446
           initialDelaySeconds: 5
           periodSeconds: 10
+      - name: filebeat-onap-aai-traversal
+        image: {{ .Values.image.filebeat }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        volumeMounts:
+        - mountPath: /usr/share/filebeat/filebeat.yml
+          subPath: filebeat.yml
+          name: filebeat-conf
+        - mountPath: /var/log/onap
+          name: aai-traversal-logs
+        - mountPath: /usr/share/filebeat/data
+          name: aai-traversal-filebeat
       volumes:
-      - name: aai-traversal-logs
+      - name: localtime
         hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-traversal/logs/"
+          path: /etc/localtime
+      - name: aai-chef-config
+        configMap:
+          name: aai-chef-config-configmap
       - name: aai-data
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-data/"
-      - name: entrypoint-override
-        hostPath:
-          path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/aai-traversal/docker-entrypoint.sh"
+        configMap:
+          name: aai-resources-environments-configmap
+      - name: filebeat-conf
+        configMap:
+          name: aai-filebeat-configmap
+      - name: aai-traversal-logs
+        emptyDir: {}
+      - name: aai-traversal-filebeat
+        emptyDir: {}
+      - name: aai-traversal-log-conf
+        configMap:
+         name: aai-traversal-log-configmap
       restartPolicy: Always
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}
+