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 | # TODO: Temporary command: |
| 37 | command: |
| 38 | - /bin/sh |
| 39 | - -c |
| 40 | - export AUTH_TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token); /bin/kube2msb --kube_master_url=${KUBE_MASTER_URL} --msb_url=${MSB_URL} |
| 41 | image: "{{ .Values.global.repository | default .Values.repository }}/{{ .Values.image }}" |
| 42 | imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} |
| 43 | env: |
| 44 | - name: KUBE_MASTER_URL |
| 45 | value: {{ .Values.config.kubeMasterUrl }} |
| 46 | - name: MSB_URL |
| 47 | value: {{tpl $.Values.config.discoveryUrl .}} |
| 48 | volumeMounts: |
| 49 | - mountPath: /etc/localtime |
| 50 | name: localtime |
| 51 | readOnly: true |
| 52 | resources: |
| 53 | {{ toYaml .Values.resources | indent 12 }} |
| 54 | {{- if .Values.nodeSelector }} |
| 55 | nodeSelector: |
| 56 | {{ toYaml .Values.nodeSelector | indent 10 }} |
| 57 | {{- end -}} |
| 58 | {{- if .Values.affinity }} |
| 59 | affinity: |
| 60 | {{ toYaml .Values.affinity | indent 10 }} |
| 61 | {{- end }} |
| 62 | volumes: |
| 63 | - name: localtime |
| 64 | hostPath: |
| 65 | path: /etc/localtime |
| 66 | imagePullSecrets: |
| 67 | - name: "{{ include "common.namespace" . }}-docker-registry-key" |