a9157f4bfad278704c269c11752e86d2357ec57a
[oom.git] / kubernetes / policy / charts / drools / charts / nexus / templates / deployment.yaml
1 # Copyright © 2017 Amdocs, Bell Canada
2 # Modifications Copyright © 2018 AT&T
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.
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: {{ include "common.release" . }}
25     heritage: {{ .Release.Service }}
26 spec:
27   replicas: {{ .Values.replicaCount }}
28   template:
29     metadata:
30       labels:
31         app: {{ include "common.name" . }}
32         release: {{ include "common.release" . }}
33     spec:
34       initContainers:
35       - command: ["sh", "-c", "chown -R 200:200 /share"]
36         image: "{{ .Values.global.ubuntuInitRepository }}/{{ .Values.global.ubuntuInitImage }}"
37         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
38         name: {{ include "common.name" . }}-init
39         volumeMounts:
40         - mountPath: /share
41           name: nexus-data
42       containers:
43         - name: {{ include "common.name" . }}
44           image: "{{ include "common.repository" . }}/{{ .Values.image }}"
45           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
46           ports:
47           - containerPort: {{ .Values.service.externalPort }}
48           {{- if eq .Values.liveness.enabled true }}
49           livenessProbe:
50             tcpSocket:
51               port: {{ .Values.service.externalPort }}
52             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
53             periodSeconds: {{ .Values.liveness.periodSeconds }}
54           {{ end -}}
55           readinessProbe:
56             httpGet:
57               path: {{ .Values.readiness.path }}
58               port: {{ .Values.service.externalPort }}
59             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
60             periodSeconds: {{ .Values.readiness.periodSeconds }}
61           volumeMounts:
62           - mountPath: /etc/localtime
63             name: localtime
64             readOnly: true
65           - mountPath: /sonatype-work
66             name: nexus-data
67           resources:
68 {{ include "common.resources" . | indent 12 }}
69         {{- if .Values.nodeSelector }}
70         nodeSelector:
71 {{ toYaml .Values.nodeSelector | indent 10 }}
72         {{- end -}}
73         {{- if .Values.affinity }}
74         affinity:
75 {{ toYaml .Values.affinity | indent 10 }}
76         {{- end }}
77       volumes:
78         - name: localtime
79           hostPath:
80             path: /etc/localtime
81         - name: nexus-data
82         {{- if .Values.persistence.enabled }}
83           persistentVolumeClaim:
84             claimName: {{ include "common.fullname" . }}
85         {{- else }}
86           emptyDir: {}
87         {{- end }}
88       imagePullSecrets:
89       - name: "{{ include "common.namespace" . }}-docker-registry-key"