toshrajbhardwaj | f4fc1c6 | 2018-08-06 07:35:14 +0000 | [diff] [blame] | 1 | # Copyright © 2018 Amdocs, Bell Canada, AT&T |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
| 15 | |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 16 | apiVersion: extensions/v1beta1 |
| 17 | kind: Deployment |
| 18 | metadata: |
| 19 | name: {{ include "common.fullname" . }} |
| 20 | namespace: {{ include "common.namespace" . }} |
| 21 | labels: |
| 22 | app: {{ include "common.name" . }} |
| 23 | chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} |
| 24 | release: {{ .Release.Name }} |
| 25 | heritage: {{ .Release.Service }} |
| 26 | spec: |
| 27 | replicas: {{ .Values.replicaCount }} |
| 28 | template: |
| 29 | metadata: |
| 30 | labels: |
| 31 | app: {{ include "common.name" . }} |
Hector Anapan-Lavalle | 3d8a6a1 | 2018-08-07 21:31:05 -0400 | [diff] [blame] | 32 | release: {{ .Release.Name }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 33 | name: {{ .Release.Name }} |
Kajur, Harish (vk250x) | 00107b5 | 2018-09-06 14:44:40 -0400 | [diff] [blame] | 34 | annotations: |
| 35 | checksum/config: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 36 | spec: |
| 37 | initContainers: |
| 38 | - command: |
| 39 | - /root/ready.py |
| 40 | args: |
| 41 | - --container-name |
Kajur, Harish (vk250x) | 76987da | 2018-10-18 22:51:43 -0400 | [diff] [blame] | 42 | - aai-resources |
| 43 | - --container-name |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 44 | - aai-traversal |
Kajur, Harish (vk250x) | 76987da | 2018-10-18 22:51:43 -0400 | [diff] [blame] | 45 | - --container-name |
| 46 | - aai-graphadmin |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 47 | env: |
| 48 | - name: NAMESPACE |
| 49 | valueFrom: |
| 50 | fieldRef: |
| 51 | apiVersion: v1 |
| 52 | fieldPath: metadata.namespace |
| 53 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 54 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 55 | name: {{ include "common.name" . }}-readiness |
| 56 | containers: |
| 57 | - name: {{ include "common.name" . }} |
| 58 | image: "{{ .Values.global.dockerhubRepository | default .Values.dockerhubRepository }}/{{ .Values.image }}" |
| 59 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 60 | volumeMounts: |
| 61 | - mountPath: /etc/localtime |
| 62 | name: localtime |
| 63 | readOnly: true |
| 64 | - mountPath: /dev/log |
| 65 | name: aai-service-log |
| 66 | - mountPath: /usr/local/etc/haproxy/haproxy.cfg |
Ravi Geda | 2578aa1 | 2018-11-07 22:37:16 +0000 | [diff] [blame] | 67 | {{ if .Values.global.installSidecarSecurity }} |
| 68 | subPath: haproxy-pluggable-security.cfg |
| 69 | {{ else }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 70 | subPath: haproxy.cfg |
Ravi Geda | 2578aa1 | 2018-11-07 22:37:16 +0000 | [diff] [blame] | 71 | {{ end }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 72 | name: haproxy-cfg |
| 73 | ports: |
| 74 | - containerPort: {{ .Values.service.internalPort }} |
| 75 | - containerPort: {{ .Values.service.internalPort2 }} |
| 76 | # disable liveness probe when breakpoints set in debugger |
| 77 | # so K8s doesn't restart unresponsive container |
| 78 | {{- if eq .Values.liveness.enabled true }} |
| 79 | livenessProbe: |
| 80 | tcpSocket: |
| 81 | port: {{ .Values.service.internalPort2 }} |
| 82 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 83 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 84 | {{ end -}} |
| 85 | readinessProbe: |
Kajur, Harish (vk250x) | 76987da | 2018-10-18 22:51:43 -0400 | [diff] [blame] | 86 | httpGet: |
| 87 | path: /aai/util/echo |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 88 | port: {{ .Values.service.internalPort2 }} |
Kajur, Harish (vk250x) | 76987da | 2018-10-18 22:51:43 -0400 | [diff] [blame] | 89 | scheme: HTTPS |
| 90 | httpHeaders: |
| 91 | - name: X-FromAppId |
| 92 | value: OOM_ReadinessCheck |
Ravi Geda | 2578aa1 | 2018-11-07 22:37:16 +0000 | [diff] [blame] | 93 | {{ if .Values.global.installSidecarSecurity }} |
| 94 | - name: Authorization |
| 95 | value: Basic YWFpQGFhaS5vbmFwLm9yZzpkZW1vMTIzNDU2IQ== |
| 96 | {{ end }} |
Kajur, Harish (vk250x) | 76987da | 2018-10-18 22:51:43 -0400 | [diff] [blame] | 97 | - name: X-TransactionId |
| 98 | value: {{ uuidv4 }} |
| 99 | - name: Accept |
| 100 | value: application/json |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 101 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 102 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 103 | resources: |
kranthikirang | cb25a53 | 2018-12-07 16:12:02 -0500 | [diff] [blame] | 104 | {{ include "common.resources" . }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 105 | {{- if .Values.nodeSelector }} |
| 106 | nodeSelector: |
kranthikirang | cb25a53 | 2018-12-07 16:12:02 -0500 | [diff] [blame] | 107 | {{ toYaml .Values.nodeSelector | indent 8 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 108 | {{- end -}} |
| 109 | {{- if .Values.affinity }} |
| 110 | affinity: |
kranthikirang | cb25a53 | 2018-12-07 16:12:02 -0500 | [diff] [blame] | 111 | {{ toYaml .Values.affinity | indent 8 }} |
kj | 9bf2731 | 2018-03-19 15:07:44 +0200 | [diff] [blame] | 112 | {{- end }} |
| 113 | |
| 114 | volumes: |
| 115 | - name: localtime |
| 116 | hostPath: |
| 117 | path: /etc/localtime |
| 118 | - name: aai-service-log |
| 119 | hostPath: |
| 120 | path: "/dev/log" |
| 121 | - name: haproxy-cfg |
| 122 | configMap: |
| 123 | name: aai-deployment-configmap |
| 124 | imagePullSecrets: |
| 125 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |