BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 1 | apiVersion: extensions/v1beta1 |
| 2 | kind: Deployment |
| 3 | metadata: |
| 4 | name: {{ include "common.fullname" . }} |
| 5 | namespace: {{ include "common.namespace" . }} |
| 6 | labels: |
| 7 | app: {{ include "common.name" . }} |
| 8 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 9 | release: {{ .Release.Name }} |
| 10 | heritage: {{ .Release.Service }} |
| 11 | spec: |
| 12 | replicas: {{ .Values.replicaCount }} |
| 13 | template: |
| 14 | metadata: |
| 15 | labels: |
| 16 | app: {{ include "common.name" . }} |
| 17 | release: {{ .Release.Name }} |
Huabing Zhao | 81b8976 | 2018-07-30 06:33:03 +0000 | [diff] [blame] | 18 | annotations: |
| 19 | sidecar.istio.io/inject: "{{.Values.istioSidecar}}" |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 20 | spec: |
| 21 | initContainers: |
| 22 | - command: |
| 23 | - /root/ready.py |
| 24 | args: |
| 25 | - --container-name |
| 26 | - msb-consul |
| 27 | env: |
| 28 | - name: NAMESPACE |
| 29 | valueFrom: |
| 30 | fieldRef: |
| 31 | apiVersion: v1 |
| 32 | fieldPath: metadata.namespace |
| 33 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 34 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 35 | name: {{ include "common.name" . }}-readiness |
| 36 | containers: |
| 37 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 38 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 39 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 40 | ports: |
| 41 | - containerPort: {{ .Values.service.internalPort }} |
| 42 | # disable liveness probe when breakpoints set in debugger |
| 43 | # so K8s doesn't restart unresponsive container |
| 44 | {{- if eq .Values.liveness.enabled true }} |
| 45 | livenessProbe: |
| 46 | tcpSocket: |
| 47 | port: {{ .Values.service.internalPort }} |
| 48 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 49 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 50 | {{ end -}} |
| 51 | readinessProbe: |
| 52 | tcpSocket: |
| 53 | port: {{ .Values.service.internalPort }} |
| 54 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 55 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 56 | env: |
| 57 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 58 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 59 | volumeMounts: |
| 60 | - mountPath: /etc/localtime |
| 61 | name: localtime |
| 62 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 63 | - mountPath: /usr/local/discover-works/logs |
| 64 | name: msb-discovery-logs |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 65 | resources: |
| 66 | {{ toYaml .Values.resources | indent 12 }} |
| 67 | {{- if .Values.nodeSelector }} |
| 68 | nodeSelector: |
| 69 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 70 | {{- end -}} |
| 71 | {{- if .Values.affinity }} |
| 72 | affinity: |
| 73 | {{ toYaml .Values.affinity | indent 10 }} |
| 74 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 75 | |
| 76 | # side car containers |
| 77 | - name: filebeat-onap |
| 78 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 79 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 80 | volumeMounts: |
| 81 | - mountPath: /var/log/onap |
| 82 | name: msb-discovery-logs |
| 83 | - mountPath: /usr/share/filebeat/data |
| 84 | name: msb-discovery-filebeat |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 85 | volumes: |
| 86 | - name: localtime |
| 87 | hostPath: |
| 88 | path: /etc/localtime |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 89 | - name: msb-discovery-logs |
| 90 | emptyDir: {} |
| 91 | - name: msb-discovery-filebeat |
| 92 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 93 | imagePullSecrets: |
| 94 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |