X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=kubernetes%2Fdcaegen2-services%2Fcommon%2Fdcaegen2-services-common%2Ftemplates%2F_deployment.tpl;h=3b68ad52de827cd490fd4462501acd5bf653b742;hb=a7ac7f022a8d2553d637ad8bf5fe3f12b65aa76e;hp=6c742c07defb1e3665f7cc4e2dcfa324806b0298;hpb=e4aac7a3c577b7bb9eaae93387d482f952ee4b72;p=oom.git diff --git a/kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl b/kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl index 6c742c07de..3b68ad52de 100644 --- a/kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl +++ b/kubernetes/dcaegen2-services/common/dcaegen2-services-common/templates/_deployment.tpl @@ -173,7 +173,14 @@ The exact content of the Deployment generated from this template depends on the content of .Values. The Deployment always includes a single Pod, with a container that uses -the DCAE microservice image. +the DCAE microservice image. The image name and tag are specified by +.Values.image. By default, the image comes from the ONAP repository +(registry) set up by the common repositoryGenerator template. A different +repository for the microservice image can be set using +.Values.imageRepositoryOverride. Note that this repository must not +require authentication, because there is no way to specify credentials for +the override repository. imageRepositoryOverride is intended primarily +for testing purposes. The Deployment Pod may also include a logging sidecar container. The sidecar is included if .Values.log.path is set. The @@ -231,7 +238,7 @@ post-processing. {{- define "dcaegen2-services-common.microserviceDeployment" -}} {{- $log := default dict .Values.log -}} {{- $logDir := default "" $log.path -}} -{{- $certDir := default "" .Values.certDirectory . -}} +{{- $certDir := (eq "true" (include "common.needTLS" .)) | ternary (default "" .Values.certDirectory . ) "" -}} {{- $tlsServer := default "" .Values.tlsServer -}} {{- $commonRelease := print (include "common.release" .) -}} {{- $policy := default dict .Values.policies -}} @@ -250,9 +257,32 @@ spec: metadata: {{- include "common.templateMetadata" . | nindent 6 }} spec: initContainers: + {{- if .Values.readinessCheck }} {{ include "common.readinessCheck.waitFor" . | indent 6 | trim }} + {{- end }} {{- include "common.dmaap.provisioning.initContainer" . | nindent 6 }} {{- if $certDir }} + - name: {{ include "common.name" . }}-aaf-init-readiness + image: {{ include "repositoryGenerator.image.readiness" . }} + imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} + command: + - /app/ready.py + args: + - --container-name + - aaf-cm + env: + - name: NAMESPACE + valueFrom: + fieldRef: + apiVersion: v1 + fieldPath: metadata.namespace + resources: + limits: + cpu: 100m + memory: 100Mi + requests: + cpu: 3m + memory: 20Mi - name: init-tls image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.tlsImage }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} @@ -264,14 +294,14 @@ spec: fieldRef: apiVersion: v1 fieldPath: status.podIP - resources: {{ include "common.resources" . | nindent 2 }} + resources: {{ include "common.resources" . | nindent 10 }} volumeMounts: - mountPath: /opt/app/osaaf name: tls-info {{- end }} {{ include "dcaegen2-services-common._certPostProcessor" . | nindent 4 }} containers: - - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }} + - image: {{ default ( include "repositoryGenerator.repository" . ) .Values.imageRepositoryOverride }}/{{ .Values.image }} imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} name: {{ include "common.name" . }} env: @@ -318,7 +348,7 @@ spec: {{- end }} {{- end }} {{- end }} - resources: {{ include "common.resources" . | nindent 2 }} + resources: {{ include "common.resources" . | nindent 10 }} volumeMounts: - mountPath: /app-config name: {{ ternary "app-config-input" "app-config" (not $drFeedConfig) }} @@ -381,7 +411,7 @@ spec: - name: POLICY_SYNC_DURATION value: "{{ $policy.duration }}" {{- end }} - resources: {{ include "common.resources" . | nindent 2 }} + resources: {{ include "common.resources" . | nindent 10 }} volumeMounts: - mountPath: /etc/policies name: policy-shared