Merge "[AAI] Add model-loader tracing config"
[oom.git] / kubernetes / multicloud / components / multicloud-windriver / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2018 AT&T
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 */}}
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata: {{- include "common.resourceMetadata" . | nindent 2 }}
21 spec:
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   replicas: {{ .Values.replicaCount }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       initContainers:
28       - command: ["sh", "-c", "chown -R 100:101 /data"]
29         image: {{ include "repositoryGenerator.image.busybox" . }}
30         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31         name: {{ include "common.name" . }}-init
32         volumeMounts:
33         - mountPath: /data
34           name: artifact-data
35       containers:
36       - env:
37         - name: MSB_PROTO
38           value: "http"
39         - name: MSB_ADDR
40           value: "{{ .Values.config.msbgateway }}.{{ include "common.namespace" . }}"
41         - name: MSB_PORT
42           value: "{{ .Values.config.msbPort }}"
43         - name: AAI_ADDR
44           value: "aai.{{ include "common.namespace" . }}"
45         - name: AAI_PORT
46           value: "{{ .Values.config.aai.aaiPort }}"
47         - name: AAI_SCHEMA_VERSION
48           value: "{{ .Values.config.aai.schemaVersion }}"
49         - name: AAI_USERNAME
50           value: "{{ .Values.config.aai.username }}"
51         - name: AAI_PASSWORD
52           value: "{{ .Values.config.aai.password }}"
53         - name: SSL_ENABLED
54           value: "false"
55         name: {{ include "common.name" . }}
56         volumeMounts:
57         - mountPath: "{{ .Values.log.path }}"
58           name: windriver-log
59         - mountPath: /opt/windriver/titanium_cloud/pub/config/log.yml
60           name: windriver-logconfig
61           subPath: log.yml
62         - mountPath: /opt/artifacts/
63           name: artifact-data
64         resources: {{ include "common.resources" . | nindent 10 }}
65         image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.image }}
66         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
67         ports: {{ include "common.containerPorts" . | nindent 10  }}
68         # disable liveness probe when breakpoints set in debugger
69         # so K8s doesn't restart unresponsive container
70         {{ if .Values.liveness.enabled }}
71         livenessProbe:
72           httpGet:
73             path: /api/multicloud-titaniumcloud/v1/swagger.json
74             port: {{ .Values.service.internalPort }}
75             scheme: HTTP
76           initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
77           periodSeconds: {{ .Values.liveness.periodSeconds }}
78           timeoutSeconds: {{ .Values.liveness.timeoutSeconds }}
79           successThreshold: {{ .Values.liveness.successThreshold }}
80           failureThreshold: {{ .Values.liveness.failureThreshold }}
81         {{ end }}
82       # side car containers
83       {{ include "common.log.sidecar" . | nindent 6 }}
84       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.memcached }}
85         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
86         name: memcached
87       - image: {{ include "repositoryGenerator.repository" . }}/{{ .Values.global.artifactImage }}
88         name: framework-artifactbroker
89         command: ["/opt/app/distribution/bin/artifact-dist.sh"]
90         args: ["/opt/app/distribution/etc/mounted/config.json"]
91         ports:
92         - containerPort: 9014
93           protocol: TCP
94         volumeMounts:
95         - mountPath: /opt/app/distribution/etc/mounted/config.json
96           name: windriver-logconfig
97           subPath: config.json
98         - mountPath: /data
99           name: artifact-data
100       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
101       volumes:
102       - name: windriver-log
103         emptyDir: {}
104       {{ include "common.log.volumes" (dict "dot" . "configMapNamePrefix" (tpl .Values.logConfigMapNamePrefix . )) | nindent 6 }}
105       - name: windriver-logconfig
106         configMap:
107           name: {{ include "common.fullname" . }}-log-configmap
108       - name: artifact-data
109       {{- if .Values.persistence.enabled }}
110         persistentVolumeClaim:
111           claimName: {{ include "common.fullname" . }}
112       {{- else }}
113         emptyDir: {}
114       {{- end }}
115       {{- include "common.imagePullSecrets" . | nindent 6 }}
116       restartPolicy: Always