Merge "[DMAAP] DMaaP ServiceMesh compatibility"
[oom.git] / kubernetes / policy / components / policy-nexus / templates / deployment.yaml
1 {{/*
2 # Copyright © 2017 Amdocs, Bell Canada
3 # Modifications Copyright © 2018-2020 AT&T Intellectual Property
4 #
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #       http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 */}}
17
18 apiVersion: apps/v1
19 kind: Deployment
20 metadata:
21   name: {{ include "common.fullname" . }}
22   namespace: {{ include "common.namespace" . }}
23   labels:
24     app: {{ include "common.name" . }}
25     chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
26     release: {{ include "common.release" . }}
27     heritage: {{ .Release.Service }}
28 spec:
29   selector:
30     matchLabels:
31       app: {{ include "common.name" . }}
32   replicas: {{ .Values.replicaCount }}
33   template:
34     metadata:
35       labels:
36         app: {{ include "common.name" . }}
37         release: {{ include "common.release" . }}
38     spec:
39       initContainers:
40       - command: ["sh", "-c", "chown -R 200:200 /share"]
41         image: {{ include "repositoryGenerator.image.busybox" . }}
42         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
43         name: {{ include "common.name" . }}-init
44         volumeMounts:
45         - mountPath: /share
46           name: nexus-data
47       containers:
48         - name: {{ include "common.name" . }}
49           image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
50           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
51           ports:
52           - containerPort: {{ .Values.service.externalPort }}
53           {{- if eq .Values.liveness.enabled true }}
54           livenessProbe:
55             tcpSocket:
56               port: {{ .Values.service.externalPort }}
57             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
58             periodSeconds: {{ .Values.liveness.periodSeconds }}
59           {{ end -}}
60           readinessProbe:
61             httpGet:
62               path: {{ .Values.readiness.path }}
63               port: {{ .Values.service.externalPort }}
64             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
65             periodSeconds: {{ .Values.readiness.periodSeconds }}
66           volumeMounts:
67           - mountPath: /etc/localtime
68             name: localtime
69             readOnly: true
70           - mountPath: /sonatype-work
71             name: nexus-data
72           resources:
73 {{- if eq .Values.resources.flavor "large" }}
74 {{ toYaml .Values.resources.large | indent 12 }}
75 {{- else }}
76 {{ toYaml .Values.resources.small | indent 12 }}
77 {{- end -}}
78         {{- if .Values.nodeSelector }}
79         nodeSelector:
80 {{ toYaml .Values.nodeSelector | indent 10 }}
81         {{- end -}}
82         {{- if .Values.affinity }}
83         affinity:
84 {{ toYaml .Values.affinity | indent 10 }}
85         {{- end }}
86       serviceAccountName: {{ include "common.fullname" (dict "suffix" "nothing" "dot" . )}}
87       volumes:
88         - name: localtime
89           hostPath:
90             path: /etc/localtime
91         - name: nexus-data
92         {{- if .Values.persistence.enabled }}
93           persistentVolumeClaim:
94             claimName: {{ include "common.fullname" . }}
95         {{- else }}
96           emptyDir: {}
97         {{- end }}
98       imagePullSecrets:
99       - name: "{{ include "common.namespace" . }}-docker-registry-key"