Run all components in one namespace
[oom.git] / kubernetes / aai / templates / aai-resources-deployment.yaml
index ebf447f..c07214d 100644 (file)
@@ -3,8 +3,9 @@ apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
   name: aai-resources
-  namespace: "{{ .Values.nsPrefix }}-aai"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
+  replicas: {{ .Values.aaiResourceReplicas }}
   selector:
     matchLabels:
       app: aai-resources
@@ -13,33 +14,22 @@ spec:
       labels:
         app: aai-resources
       name: aai-resources
-      annotations:
-        pod.beta.kubernetes.io/init-containers: '[
-          {
-              "args": [
-                  "--container-name",
-                  "hbase"
-              ],
-              "command": [
-                  "/root/ready.py"
-              ],
-              "env": [
-                  {
-                      "name": "NAMESPACE",
-                      "valueFrom": {
-                          "fieldRef": {
-                              "apiVersion": "v1",
-                              "fieldPath": "metadata.namespace"
-                          }
-                      }
-                  }
-              ],
-              "image": "{{ .Values.image.readiness }}",
-              "imagePullPolicy": "{{ .Values.pullPolicy }}",
-              "name": "aai-resources-readiness"
-          }
-        ]'
     spec:
+      initContainers:
+      - command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - hbase
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: {{ .Values.image.readiness }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: aai-resources-readiness
       containers:
       - name: aai-resources
         image: "{{ .Values.image.aaiResourcesImage }}:{{ .Values.image.aaiResourcesVersion}}"
@@ -61,7 +51,10 @@ spec:
         - mountPath: /etc/localtime
           name: localtime
           readOnly: true
-        - mountPath: /var/chef/aai-data/
+        - 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: /var/log/onap
           name: aai-resources-logs
@@ -80,6 +73,7 @@ spec:
         imagePullPolicy: {{ .Values.pullPolicy }}
         volumeMounts:
         - mountPath: /usr/share/filebeat/filebeat.yml
+          subPath: filebeat.yml
           name: filebeat-conf
         - mountPath: /var/log/onap
           name: aai-resources-logs
@@ -89,28 +83,23 @@ spec:
       - name: localtime
         hostPath:
           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/"
+        configMap:
+          name: aai-resources-environments-configmap
       - name: filebeat-conf
-        hostPath:
-          path: /dockerdata-nfs/{{ .Values.nsPrefix }}/log/filebeat/log4j/filebeat.yml
+        configMap:
+          name: aai-filebeat-configmap
       - name: aai-resources-logs
         emptyDir: {}
       - name: aai-resources-filebeat
         emptyDir: {}
       - name: aai-resources-log-conf
         configMap:
-         name: aai-resources-configmap
+         name: aai-resources-log-configmap
       restartPolicy: Always
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
----
-apiVersion: v1
-kind: ConfigMap
-metadata:
-  name: aai-resources-configmap
-  namespace: {{ .Values.nsPrefix }}-aai
-data:
-{{ (.Files.Glob "resources/resources/conf/logback.xml").AsConfig | indent 2 }}
-#{{ end }}
\ No newline at end of file
+#{{ end }}