ac2550 | 8ac9717 | 2018-04-18 14:23:17 +0200 | [diff] [blame] | 1 | # Copyright © 2017 Amdocs, Bell Canada |
Mukul | 379e252 | 2018-09-05 12:26:02 +0000 | [diff] [blame] | 2 | # Modifications Copyright © 2018 AT&T |
ac2550 | 8ac9717 | 2018-04-18 14:23:17 +0200 | [diff] [blame] | 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
ac2550 | 8ac9717 | 2018-04-18 14:23:17 +0200 | [diff] [blame] | 15 | |
| 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" . }} |
| 32 | release: {{ .Release.Name }} |
| 33 | spec: |
| 34 | initContainers: |
| 35 | - command: |
| 36 | - /root/ready.py |
| 37 | args: |
| 38 | - --container-name |
| 39 | - clamp-dash-es |
| 40 | env: |
| 41 | - name: NAMESPACE |
| 42 | valueFrom: |
| 43 | fieldRef: |
| 44 | apiVersion: v1 |
| 45 | fieldPath: metadata.namespace |
| 46 | image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" |
| 47 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 48 | name: {{ include "common.name" . }}-readiness |
| 49 | - args: |
| 50 | - --output=http://{{.Values.config.elasticsearchServiceName}}.{{ include "common.namespace" . }}:{{.Values.config.elasticsearchPort}}/.kibana |
| 51 | - --input=/config/default.json |
| 52 | - --type=data |
| 53 | env: |
| 54 | - name: NAMESPACE |
| 55 | valueFrom: |
| 56 | fieldRef: |
| 57 | apiVersion: v1 |
| 58 | fieldPath: metadata.namespace |
| 59 | image: "{{ .Values.configRepository }}/{{ .Values.configImage }}" |
| 60 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 61 | name: {{ include "common.name" . }}-config |
| 62 | volumeMounts: |
| 63 | - mountPath: /config/default.json |
| 64 | name: {{ include "common.fullname" . }} |
| 65 | subPath: default.json |
| 66 | containers: |
| 67 | - name: {{ include "common.name" . }} |
| 68 | image: "{{ .Values.global.loggingRepository | default .Values.loggingRepository }}/{{ .Values.image }}" |
| 69 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 70 | ports: |
| 71 | - containerPort: {{ .Values.service.internalPort }} |
| 72 | name: {{ include "common.servicename" . }} |
| 73 | readinessProbe: |
| 74 | tcpSocket: |
| 75 | port: {{ .Values.service.internalPort }} |
| 76 | initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }} |
| 77 | periodSeconds: {{ .Values.readiness.periodSeconds }} |
| 78 | # disable liveness probe when breakpoints set in debugger |
| 79 | # so K8s doesn't restart unresponsive container |
| 80 | {{- if eq .Values.liveness.enabled true }} |
| 81 | livenessProbe: |
| 82 | tcpSocket: |
| 83 | port: {{ .Values.service.internalPort }} |
| 84 | initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }} |
| 85 | periodSeconds: {{ .Values.liveness.periodSeconds }} |
| 86 | {{ end -}} |
| 87 | env: |
| 88 | volumeMounts: |
| 89 | - mountPath: /etc/localtime |
| 90 | name: localtime |
| 91 | readOnly: true |
| 92 | - mountPath: /usr/share/kibana/config/kibana.yml |
| 93 | name: {{ include "common.fullname" . }} |
| 94 | subPath: kibana.yml |
| 95 | resources: |
Mandeep Khinda | 5e3f36a | 2018-09-24 15:25:42 +0000 | [diff] [blame] | 96 | {{ include "common.resources" . | indent 12 }} |
ac2550 | 8ac9717 | 2018-04-18 14:23:17 +0200 | [diff] [blame] | 97 | {{- if .Values.nodeSelector }} |
| 98 | nodeSelector: |
| 99 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 100 | {{- end -}} |
| 101 | {{- if .Values.affinity }} |
| 102 | affinity: |
| 103 | {{ toYaml .Values.affinity | indent 10 }} |
| 104 | {{- end }} |
| 105 | volumes: |
| 106 | - name: localtime |
| 107 | hostPath: |
| 108 | path: /etc/localtime |
| 109 | - name: {{ include "common.fullname" . }} |
| 110 | configMap: |
| 111 | name: {{ include "common.fullname" . }} |
| 112 | items: |
| 113 | - key: kibana.yml |
| 114 | path: kibana.yml |
| 115 | - key: default.json |
| 116 | path: default.json |
| 117 | |
| 118 | imagePullSecrets: |
| 119 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |