kj | 6a8ce80 | 2018-03-19 15:07:44 +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" . }} |
Hector Anapan-Lavalle | 10529e6 | 2018-08-07 21:31:05 -0400 | [diff] [blame] | 17 | release: {{ .Release.Name }} |
kj | 6a8ce80 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 18 | name: {{ .Release.Name }} |
| 19 | spec: |
| 20 | initContainers: |
| 21 | - command: |
| 22 | - /root/ready.py |
| 23 | args: |
| 24 | - --container-name |
| 25 | - aai-traversal |
| 26 | env: |
| 27 | - name: NAMESPACE |
| 28 | valueFrom: |
| 29 | fieldRef: |
| 30 | apiVersion: v1 |
| 31 | fieldPath: metadata.namespace |
| 32 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 33 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 34 | name: {{ include "common.name" . }}-readiness |
| 35 | containers: |
| 36 | - name: {{ include "common.name" . }} |
| 37 | image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}" |
| 38 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 39 | volumeMounts: |
| 40 | - mountPath: /etc/localtime |
| 41 | name: localtime |
| 42 | readOnly: true |
| 43 | - mountPath: /dev/log |
| 44 | name: aai-service-log |
| 45 | - mountPath: /usr/local/etc/haproxy/haproxy.cfg |
| 46 | subPath: haproxy.cfg |
| 47 | name: haproxy-cfg |
| 48 | ports: |
| 49 | - containerPort: {{ .Values.service.internalPort }} |
| 50 | - containerPort: {{ .Values.service.internalPort2 }} |
| 51 | # disable liveness probe when breakpoints set in debugger |
| 52 | # so K8s doesn't restart unresponsive container |
| 53 | {{- if eq .Values.liveness.enabled true }} |
| 54 | livenessProbe: |
| 55 | tcpSocket: |
| 56 | port: {{ .Values.service.internalPort2 }} |
| 57 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 58 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 59 | {{ end -}} |
| 60 | readinessProbe: |
| 61 | tcpSocket: |
| 62 | port: {{ .Values.service.internalPort2 }} |
| 63 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 64 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 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 }} |
| 75 | |
| 76 | volumes: |
| 77 | - name: localtime |
| 78 | hostPath: |
| 79 | path: /etc/localtime |
| 80 | - name: aai-service-log |
| 81 | hostPath: |
| 82 | path: "/dev/log" |
| 83 | - name: haproxy-cfg |
| 84 | configMap: |
| 85 | name: aai-deployment-configmap |
| 86 | imagePullSecrets: |
| 87 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |