Run all components in one namespace
[oom.git] / kubernetes / aai / templates / aai-deployment.yaml
index 3f714f3..db6da64 100644 (file)
@@ -3,8 +3,9 @@ apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
   name: aai-service
-  namespace: "{{ .Values.nsPrefix }}-aai"
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
+  replicas: {{ .Values.aaiServiceReplicas }}
   selector:
     matchLabels:
       app: aai-service
@@ -13,29 +14,24 @@ spec:
       labels:
         app: aai-service
       name: aai-service
-      annotations:
-        pod.beta.kubernetes.io/init-containers: '[{
-            "args": [
-                "--container-name", "aai-resources",
-                "--container-name", "aai-traversal"
-            ],
-            "command": [
-                "/root/ready.py"
-            ],
-            "env": [{
-                "name": "NAMESPACE",
-                "valueFrom": {
-                    "fieldRef": {
-                        "apiVersion": "v1",
-                        "fieldPath": "metadata.namespace"
-                    }
-                }
-            }],
-            "image": "{{ .Values.image.readiness }}",
-            "imagePullPolicy": "{{ .Values.pullPolicy }}",
-            "name": "aai-service-readiness"
-          }]'
     spec:
+      initContainers:
+      - command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - aai-resources
+        - --container-name
+        - aai-traversal
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: {{ .Values.image.readiness }}
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: aai-service-readiness
       containers:
       - name: aai-service
         image: "{{ .Values.image.aaiProxy }}:{{ .Values.image.aaiProxyVersion}}"
@@ -47,6 +43,7 @@ spec:
         - mountPath: /dev/log
           name: aai-service-log
         - mountPath: /usr/local/etc/haproxy/haproxy.cfg
+          subPath: haproxy.cfg
           name: haproxy-cfg
         ports:
         - containerPort: 8080
@@ -62,11 +59,11 @@ spec:
             path: /etc/localtime
         - name: aai-service-log
           hostPath:
-            path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/haproxy/log/"
+            path: "/dev/log"
         - name: haproxy-cfg
-          hostPath:
-            path: "/dockerdata-nfs/{{ .Values.nsPrefix }}/aai/haproxy/haproxy.cfg"
+          configMap:
+            name: aai-deployment-configmap
       restartPolicy: Always
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
-#{{ end }}
\ No newline at end of file
+#{{ end }}