[ONAP-wide] Replace .Release.Name with common.release
[oom.git] / kubernetes / oof / charts / oof-has / charts / oof-has-api / templates / deployment.yaml
index 12bbeef..782160b 100755 (executable)
@@ -21,7 +21,7 @@ metadata:
   labels:
     app: {{ include "common.name" . }}
     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ .Release.Name }}
+    release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 spec:
   replicas: {{ .Values.replicaCount }}
@@ -29,14 +29,16 @@ spec:
     metadata:
       labels:
         app: {{ include "common.name" . }}
-        release: {{ .Release.Name }}
+        release: {{ include "common.release" . }}
     spec:
       initContainers:
       - command:
         - /root/ready.py
         args:
         - --container-name
-        - oof-has-music
+        - oof-has-controller
+        - --container-name
+        - aaf-service
         env:
         - name: NAMESPACE
           valueFrom:
@@ -46,19 +48,46 @@ spec:
         image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
         name: {{ include "common.name" . }}-readiness
+      - command:
+        - /root/job_complete.py
+        args:
+        - -j
+        - "{{ include "common.release" . }}-oof-has-onboard"
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-onboard-readiness
+      - command:
+        - sh
+        - -c
+        - resp="FAILURE";
+          until [ $resp = "200" ]; do
+          resp=$(curl -s -o /dev/null -k --write-out %{http_code} https://aaf-sms.{{ include "common.namespace" . }}:10443/v1/sms/domain/has/secret);
+          echo $resp;
+          sleep 2;
+          done
+        env:
+        - name: NAMESPACE
+          valueFrom:
+            fieldRef:
+              apiVersion: v1
+              fieldPath: metadata.namespace
+        image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-has-sms-readiness
       containers:
         - name: {{ include "common.name" . }}
           image: "{{ include "common.repository" . }}/{{ .Values.global.image.optf_has }}"
           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
-          command:
-          - python
-          args:
-          - /usr/local/bin/conductor-api
-          - --port={{ .Values.service.internalPort }}
-          - --
-          - --config-file=/usr/local/bin/conductor.conf
+          command: ["/bin/bash","-c"]
+          args: ["nginx && /usr/local/bin/uwsgi -s /run/conductor/uwsgi.sock --chmod-socket=777 --wsgi-file /etc/nginx/conductor.wsgi --callable application --set port=80 --die-on-term --exit-on-reload --logto /opt/conductor-uwsgi.log --pidfile /run/conductor/conductor-uwsgi.pid --enable-threads --workers 6 --master --vacuum --single-interpreter --socket-timeout 10 --max-worker-lifetime 300 --max-requests 100 --no-defer-accept --logfile-chown --logfile-chmod 664 --protocol=uwsgi --socket 0.0.0.0:80"]
           ports:
-          - containerPort: {{ .Values.service.internalPort }}
+          - containerPort: {{ .Values.liveness.periodSeconds }}
           # disable liveness probe when breakpoints set in debugger
           # so K8s doesn't restart unresponsive container
           {{- if .Values.liveness.enabled }}
@@ -78,12 +107,24 @@ spec:
           - mountPath: /etc/localtime
             name: localtime
             readOnly: true
-          - mountPath: /usr/local/bin/conductor.conf
-            name: {{ .Values.global.commonConfigPrefix }}-config
+          - mountPath: /etc/nginx/nginx.conf
+            name: {{ .Values.global.commonConfigPrefix  }}-config
+            subPath: nginx.conf
+          - mountPath: /usr/local/etc/conductor/conductor.conf
+            name: {{ .Values.global.commonConfigPrefix  }}-config
             subPath: conductor.conf
           - mountPath: /usr/local/bin/log.conf
             name: {{ .Values.global.commonConfigPrefix  }}-config
             subPath: log.conf
+          - mountPath: /usr/local/bin/AAF_RootCA.cer
+            name: {{ .Values.global.commonConfigPrefix }}-config
+            subPath: AAF_RootCA.cer
+          - mountPath: /etc/nginx/ssl/org.onap.oof.crt
+            name: {{ .Values.global.commonConfigPrefix }}-config
+            subPath: org.onap.oof.crt
+          - mountPath: /etc/nginx/ssl/org.onap.oof.key
+            name: {{ .Values.global.commonConfigPrefix }}-config
+            subPath: org.onap.oof.key
           resources:
 {{ include "common.resources" . | indent 12 }}
         {{- if .Values.nodeSelector }}
@@ -102,9 +143,17 @@ spec:
           configMap:
             name: {{ .Values.global.commonConfigPrefix  }}-configmap
             items:
+            - key: nginx.conf
+              path: nginx.conf
             - key: conductor.conf
               path: conductor.conf
             - key: log.conf
               path: log.conf
+            - key: AAF_RootCA.cer
+              path: AAF_RootCA.cer
+            - key: org.onap.oof.key
+              path: org.onap.oof.key
+            - key: org.onap.oof.crt
+              path: org.onap.oof.crt
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"