blob: ccea328c0c7e44f5ec8a6db4b643e05cc1f8bdd7 [file] [log] [blame]
Mike Elliott6ba69cd2018-04-03 16:37:06 -04001# Copyright © 2017 Amdocs, Bell Canada
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
15apiVersion: extensions/v1beta1
16kind: Deployment
17metadata:
18 name: {{ include "common.fullname" . }}
19 namespace: {{ include "common.namespace" . }}
20 labels:
21 app: {{ include "common.name" . }}
22 chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
23 release: {{ .Release.Name }}
24 heritage: {{ .Release.Service }}
25spec:
26 replicas: {{ .Values.replicaCount }}
27 template:
28 metadata:
29 labels:
30 app: {{ include "common.name" . }}
31 release: {{ .Release.Name }}
32 spec:
33 initContainers:
34#Example init container for dependency checking
35# - command:
36# - /root/ready.py
37# args:
38# - --container-name
39# - mariadb
40# env:
41# - name: NAMESPACE
42# valueFrom:
43# fieldRef:
44# apiVersion: v1
45# fieldPath: metadata.namespace
46# image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
47# imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
48# name: {{ include "common.name" . }}-readiness
49 containers:
50 - name: {{ include "common.name" . }}
51 image: "{{ include "common.repository" . }}/{{ .Values.image }}"
52 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
53 ports:
54 - containerPort: {{ .Values.service.internalPort }}
55 # disable liveness probe when breakpoints set in debugger
56 # so K8s doesn't restart unresponsive container
57 {{ if .Values.liveness.enabled }}
58 livenessProbe:
59 tcpSocket:
60 port: {{ .Values.service.internalPort }}
61 initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
62 periodSeconds: {{ .Values.liveness.periodSeconds }}
63 {{ end }}
64 readinessProbe:
65 tcpSocket:
66 port: {{ .Values.service.internalPort }}
67 initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
68 periodSeconds: {{ .Values.readiness.periodSeconds }}
69 env:
70 - name: MSB_ADDR
mahendrr08c3f452018-04-12 06:57:07 +000071 value: "{{ .Values.global.config.msbServiceName }}:{{ .Values.global.config.msbPort }}"
Mike Elliott6ba69cd2018-04-03 16:37:06 -040072 volumeMounts:
73 - name: {{ include "common.fullname" . }}-localtime
74 mountPath: /etc/localtime
75 readOnly: true
76 - name: {{ include "common.fullname" . }}-logs
77 mountPath: /var/log/onap
78 - name: {{ include "common.fullname" . }}-logconfig
79 mountPath: /opt/vfc/gvnfm-vnflcm/config/log.yml
80 subPath: log.yml
81 resources:
82{{ toYaml .Values.resources | indent 12 }}
83 {{- if .Values.nodeSelector }}
84 nodeSelector:
85{{ toYaml .Values.nodeSelector | indent 10 }}
86 {{- end -}}
87 {{- if .Values.affinity }}
88 affinity:
89{{ toYaml .Values.affinity | indent 10 }}
90 {{- end }}
91
92 # side car containers
93 - name: {{ include "common.name" . }}-filebeat-onap
94 image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}"
95 imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
96 volumeMounts:
97 - name: {{ include "common.fullname" . }}-filebeat-conf
98 mountPath: /usr/share/filebeat/filebeat.yml
99 subPath: filebeat.yml
100 - name: {{ include "common.fullname" . }}-logs
101 mountPath: /var/log/onap
102 - name: {{ include "common.fullname" . }}-data-filebeat
103 mountPath: /usr/share/filebeat/data
104
105 volumes:
106 - name: {{ include "common.fullname" . }}-localtime
107 hostPath:
108 path: /etc/localtime
109 - name: {{ include "common.fullname" . }}-logs
110 emptyDir: {}
111 - name: {{ include "common.fullname" . }}-logconfig
112 configMap:
113 name : {{ include "common.fullname" . }}-logging-configmap
114
115 - name: {{ include "common.fullname" . }}-filebeat-conf
116 configMap:
117 name: {{ .Release.Name }}-vfc-filebeat-configmap
118 - name: {{ include "common.fullname" . }}-data-filebeat
119 emptyDir: {}
120 imagePullSecrets:
121 - name: "{{ include "common.namespace" . }}-docker-registry-key"