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-discovery |
| 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 | name: {{ .Values.service.name }} |
| 44 | - containerPort: {{ .Values.service.internalPortHttps }} |
| 45 | name: {{ .Values.service.name }}-https |
| 46 | # disable liveness probe when breakpoints set in debugger |
| 47 | # so K8s doesn't restart unresponsive container |
| 48 | {{- if eq .Values.liveness.enabled true }} |
| 49 | livenessProbe: |
| 50 | tcpSocket: |
| 51 | port: {{ .Values.service.internalPort }} |
| 52 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 53 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 54 | {{ end -}} |
| 55 | readinessProbe: |
| 56 | tcpSocket: |
| 57 | port: {{ .Values.service.internalPort }} |
| 58 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 59 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 60 | env: |
| 61 | - name: CONSUL_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 62 | value: msb-consul.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 63 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 64 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 65 | - name: ROUTE_LABELS |
| 66 | value: {{ .Values.config.routeLabels }} |
| 67 | volumeMounts: |
| 68 | - mountPath: /etc/localtime |
| 69 | name: localtime |
| 70 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 71 | - mountPath: /usr/local/apiroute-works/logs |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 72 | name: {{ include "common.fullname" . }}-logs |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 73 | resources: |
| 74 | {{ toYaml .Values.resources | indent 12 }} |
| 75 | {{- if .Values.nodeSelector }} |
| 76 | nodeSelector: |
| 77 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 78 | {{- end -}} |
| 79 | {{- if .Values.affinity }} |
| 80 | affinity: |
| 81 | {{ toYaml .Values.affinity | indent 10 }} |
| 82 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 83 | # side car containers |
| 84 | - name: filebeat-onap |
| 85 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 86 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 87 | volumeMounts: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 88 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 89 | mountPath: /usr/share/filebeat/filebeat.yml |
| 90 | subPath: filebeat.yml |
| 91 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 92 | mountPath: /usr/share/filebeat/data |
| 93 | - name: {{ include "common.fullname" . }}-logs |
| 94 | mountPath: /var/log/onap/msb/msb-iag |
| 95 | - mountPath: /opt/ajsc/etc/config/logback.xml |
| 96 | name: {{ include "common.fullname" . }}-log-conf |
| 97 | subPath: logback.xml |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 98 | volumes: |
Li Zi | c5290dc | 2018-08-06 09:26:27 +0000 | [diff] [blame] | 99 | - name: {{ include "common.fullname" . }}-log-conf |
| 100 | configMap: |
| 101 | name: {{ include "common.fullname" . }}-log |
| 102 | - name: {{ include "common.fullname" . }}-filebeat-conf |
| 103 | configMap: |
| 104 | name: {{ .Release.Name }}-msb-filebeat-configmap |
| 105 | - name: {{ include "common.fullname" . }}-data-filebeat |
| 106 | emptyDir: {} |
| 107 | - name: {{ include "common.fullname" . }}-logs |
| 108 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 109 | - name: localtime |
| 110 | hostPath: |
| 111 | path: /etc/localtime |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 112 | imagePullSecrets: |
| 113 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |