Merge "[AAI] Add model-loader tracing config"
[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: {{- include "common.resourceMetadata" . | nindent 2 }}
21 spec:
22   selector: {{- include "common.selectors" . | nindent 4 }}
23   replicas: {{ .Values.replicaCount }}
24   template:
25     metadata: {{- include "common.templateMetadata" . | nindent 6 }}
26     spec:
27       initContainers:
28       - command: ["sh", "-c", "chown -R 200:200 /share"]
29         image: {{ include "repositoryGenerator.image.busybox" . }}
30         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
31         name: {{ include "common.name" . }}-init
32         volumeMounts:
33         - mountPath: /share
34           name: nexus-data
35       containers:
36         - name: {{ include "common.name" . }}
37           image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.image }}
38           imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
39           ports: {{ include "common.containerPorts" . | nindent 12  }}
40           {{- if eq .Values.liveness.enabled true }}
41           livenessProbe:
42             tcpSocket:
43               port: {{ .Values.service.internalPort }}
44             initialDelaySeconds: {{ .Values.liveness.initialDelaySeconds }}
45             periodSeconds: {{ .Values.liveness.periodSeconds }}
46           {{ end -}}
47           readinessProbe:
48             httpGet:
49               path: {{ .Values.readiness.path }}
50               port: {{ .Values.service.internalPort }}
51             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
52             periodSeconds: {{ .Values.readiness.periodSeconds }}
53           volumeMounts:
54           - mountPath: /sonatype-work
55             name: nexus-data
56           resources:
57 {{- if eq .Values.resources.flavor "large" }}
58 {{ toYaml .Values.resources.large | indent 12 }}
59 {{- else }}
60 {{ toYaml .Values.resources.small | indent 12 }}
61 {{- end -}}
62         {{- if .Values.nodeSelector }}
63         nodeSelector:
64 {{ toYaml .Values.nodeSelector | indent 10 }}
65         {{- end -}}
66         {{- if .Values.affinity }}
67         affinity:
68 {{ toYaml .Values.affinity | indent 10 }}
69         {{- end }}
70       serviceAccountName: {{ include "common.fullname" (dict "suffix" "nothing" "dot" . )}}
71       volumes:
72         - name: nexus-data
73         {{- if .Values.persistence.enabled }}
74           persistentVolumeClaim:
75             claimName: {{ include "common.fullname" . }}
76         {{- else }}
77           emptyDir: {}
78         {{- end }}
79       {{- include "common.imagePullSecrets" . | nindent 6 }}