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 }} |
| 18 | spec: |
| 19 | initContainers: |
| 20 | - command: |
| 21 | - /root/ready.py |
| 22 | args: |
| 23 | - --container-name |
| 24 | - msb-discovery |
| 25 | env: |
| 26 | - name: NAMESPACE |
| 27 | valueFrom: |
| 28 | fieldRef: |
| 29 | apiVersion: v1 |
| 30 | fieldPath: metadata.namespace |
| 31 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 32 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 33 | name: {{ include "common.name" . }}-readiness |
| 34 | containers: |
| 35 | - name: {{ include "common.name" . }} |
| 36 | image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" |
| 37 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 38 | ports: |
| 39 | - containerPort: {{ .Values.service.internalPort }} |
| 40 | name: {{ .Values.service.name }} |
| 41 | - containerPort: {{ .Values.service.internalPortHttps }} |
| 42 | name: {{ .Values.service.name }}-https |
| 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 | - name: SDCLIENT_IP |
BorislavG | 6c7ecf0 | 2018-04-01 13:08:37 +0300 | [diff] [blame] | 61 | value: msb-discovery.{{ include "common.namespace" . }} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 62 | - name: ROUTE_LABELS |
| 63 | value: {{ .Values.config.routeLabels }} |
| 64 | volumeMounts: |
| 65 | - mountPath: /etc/localtime |
| 66 | name: localtime |
| 67 | readOnly: true |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 68 | - mountPath: /usr/local/apiroute-works/logs |
| 69 | name: msb-discovery-logs |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 70 | resources: |
| 71 | {{ toYaml .Values.resources | indent 12 }} |
| 72 | {{- if .Values.nodeSelector }} |
| 73 | nodeSelector: |
| 74 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 75 | {{- end -}} |
| 76 | {{- if .Values.affinity }} |
| 77 | affinity: |
| 78 | {{ toYaml .Values.affinity | indent 10 }} |
| 79 | {{- end }} |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 80 | # side car containers |
| 81 | - name: filebeat-onap |
| 82 | image: "{{ .Values.global.loggingRepository }}/{{ .Values.global.loggingImage }}" |
| 83 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 84 | volumeMounts: |
| 85 | - mountPath: /var/log/onap |
| 86 | name: msb-discovery-logs |
| 87 | - mountPath: /usr/share/filebeat/data |
| 88 | name: msb-discovery-filebeat |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 89 | volumes: |
| 90 | - name: localtime |
| 91 | hostPath: |
| 92 | path: /etc/localtime |
LiZi | 4dd8e11 | 2018-04-09 07:34:04 -0400 | [diff] [blame] | 93 | - name: msb-discovery-logs |
| 94 | emptyDir: {} |
| 95 | - name: msb-discovery-filebeat |
| 96 | emptyDir: {} |
BorislavG | 0433c91 | 2018-03-21 18:35:30 +0200 | [diff] [blame] | 97 | imagePullSecrets: |
| 98 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |