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: |
Huabing Zhao | 8f7cc81 | 2018-08-08 06:27:37 +0000 | [diff] [blame] | 21 | serviceAccountName: msb |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 22 | initContainers: |
| 23 | - command: |
| 24 | - /root/ready.py |
| 25 | args: |
| 26 | - --container-name |
| 27 | - msb-consul |
| 28 | env: |
| 29 | - name: NAMESPACE |
| 30 | valueFrom: |
| 31 | fieldRef: |
| 32 | apiVersion: v1 |
| 33 | fieldPath: metadata.namespace |
| 34 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 35 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 36 | name: {{ include "common.name" . }}-readiness |
| 37 | containers: |
| 38 | - name: {{ include "common.name" . }} |
BorislavG | df11cd5 | 2018-05-06 12:55:20 +0000 | [diff] [blame] | 39 | image: "{{ include "common.repository" . }}/{{ .Values.image }}" |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 40 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 41 | ports: |
| 42 | - containerPort: {{ .Values.service.internalPort }} |
| 43 | # disable liveness probe when breakpoints set in debugger |
| 44 | # so K8s doesn't restart unresponsive container |
| 45 | {{- if eq .Values.liveness.enabled true }} |
| 46 | livenessProbe: |
| 47 | tcpSocket: |
| 48 | port: {{ .Values.service.internalPort }} |
| 49 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 50 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 51 | {{ end -}} |
| 52 | readinessProbe: |
| 53 | tcpSocket: |
| 54 | port: {{ .Values.service.internalPort }} |
| 55 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 56 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 57 | env: |
| 58 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 59 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 60 | volumeMounts: |
| 61 | - mountPath: /etc/localtime |
| 62 | name: localtime |
| 63 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 64 | - mountPath: /usr/local/discover-works/logs |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 65 | name: {{ include "common.fullname" . }}-logs |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 66 | resources: |
| 67 | {{ toYaml .Values.resources | indent 12 }} |
| 68 | {{- if .Values.nodeSelector }} |
| 69 | nodeSelector: |
| 70 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 71 | {{- end -}} |
| 72 | {{- if .Values.affinity }} |
| 73 | affinity: |
| 74 | {{ toYaml .Values.affinity | indent 10 }} |
| 75 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 76 | |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 77 | # Filebeat sidecar container |
| 78 | - name: {{ include "common.name" . }}-filebeat-onap |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 79 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 80 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 81 | volumeMounts: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 82 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 83 | mountPath: /usr/share/filebeat/filebeat.yml |
| 84 | subPath: filebeat.yml |
| 85 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 86 | mountPath: /usr/share/filebeat/data |
| 87 | - name: {{ include "common.fullname" . }}-logs |
| 88 | mountPath: /var/log/onap/msb/msb-discovery |
| 89 | - mountPath: /opt/ajsc/etc/config/logback.xml |
| 90 | name: {{ include "common.fullname" . }}-log-conf |
| 91 | subPath: logback.xml |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 92 | volumes: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 93 | - name: {{ include "common.fullname" . }}-log-conf |
| 94 | configMap: |
| 95 | name: {{ include "common.fullname" . }}-log |
| 96 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 97 | configMap: |
| 98 | name: {{ .Release.Name }}-msb-filebeat-configmap |
| 99 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 100 | emptyDir: {} |
| 101 | - name: {{ include "common.fullname" . }}-logs |
| 102 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 103 | - name: localtime |
| 104 | hostPath: |
| 105 | path: /etc/localtime |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 106 | imagePullSecrets: |
| 107 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |