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