Run all components in one namespace
[oom.git] / kubernetes / policy / templates / dep-brmsgw.yaml
index 17e4896..25bf0c6 100644 (file)
@@ -1,10 +1,11 @@
+#{{ if not .Values.disablePolicyBrmsgw }}
 apiVersion: extensions/v1beta1
 kind: Deployment
 metadata:
-  name: brmsgw
-  namespace: "{{ .Values.nsPrefix }}-policy"
+  name: policy-brmsgw
+  namespace: "{{ .Values.nsPrefix }}"
 spec:
-  replicas: 1
+  replicas: {{ .Values.brmsgwReplicas }}
   selector:
     matchLabels:
       app: brmsgw
@@ -12,40 +13,23 @@ spec:
     metadata:
       labels:
         app: brmsgw
-      name: brmsgw
-      annotations:
-        pod.beta.kubernetes.io/init-containers: '[
-          {
-              "args": [
-                  "--container-name",
-                  "mariadb",
-                  "--container-name",
-                  "nexus",
-                  "--container-name",
-                  "pap",
-                  "--container-name",
-                  "pdp"
-              ],
-              "command": [
-                  "/root/ready.py"
-              ],
-              "env": [
-                  {
-                      "name": "NAMESPACE",
-                      "valueFrom": {
-                          "fieldRef": {
-                              "apiVersion": "v1",
-                              "fieldPath": "metadata.namespace"
-                          }
-                      }
-                  }
-              ],
-              "image": "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}",
-              "imagePullPolicy": "{{ .Values.pullPolicy }}",
-              "name": "brmsgw-readiness"
-          }
-          ]'
+      name: policy-brmsgw
     spec:
+      initContainers:
+      - command:
+        - /root/ready.py
+        args:
+        - --container-name
+        - pap
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.image.readiness }}:{{ .Values.image.readinessVersion }}"
+        imagePullPolicy: {{ .Values.pullPolicy }}
+        name: brmsgw-readiness
       containers:
       - command:
         - /bin/bash
@@ -55,11 +39,19 @@ spec:
         imagePullPolicy: {{ .Values.pullPolicy }}
         name: brmsgw
         volumeMounts:
+        - mountPath: /etc/localtime
+          name: localtime
+          readOnly: true
         - mountPath: /tmp/policy-install/config
           name: pe
       volumes:
-        - name: pe
+        - name: localtime
           hostPath:
-            path: /dockerdata-nfs/{{ .Values.nsPrefix }}/policy/opt/policy/config/pe/
+            path: /etc/localtime
+        - name: pe
+          configMap:
+            name: policy-dep-pe-configmap
+            defaultMode: 0755
       imagePullSecrets:
       - name: "{{ .Values.nsPrefix }}-docker-registry-key"
+#{{ end }}