Marek Szwalkiewicz | a662568 | 2020-03-02 17:09:18 +0000 | [diff] [blame] | 1 | # Copyright (c) 2020 Bell Canada, Deutsche Telekom |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | apiVersion: apps/v1 |
| 16 | kind: Deployment |
| 17 | metadata: {{- include "common.resourceMetadata" . | nindent 2 }} |
| 18 | spec: |
| 19 | replicas: {{ .Values.replicaCount }} |
| 20 | selector: {{- include "common.selectors" . | nindent 4 }} |
| 21 | template: |
| 22 | metadata: {{- include "common.templateMetadata" . | nindent 6 }} |
| 23 | spec: |
| 24 | containers: |
| 25 | - name: {{ include "common.name" . }} |
| 26 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
| 27 | command: |
| 28 | - bash |
| 29 | args: |
| 30 | - '-c' |
| 31 | - 'AUTH_TOKEN=`echo -n $API_USERNAME:$API_PASSWORD | base64` /opt/app/onap/python/start.sh' |
| 32 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 33 | ports: {{- include "common.containerPorts" . | nindent 12 }} |
| 34 | {{ if .Values.liveness.enabled }} |
| 35 | livenessProbe: |
| 36 | tcpSocket: |
| 37 | port: {{ .Values.liveness.port }} |
| 38 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 39 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 40 | timeoutSeconds: {{ .Values.liveness.timeoutSeconds }} |
| 41 | {{ end }} |
| 42 | readinessProbe: |
| 43 | tcpSocket: |
| 44 | port: {{ .Values.liveness.port }} |
| 45 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 46 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 47 | timeoutSeconds: {{ .Values.readiness.timeoutSeconds }} |
| 48 | env: |
| 49 | - name: APP_PORT |
| 50 | value: {{ .Values.config.appPort }} |
| 51 | - name: AUTH_TYPE |
| 52 | value: {{ .Values.config.authType }} |
| 53 | - name: API_USERNAME |
| 54 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "api-credentials" "key" "login") | nindent 12 }} |
| 55 | - name: API_PASSWORD |
| 56 | {{- include "common.secret.envFromSecret" (dict "global" . "uid" "api-credentials" "key" "password") | nindent 12 }} |
| 57 | - name: LOG_FILE |
| 58 | value: {{ .Values.config.logFile }} |
| 59 | - name: ARTIFACT_MANAGER_PORT |
| 60 | value: {{ .Values.config.artifactManagerPort }} |
| 61 | - name: ARTIFACT_MANAGER_SERVER_LOG_FILE |
| 62 | value: {{ .Values.config.artifactManagerLogFile }} |
| 63 | volumeMounts: |
| 64 | - mountPath: /etc/localtime |
| 65 | name: localtime |
| 66 | readOnly: true |
| 67 | - mountPath: {{ .Values.persistence.deployedBlueprint }} |
| 68 | name: {{ include "common.fullname" . }}-blueprints |
| 69 | resources: |
| 70 | {{ include "common.resources" . | nindent 12 }} |
| 71 | {{- if .Values.nodeSelector }} |
| 72 | nodeSelector: |
| 73 | {{ toYaml .Values.nodeSelector | nindent 10 }} |
| 74 | {{- end -}} |
| 75 | {{- if .Values.affinity }} |
| 76 | affinity: |
| 77 | {{ toYaml .Values.affinity | nindent 10 }} |
| 78 | {{- end }} |
| 79 | volumes: |
| 80 | - name: localtime |
| 81 | hostPath: |
| 82 | path: /etc/localtime |
| 83 | # Py executor shares the blueprintsprocessor storage (for now) to |
| 84 | # share uploaded CBA files. In the future it will be deprecated |
| 85 | # when all parts of the CDS will make use of Artifact Manager |
| 86 | - name: {{ include "common.fullname" . }}-blueprints |
| 87 | persistentVolumeClaim: |
| 88 | claimName: {{ include "common.release" . }}-cds-blueprints |
| 89 | imagePullSecrets: |
| 90 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |