X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Foof%2Fcharts%2Foof-has%2Fcharts%2Foof-has-api%2Ftemplates%2Fdeployment.yaml;h=ce3148fe184e88af1fed67b610fb994eb988a54e;hb=1694e1d1f6ea1af001ed651609cc66b35a0ac4e4;hp=7589a0a3b48d8726ce5d2a028b49834210ad27db;hpb=61225cb0e342c5a96807803bc011dc33186faf68;p=oom.git diff --git a/kubernetes/oof/charts/oof-has/charts/oof-has-api/templates/deployment.yaml b/kubernetes/oof/charts/oof-has/charts/oof-has-api/templates/deployment.yaml index 7589a0a3b4..ce3148fe18 100755 --- a/kubernetes/oof/charts/oof-has/charts/oof-has-api/templates/deployment.yaml +++ b/kubernetes/oof/charts/oof-has/charts/oof-has-api/templates/deployment.yaml @@ -1,4 +1,5 @@ # Copyright © 2017 Amdocs, Bell Canada +# Copyright (C) 2020 Wipro Limited. # Modifications Copyright © 2018 AT&T,VMware # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -13,7 +14,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -apiVersion: extensions/v1beta1 +apiVersion: apps/v1 kind: Deployment metadata: name: {{ include "common.fullname" . }} @@ -21,46 +22,54 @@ metadata: labels: app: {{ include "common.name" . }} chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} heritage: {{ .Release.Service }} spec: + selector: + matchLabels: + app: {{ include "common.name" . }} replicas: {{ .Values.replicaCount }} template: metadata: labels: app: {{ include "common.name" . }} - release: {{ .Release.Name }} + release: {{ include "common.release" . }} spec: initContainers: - - command: - - /root/ready.py + - name: {{ include "common.name" . }}-readiness + command: + - /app/ready.py args: - --container-name - oof-has-controller + - --container-name + - aaf-service env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - name: {{ include "common.name" . }}-readiness - - command: - - /root/job_complete.py + + - name: {{ include "common.name" . }}-onboard-readiness + command: + - /app/ready.py args: - -j - - "{{ .Release.Name }}-oof-has-onboard" + - "{{ include "common.release" . }}-oof-has-onboard" env: - name: NAMESPACE valueFrom: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + image: "{{ include "common.repository" . }}/{{ .Values.global.readinessImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - name: {{ include "common.name" . }}-onboard-readiness - - command: + + - name: {{ include "common.name" . }}-has-sms-readiness + command: - sh - -c - resp="FAILURE"; @@ -75,34 +84,29 @@ spec: fieldRef: apiVersion: v1 fieldPath: metadata.namespace - image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" + image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.global.curlImage }}" 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: ["/usr/local/bin/uwsgi -s /run/conductor/uwsgi.sock --chmod-socket=777 --wsgi-file /etc/nginx/conductor.wsgi --callable application --set port={{ .Values.uwsgi.internalPort }} --die-on-term --exit-on-reload --logto /var/log/conductor/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:{{ .Values.uwsgi.internalPort }}"] ports: - - containerPort: {{ .Values.service.internalPort }} + - containerPort: {{ .Values.uwsgi.internalPort }} # disable liveness probe when breakpoints set in debugger # so K8s doesn't restart unresponsive container {{- if .Values.liveness.enabled }} livenessProbe: tcpSocket: - port: {{ .Values.service.internalPort }} + port: {{ .Values.uwsgi.internalPort }} initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} periodSeconds: {{ .Values.liveness.periodSeconds }} {{ end -}} readinessProbe: tcpSocket: - port: {{ .Values.service.internalPort }} + port: {{ .Values.uwsgi.internalPort }} initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} periodSeconds: {{ .Values.readiness.periodSeconds }} env: @@ -110,7 +114,7 @@ spec: - mountPath: /etc/localtime name: localtime readOnly: true - - mountPath: /usr/local/bin/conductor.conf + - mountPath: /usr/local/etc/conductor/conductor.conf name: {{ .Values.global.commonConfigPrefix }}-config subPath: conductor.conf - mountPath: /usr/local/bin/log.conf @@ -120,6 +124,38 @@ spec: name: {{ .Values.global.commonConfigPrefix }}-config subPath: AAF_RootCA.cer resources: +{{ include "common.resources" . | indent 12 }} + - name: {{ include "common.name" . }}-nginx + image: "{{ .Values.global.dockerHubRepository }}/{{ .Values.nginx.image }}" + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + ports: + - containerPort: {{ .Values.service.internalPort }} + {{- if .Values.liveness.enabled }} + livenessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} + periodSeconds: {{ .Values.liveness.periodSeconds }} + {{ end -}} + readinessProbe: + tcpSocket: + port: {{ .Values.service.internalPort }} + initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} + periodSeconds: {{ .Values.readiness.periodSeconds }} + volumeMounts: + - mountPath: /etc/localtime + name: localtime + readOnly: true + - mountPath: /opt/bitnami/nginx/conf/nginx.conf + name: {{ .Values.global.commonConfigPrefix }}-config + subPath: nginx.conf + - mountPath: /opt/bitnami/nginx/ssl/org.onap.oof.crt + name: {{ .Values.global.commonConfigPrefix }}-config + subPath: org.onap.oof.crt + - mountPath: /opt/bitnami/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 }} nodeSelector: @@ -137,11 +173,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"